您的位置 首页 新能源

单片机十字旋转LED程序

ORG0000HMAIN:MOVDPTR,TABMOVR2,0MM:MOVA,R2MOVCA,@A+DPTRlcallhbitCPLAMOVR4,AINCR2MOVA,R2

ORG 0000H
MAIN: MOV DPTR,#TAB
MOV R2,#0
MM: MOV A,R2
MOVC A,@A+DPTR
lcall hbit
CPL A
MOV R4,A
INC R2
MOV A,R2
MOVC A,@A+DPTR
lcall hbit
CPL A
MOV R3,A
INC R2

MOV P0,R4
MOV P2,R3
DJNZ R6,$
DJNZ R6,$
MOV A,R2
CJNE A,#128,mm ;其间的128代表四个汉字的长度,1个汉字32,2个64—-8个到255.
LJMP main

hbit: ;字符倒置
mov c,acc.0
mov b.7,c
mov c,acc.1
mov b.6,c
mov c,acc.2
mov b.5,c
mov c,acc.3
mov b.4,c
mov c,acc.4
mov b.3,c
mov c,acc.5
mov b.2,c
mov c,acc.6
mov b.1,c
mov c,acc.7
mov b.0,c
mov a,b
ret

TAB: ;详细显现内容,这里是4个汉字
db 08h,20h,06h,20h,80h,7eh,63h,80h
db 0ch,04h,00h,04h,20h,04h,20h,04h
db 20h,04h,3fh,0fch,20h,04h,20h,04h
db 20h,04h,20h,04h,00h,04h,00h,00h
db 20h,00h,20h,02h,22h,32h,22h,0e4h
db 22h,08h,0fah,30h,22h,0e0h,2fh,80h
db 22h,04h,0fah,02h,22h,02h,23h,0fch
db 20h,00h,20h,40h,20h,30h,00h,00h
db 20h,00h,20h,00h,27h,0feh,24h,20h
db 24h,0a0h,26h,0a0h,2dh,0a0h,0f4h,0feh
db 24h,0a0h,25h,0a0h,26h,0a0h,24h,0a4h
db 24h,22h,67h,0fch,20h,00h,00h,00h
db 00h,00h,20h,04h,20h,08h,27h,98h
db 24h,0b0h,24h,82h,0a4h,81h,64h,0feh
db 24h,80h,24h,80h,24h,0a0h,27h,0b0h
db 60h,1ch,20h,08h,00h,00h,00h,00h

end

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/qiche/xinnengyuan/261247.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部