Kernighan & Ritchie Book – £20
Under C Programming, Headlines
Discuss, 1 Comment.
Follow any responses to this entry through the RSS 2.0 feed.
Posted on Thursday, October 19th, 2006 at 7:05 pm
Under C Programming, Headlines
Discuss, 1 Comment.
Follow any responses to this entry through the RSS 2.0 feed.
Posted on Thursday, October 19th, 2006 at 7:05 pm
Absolutely MAD offer – only £20 from me. Just send me an e-mail and I will call you. Pass this information on to all the course mates. I may also be willing to haggle cheaper!
Don’t forget this book costs £35 in the SU shop, and has been seen for £40 in some places.
ONLY LIMITED AVAILABILTY (Only have a few!) – ASK ME NOW BEFORE ITS TOO LATE!
This is a must have for anyone studying C Programming, written by the creators of C, it is considered the bible of the programming community.
© 2009 James Walmsley. All rights reversed. Contact us.
23-Oct-06
; task3.asm
; by James Walmsley
include”P16F877.INC” ;include the pic 16f877 assembly definitions
TIMREG EQU H’0020′ ;set the timreg funtion to reside in register 20
TIMREG1 EQU H’0021′ ;set the timreg1 funtion to reside in register 21
CNTREG EQU H’0022′ ;set counter to register 22
delval EQU H’00FF’ ; set time delay value to 255
delval1 EQU H’00FF’ ; set time delay1 to 255
banksel TRISD ; change reagister bank
clrf PORTD ; make PORTD output
banksel PORTD ; select portd
start movlw 0 ; mov 0 value into Working register (w)
movwf CNTREG ; move 0 to Counter
movwf PORTD ;clear LEDs on PORTD
loop movfw CNTREG
call table ; update leds by incrementing them
movwf PORTD ; move W to Port D
call counter ; Call counter routine
call delay ; call delay subroutine
; nop ; do nothign for a clock cycle
; except increment the program counter by 1
goto loop ; go back to loop lable
delay movlw delval ; load w with the delay time value
movwf TIMREG ; put value into register
time call delay1 ; goto next delay routine
decfsz TIMREG,f ; subtract 1 and skip to next instruction if is zero
goto time ; go back and take off another 1 till 0
return
delay1 movlw delval1 ; load w with the delay time value
movwf TIMREG1 ; put value into register
time1 decfsz TIMREG1,f ; subtract 1 and skip to next instruction if is zero
goto time1 ; go back and take off another 1 till 0
return
table addwf PCL ;add the W to the Program counter to point to 1st item in table
retlw H’0008′ ; Hex code to display a 0 shape
retlw H’001B’ ; Hex code to display a 1 shape
retlw H’0014′ ; Hex code to display a 2 shape
retlw H’0004′ ; Hex code to display a 3 shape
retlw H’0008′ ; Hex code to display a 4 shape
retlw H’0010′ ; Hex code to display a 5 shape
retlw H’0002′ ; Hex code to display a 6 shape
retlw H’0040′ ; Hex code to display a 7 shape
retlw H’0000′ ; Hex code to display a 8 shape
retlw H’00F0′ ; Hex code to display a 9 shape
counter movfw CNTREG ; move current value of counter to W reg
addlw 1 ; add 1 to working reg
movwf CNTREG ; mov w to cntreg
return ; return to main program
end