16×16点阵显示汇编程序.doc
《16×16点阵显示汇编程序.doc》由会员分享,可在线阅读,更多相关《16×16点阵显示汇编程序.doc(9页珍藏版)》请在三一办公上搜索。
1、ORG 0000HAJMP READYORG 000BHAJMP INT_0;只需更改点阵数据和要显示的总字数READY:MOV P0,#0FFH MOV P1,#0FFH MOV P2,#0FFH MOV P3,#0FFH MOV SP,#70H MOV 36H,#2D MOV 37H,#00H;* MOV 3AH,#17D ;设置要显示的总字数;* LCALL DATA_CHUSHI SETB EA SETB ET0 MOV TMOD,#01H MOV TH0,#0A6H MOV TL0,#00H SETB TR0;主程序MAIN:ACALL DISP_READY ACALL KEY AJ
2、MP MAIN;*DATA_CHUSHI:MOV 35H,#00H MOV 38H,#00H MOV 39H,#01H ;初始化时已显示第一个字 MOV 3BH,#0A0H ;暂存r0指向地址 MOV DPTR,#DATA1 MOV R0,#0A0H;点阵数据存放地址 MOV 30H,#32D;数据字节数 SEND_DATA0:MOV A,#00H MOVC A,A+DPTR MOV R0,A INC R0 INC DPTR DJNZ 30H,SEND_DATA0;* MOV R0,#0C0H;点阵数据存放地址 MOV 30H,#32D;数据字节数SEND_DATA1:MOV A,#00H M
3、OVC A,A+DPTR MOV R0,A INC R0 INC DPTR DJNZ 30H,SEND_DATA1;* MOV DPTR,#DATA1+32 MOV R0,#80H;点阵数据存放地址 MOV 30H,#32D;数据字节数SEND_DATA2:MOV A,#00H MOVC A,A+DPTR MOV R0,A INC R0 INC DPTR DJNZ 30H,SEND_DATA2 RET ;*KEY:MOV P3,#0FFH MOV A,P3ANL A,#00000011BCJNE A,#00000011B,KEY_PANDUANRETKEY_PANDUAN:MOV 34H,A
4、ACALL KEY_DELAYMOV A,P3ANL A,#00000011BCJNE A,34H,KEY_EXITACALL KEY_CHULIKEY_EXIT: RET;*KEY_CHULI:JB ACC.0,KEY_2 MOV A,37H ADD A,#40H MOV 37H,A LCALL DATA_CHUSHI RETKEY_2: JB ACC.1,KEY_CHULI_EXIT INC 36H INC 36H MOV A,36H CJNE A,#14D,CHANGE_36H MOV A,#2DCHANGE_36H:MOV 36H,A MOV 35H,#00H RETKEY_CHULI
5、_EXIT:RET;*KEY_DELAY:DLY_LP1: MOV R1,#20MOVR6,#50DLY_LP2:NOPNOPNOPDJNZR6,DLY_LP2DJNZR7,DLY_LP1END_DLYMS:RET ;*;显示程序DISP_READY:MOV R0,3BH MOV 30H,#16D MOV 31H,#00H DISP:MOV A,R0 MOV P0,A INC R0 MOV A,R0 MOV P2,A MOV P1,31H ACALL DISP_DELAY MOV P0,#00H MOV P1,#0FFH MOV P2,#00H INC 31H INC R0 DJNZ 30H,
6、DISPDISP_EXIT: RET;显示延时 DISP_DELAY:MOV 32H,#2D1:MOV 33H,#150 DJNZ 33H,$ DJNZ 32H,D1 RET;中断处理程序INT_0:PUSH ACC MOV TH0,#0A6H MOV TL0,#00H INC 35H MOV A,35H CJNE A,36H,INT0_EXIT MOV 35H,#00H ACALL WHICH_WAYINT0_EXIT:POP ACC RETI;*WHICH_WAY:MOV A,37H CJNE A,#00H,WAY2 ACALL YIDONG1 RETWAY2: CJNE A,#40H,W
7、AY3 ACALL YIDONG2 RETWAY3: CJNE A,#80H,WAY4 ACALL YIDONG3 RETWAY4: ACALL YIDONG4 RET;*YIDONG1: MOV 50H,#0A1H MOV 51H,#0C1H MOV 3CH,#16D INC 38H MOV A,38H CJNE A,#16D,YIDONG1_THEN1 MOV 38H,#00H INC 39H MOV A,39H CJNE A,3AH,YIDONG1_THEN MOV 39H,#00H MOV DPTR,#DATA1YIDONG1_THEN: MOV 3CH,#32D MOV R1,#0C
8、0HYIDONG1_SEND_DATA:MOV A,#00H MOVC A,A+DPTR MOV R1,A INC R1 INC DPTR DJNZ 3CH,YIDONG1_SEND_DATA MOV 3CH,#16DYIDONG1_THEN1: MOV R1,51H MOV A,R1 RLC A MOV R1,A DEC R1 MOV A,R1 RLC A MOV R1,A MOV R1,50H MOV A,R1 RLC A MOV R1,A DEC R1 MOV A,R1 RLC A MOV R1,A INC 50H INC 50H INC 51H INC 51H DJNZ 3CH,YID
9、ONG1_THEN1 RET;*YIDONG2:MOV 50H,#0A0H MOV 51H,#80H MOV 3CH,#16DINC 38HMOV A,38HCJNE A,#16D,YIDONG2_THEN1MOV 38H,#00H INC 39HMOV A,39H CJNE A,3AH,YIDONG2_THEN MOV 39H,#00H MOV DPTR,#DATA1YIDONG2_THEN:MOV 3CH,#32DMOV R1,#80HYIDONG2_SEND_DATA:MOV A,#00H MOVC A,A+DPTR MOV R1,A INC R1 INC DPTR DJNZ 3CH,Y
10、IDONG2_SEND_DATA MOV 3CH,#16DYIDONG2_THEN1:MOV R1,51H MOV A,R1 RRC A MOV R1,A INC R1 MOV A,R1 RRC A MOV R1,A MOV R1,50H MOV A,R1 RRC A MOV R1,A INC R1 MOV A,R1 RRC A MOV R1,A INC 50H INC 50H INC 51H INC 51H DJNZ 3CH,YIDONG2_THEN1 RET;*YIDONG3:INC 3BH INC 3BHMOV 30H,#01HINC 38HMOV A,38HCJNE A,#16D,YI
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 16 点阵 显示 汇编程序
链接地址:https://www.31ppt.com/p-2392363.html