ORG 0000H
LJMP MAIN
ORG 00F0H
DELAY:
MOV R7,#0
LOOP:
MOV R6,#0
DJNZ R6,$
DJNZ R6,$
DJNZ R6,$
DJNZ R6,$
DJNZ R7,LOOP
RET
MAIN:
MOV R0,#07H
CLR P1.0
SETB P1.1
SETB P1.0
LCALL DELAY
CLR P1.0
LCALL DELAY
CLR P1.1
LOOP2:
SETB P1.0
LCALL DELAY
CLR P1.0
LCALL DELAY
DJNZ R0,LOOP2
LJMP MAIN
END
用上面的图和下面的程序,我也不肯定是完全是对的,只是参考而已