51单片机心形灯汇编程序.docx
- 文档编号:6143134
- 上传时间:2023-01-04
- 格式:DOCX
- 页数:25
- 大小:17.36KB
51单片机心形灯汇编程序.docx
《51单片机心形灯汇编程序.docx》由会员分享,可在线阅读,更多相关《51单片机心形灯汇编程序.docx(25页珍藏版)》请在冰豆网上搜索。
51单片机心形灯汇编程序
ORG0000H
MAIN:
MOVR1,#08H
MOVA,#7FH
DAN2:
MOVP2,A
CALLDELAY
RRA
DJNZR1,DAN2
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#08H
MOVA,#7FH
DAN3:
MOVP3,A
CALLDELAY
RRA
DJNZR1,DAN3
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#08H
MOVA,#7FH
DAN4:
MOVP1,A
CALLDELAY
RRA
DJNZR1,DAN4
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#08H
MOVA,#0FEH
DAN1:
MOVP0,A
ACALLDELAY
RLA
DJNZR1,DAN1
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
;单个跑马灯
MOVR1,#08H
MOVA,#7FH
DAN22:
MOVP2,A
CALLDELAY1
RRA
DJNZR1,DAN22
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#08H
MOVA,#7FH
DAN33:
MOVP3,A
CALLDELAY1
RRA
DJNZR1,DAN33
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#08H
MOVA,#7FH
DAN44:
MOVP1,A
CALLDELAY1
RRA
DJNZR1,DAN44
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#08H
MOVA,#0FEH
DAN11:
MOVP0,A
ACALLDELAY1
RLA
DJNZR1,DAN11
MOVP0,#0FFH
MOVP1,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VP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#08H
QUAN:
;闪烁的频率由慢变快
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
CALLDELAY
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
CALLDELAY
DJNZR1,QUAN
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#08H;渐渐变亮,然后熄灭
MOVA,#07FH
JIAN2:
MOVP2,A
ACALLDELAY1
RRA
ANLA,P2
DJNZR1,JIAN2
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#00H
MOVP3,#0FFH
MOVR1,#08H
MOVA,#07FH
JIAN3:
MOVP3,A
ACALLDELAY1
RRA
ANLA,P3
DJNZR1,JIAN3
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#00H
MOVP3,#00H
MOVR1,#08H
MOVA,#07FH
JIAN4:
MOVP1,A
ACALLDELAY1
RRA
ANLA,P1
DJNZR1,JIAN4
MOVP0,#0FFH
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOVR1,#08H
MOVA,#0FEH
JIAN1:
MOVP0,A
ACALLDELAY1
RLA
ANLA,P0
DJNZR1,JIAN1
MOVP0,#00H
MOVP1,#00H
MOVP2,#00H
MOVP3,#00H
MOVP0,#10101010B
MOVP1,#01010101B
MOVP2,#01010101B
MOVP3,#01010101B
ANLP2,#00010101B
CALLDELAY
ANLP2,#00000101B
CALLDELAY
ANLP2,#00000001B
CALLDELAY
ANLP2,#00000000B
CALLDELAY
ANLP3,#00010101b
CALLDELAY
ANLP3,#00000101b
CALLDELAY
ANLP3,#00000001b
CALLDELAY
ANLP3,#00000000b
CALLDELAY
ANLP1,#00010101b
CALLDELAY
ANLP1,#00000101b
CALLDELAY
ANLP1,#00000001b
CALLDELAY
ANLP1,#00000000b
CALLDELAY
ANLP0,#10101000B
CALLDELAY
ANLP0,#10100000B
CALLDELAY
ANLP0,#10000000B
CALLDELAY
ANLP0,#00000000B
CALLDELAY
ORLP0,#01000000b
CALLDELAY
ORLP0,#01010000b
CALLDELAY
ORLP0,#01010100b
CALLDELAY
ORLP0,#01010101b
CALLDELAY
ORLP1,#00000010b
CALLDELAY
ORLP1,#00001010b
CALLDELAY
ORLP1,#00101010b
CALLDELAY
ORLP1,#10101010b
CALLDELAY
ORLP3,#00000010b
CALLDELAY
ORLP3,#00001010b
CALLDELAY
ORLP3,#00101010b
CALLDELAY
ORLP3,#10101010b
CALLDELAY
ORLP2,#00000010b
CALLDELAY
ORLP2,#00001010b
CALLDELAY
ORLP2,#00101010b
CALLDELAY
ORLP2,#10101010b
CALLDELAY
ANLP0,#00010101B
ANLP2,#00101010B
CALLDELAY
ANLP0,#00000101B
ANLP2,#00001010B
CALLDELAY
ANLP0,#00000001B
ANLP2,#00000010B
CALLDELAY
ANLP0,#00000000B
ANLP2,#00000000B
CALLDELAY
ANLP1,#10101000B
ANLP3,#00101010B
CALLDELAY
ANLP1,#10100000B
ANLP3,#00001010B
CALLDELAY
ANLP1,#10000000B
ANLP3,#00000010B
CALLDELAY
ANLP1,#00000000B
ANLP3,#00000000B
CALLDELAY
ORLP1,#01000000B
ORLP3,#00000001B
CALLDELAY
ORLP1,#01010000B
ORLP3,#00000101B
CALLDELAY
ORLP1,#01010100B
ORLP3,#00010101B
CALLDELAY
ORLP1,#01010101B
ORLP3,#01010101B
CALLDELAY
ORLP0,#00000000B
ORLP2,#00000001B
CALLDELAY
ORLP0,#00001010B
ORLP2,#00000101B
CALLDELAY
ORLP0,#00101010B
ORLP2,#00010101B
CALLDELAY
ORLP0,#10101010B
ORLP2,#01010101B
CALLDELAY
ORLP0,#11000000B
ORLP2,#11000000B
CALLDELAY
ORLP0,#11110000B
ORLP2,#11110000B
CALLDELAY
ORLP0,#11111100B
ORLP2,#11111100B
CALLDELAY
ORLP0,#11111111B
ORLP2,#11111111B
CALLDELAY
ORLP1,#00000011B
ORLP3,#11000000B
CALLDELAY
ORLP1,#00001111B
ORLP3,#11110000B
CALLDELAY
ORLP1,#00111111B
ORLP3,#11111100B
CALLDELAY
ORLP1,#11111111B
ORLP3,#11111111B
CALLDELAY
ANLP1,#01111111B
ANLP3,#11111110B
CALLDELAY
ANLP1,#00111111B
ANLP3,#11111100B
CALLDELAY
ANLP1,#00011111B
ANLP3,#11111100B
CALLDELAY
ANLP1,#00001111B
ANLP3,#11110000B
CALLDELAY
ANLP1,#00000111B
ANLP3,#11100000B
CALLDELAY
ANLP1,#00000011B
ANLP3,#11000000B
CALLDELAY
ANLP1,#00000001B
ANLP3,#10000000B
CALLDELAY
ANLP1,#00000000B
ANLP3,#00000000B
CALLDELAY
ANLP0,#11111110B
ANLP2,#11111110B
CALLDELAY
ANLP0,#11111100B
ANLP2,#11111100B
CALLDELAY
ANLP0,#11111000B
ANLP2,#11111000B
CALLDELAY
ANLP0,#11110000B
ANLP2,#11110000B
CALLDELAY
ANLP0,#11100000B
ANLP2,#11100000B
CALLDELAY
ANLP0,#11000000B
ANLP2,#11000000B
CALLDELAY
ANLP0,#10000000B
ANLP2,#10000000B
CALLDELAY
ANLP0,#00000000B
ANLP2,#00000000B
CALLDELAY
MOVR1,#4
JIAOT:
;交替闪烁
MOVP0,#00110011B
MOVP1,#00110011B
MOVP2,#00110011B
MOVP3,#00110011B
CALLDELAY
MOVP0,#11001100B
MOVP1,#11001100B
MOVP2,#11001100B
MOVP3,#11001100B
CALLDELAY
DJNZR1,JIAOT
MOVP0,#0FFH
MOVP1,#0FFH
MOVP2,#0FFH
MOVP3,#0FFH
MOVR1,#6
SIGE:
MOVP0,#11111110B
MOVP1,#01111111B
MOVP2,#01111111B
MOVP3,#01111111B
CALLDELAY1
MOVP0,#11111100B
MOVP1,#00111111B
MOVP2,#00111111B
MOVP3,#00111111B
CALLDELAY1
MOVP0,#11111000B
MOVP1,#00011111B
MOVP2,#00011111B
MOVP3,#00011111B
CALLDELAY1
MOVP0,#11110000B
MOVP1,#00001111B
MOVP2,#00001111B
MOVP3,#00001111B
CALLDELAY1
MOVP0,#11100000B
MOVP1,#00000111B
MOVP2,#00000111B
MOVP3,#00000111B
CALLDELAY1
MOVP0,#11000000B
MOVP1,#000000111B
MOVP2,#00000011B
MOVP3,#00000011B
CALLDELAY1
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 51 单片 机心 汇编程序