; DIP Switch (SW6) must have TUTOR on (SW6-1,2,3) all other switches off
list p=18F1320
include <p18F1320.inc>
CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF
LED macro x,y ; MACRO LED <PORTA>, <TRISA>
movlw x
movwf LATA ; LATA = x
movlw y
movwf TRISA ; TRISA = y
call Delay ; call the Delay subroutine
endm ; end macro
Count equ 0 ; delay loop counter
org 0 ; reset vector
bsf ADCON1, 0 ; make RA0 digital
LED1 LED b'00000001', b'10111110' ; LED <PORTA>, <TRISA>
LED2r LED b'01000000', b'10111110' ; LED <PORTA>, <TRISA>
LED3r LED b'01000000', b'00111111' ; LED <PORTA>, <TRISA>
LED4r LED b'10000000', b'00111111' ; LED <PORTA>, <TRISA>
LED5r LED b'10000000', b'01111110' ; LED <PORTA>, <TRISA>
LED6 LED b'00000001', b'01111110' ; LED <PORTA>, <TRISA>
LED5l LED b'10000000', b'01111110' ; LED <PORTA>, <TRISA>
LED4l LED b'10000000', b'00111111' ; LED <PORTA>, <TRISA>
LED3l LED b'01000000', b'00111111' ; LED <PORTA>, <TRISA>
LED2l LED b'01000000', b'10111110' ; LED <PORTA>, <TRISA>
bra LED1 ; loop forever
Delay decfsz Count, f ; decrement Count and skip when zero
bra Delay ; not zero? repeat
return ; return
END