|
走马灯汇编源程序
- ORG 0000H
- AJMP MAIN
- ORG 0013H
- LJMP IN11
- ORG 0030H
- MAIN: SETB EA
- SETB EX1
- CLR PX1
- SETB IT1
- MOV R1,#00H
- SJMP $
-
- ORG 0200H
- IN11: INC R1
- LCALL NEXT
- RETI
- NEXT: MOV A,R1
- MOV B,#2
- DIV AB
- MOV A,B
- JZ LOOP1
- LCALL NEXT1
- RET
- NEXT1: MOV A,#0FEH
- MOV R2,#8
- DO: MOV P1,A
- RL A
- LCALL DELY1S
- DJNZ R2,DO
- RET
- LOOP1: MOV A,#7FH
- MOV R2,#8
- NEXT2: MOV P1,A
- RR A
- LCALL DELY1S
- DJNZ R2,NEXT2
- RET
- DELY1S: MOV R5,#5
- D2: MOV R6,#200
- D1: MOV R7,#248
- DJNZ R7,$
- DJNZ R6,D1
- DJNZ R5,D2
- RET
- END
复制代码
|
|