系统执行软件源程序代码Word下载.docx
- 文档编号:13963990
- 上传时间:2022-10-16
- 格式:DOCX
- 页数:21
- 大小:26.74KB
系统执行软件源程序代码Word下载.docx
《系统执行软件源程序代码Word下载.docx》由会员分享,可在线阅读,更多相关《系统执行软件源程序代码Word下载.docx(21页珍藏版)》请在冰豆网上搜索。
CLRRS0
LCALLBCDZH
LCALLDISPLAY
CLRRS1
CLRRS0
SJMP MAIN
------------------串行口中断服务子程序----------------------------------------------------------------------------------
SJCS:
CLRRI
PUSHA
PUSHPSW
MOV A,SBUF
XRLA,#SLAVE
JZSJCS0
SJCS1:
SETBSM2
POPPSW
POPA
RETI
SJCS0:
CLR SM2
MOVSBUF,#SLAVE
JNB TI,$
CLR TI
JNB RI,$
CLRRI
MOV A,SBUF
XRLA,#11H
JZ SJCS2
SJMPSJCS1
SJCS2:
MOVA,25H
ADDA,#1
MOVSBUF,A
JNB TI,$
CLRTI
MOV22H,#00H
SJMPSJCS1
----------------18B20温度采集子程序------------------------------------------------------------------------------------
WDCJ:
MOVSP,#60H
LCALL GET_TEMP
MOV A,21H
MOVC,00H
RRCA
MOVC,01H
RRCA
MOVC,02H
RRCA
MOV C,03H
RRCA
MOV 21H,A
MOV25H,A
LCALL BCDZH
LCALLDISPLAY
AJMPMAIN
------------------18B20温度采集时序子程序------------------------------------------------------------------------------
GET_TEMP:
CLR EA
LCALLINT
MOVA,#0CCH
LCALLWRITE
MOVA,#44H
LCALLWRITE
LCALL INT
MOVA,#0CCH
LCALLWRITE
MOVA,#0BEH
LCALLWRITE
LCALLREAD
MOV21H,A
LCALLREAD
MOV20H,A
SETBEA
RET
----------------18B20初始化子程序-----------------------------------------------------------------------------------
INT:
CLREA
L0:
CLRDK
MOV R2,#200
L1:
CLR DK
DJNZR2,L1
SETBDK
MOV R2,#30
L4:
DJNZR2,L4
CLRC
ORLC,DK
JCL0
MOV R6,#80
L5:
ORLC,DK
JCL3
DJNZR6,L5
SJMPL0
L3:
MOVR2,#200
L2:
DJNZ R2,L2
RET
----------------18B20写命令子程序-----------------------------------------------------------------------------------------
WRITE:
CLREA
MOVR3,#8
WR1:
SETBDK
MOVR4,#8
RRCA
CLRDK
WR2:
DJNZR4,WR2
MOV DK,C
MOV R4,#20
WR3:
DJNZR4,WR3
DJNZR3,WR1
SETBDK
RET
-------------------18B20读数据子程序
READ:
CLREA
MOVR6,#8
RE1:
CLRDK
MOVR4,#4
NOP
SETBDK
RE2:
DJNZ R4,RE2
MOVC,DK
RRCA
MOVR5,#30
RE3:
DJNZR5,RE3
DJNZR6,RE1
SETBDK
RET
-----------------八为十六转十进制子程序-----------------------------------------------------------------------------------
BCDZH:
INC21H
MOVA,21H
MOV 30H,#12
JNBACC.7,BCD0
MOV 30H,#11
CPLA
ADDA,#1
BCD0:
MOVR1,#00H
MOVR2,#00H
CLR C
BCD1:
SUBB A,#64H
JCBCD2
INCR1
SJMPBCD1
BCD2:
ADD A,#64H
BCD3:
SUBBA,#0AH
JCBCD4
INCR2
SJMPBCD3
BCD4:
ADDA,#0AH
MOV31H,R1
MOV32H,R2
MOV33H,A
RET
-----------------四位数码子程序--------------------------------------------------------------------------------------------
DISPLAY:
MOVR3,#4
MOVR0,#30H
MOV 3AH,#0f7H
DISP0:
MOVA,@R0
MOVDPTR,#TAB
MOVCA,@A+DPTR
MOVDPTR,#0D00H
MOVX @DPTR,A
MOVDPTR,#0E00H
MOVA,3AH
MOVX@DPTR,A
RR A
MOV3AH,A
ACALLDY1ms
INCR0
DJNZR3,DISP0
RET
----------------0.2ms延时子程序------------------------------------------------------------------------------------------
DY1ms:
MOVR4,#50
LOOP:
NOP
NOP
DJNZR4,LOOP
RET
-----------------10ms延时子程序----------------------------------------------------------------------------------------
DY10ms:
MOV R4,#10
LOOP0:
MOVR5,#250
LOOP1:
NOP
NOP
DJNZR5,LOOP
DJNZ R4,LOOP0
----------------十进制码表---------------------------------------------------------------------------------------------------
TAB:
DB3fh,06h,5bh,4fh,66h ;
0,1,2,3
DB6dh,7dh,07h,7fh,6fh ;
4,5,6,7
DB 058H,040H,00H ;
8,9,C,-,黑屏
END
二、系统多机通信主机源程序代码TXZJ.ASM
-----------------------------------------------------------------------------------------------------------------------------------
*TXCJ.ASM*
*L
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 系统 执行 软件 源程序 代码
![提示](https://static.bdocx.com/images/bang_tan.gif)