这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » STC51单片机实例之47动态点阵(汇编)

共1条 1/1 1 跳转至

STC51单片机实例之47动态点阵(汇编)

高工
2014-09-13 23:24:53     打赏
                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

 


共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]