新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 單片機(jī)十字旋轉(zhuǎn)LED程序

單片機(jī)十字旋轉(zhuǎn)LED程序

作者: 時(shí)間:2016-11-23 來源:網(wǎng)絡(luò) 收藏

本文引用地址:http://m.butianyuan.cn/article/201611/320348.htm

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代表四個(gè)漢字的長度,1個(gè)漢字32,2個(gè)64----8個(gè)到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: ;具體顯示內(nèi)容,這里是4個(gè)漢字
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



評(píng)論


技術(shù)專區(qū)

關(guān)閉