- UID
- 1023166
- 性别
- 男
- 来自
- 燕山大学
|
点阵移动(51汇编)
ORG 0000H
START: clr p2.1
LOOP3: MOV R3,#2
MOV R4,#0
MOV P0,#0FFH
loop1: MOV R0,#0
LCALL XIANSHI
djnz r3,loop1
LCALL DEY
inc r4
MOV R3,#2
cjne r4,#17,loop1
SJMP LOOP3
XIANSHI:mov r2,#8
MOV A,R4
MOV R1,A
loop4: MOV DPTR,#TABB
MOV A,R0
MOVC A,@A+DPTR
MOV P0,A
INC R0
MOV DPTR,#TABA
MOV A,R1
MOVC A,@A+DPTR
MOV P2,A
INC R1
LCALL DEY
DJNZ R2,loop4
MOV R1,#0
ret
DEY:
MOV R6,#50
MOV R7,#50
PP:
DJNZ R7,$
DJNZ R6,PP
RET
DELAY:
MOV R5,#255
MOV R4,#255
PPP:
DJNZ R7,$
DJNZ R6,PPP
RET
TABA: DB 0FFH,0BDH,0BDH,081H,0BDH,0BDH,0FFH,0FFH,0FFH,0BDH,0BDH,081H,0BDH,0BDH,0FFH,0FFH,0FFH,0BDH,0BDH,081H,0BDH,0BDH,0FFH,0FFH
TABB: DB 01H,02H,04H,08H,10H,20H,40H,80H
END |
|