org 0
jmp main
delay:
mov R7,#2
DL1: MOV R6,#255
DL2: MOV R5,#255
DL3: DJNZ R5,DL3
DJNZ R6,DL2 DJNZ R7,DL1 RET
TR_OUT MACRO NUMB
MOV P1,NUMB
CALL DELAY ENDM
MAIN:
tr_out #0x01
tr_out #0x02
tr_out #0x04
tr_out #0x08
tr_out #0x10
tr_out #0x20
tr_out #0x40
tr_out #0x80
jmp main
ret
Trang 2end