温度自动控制系统原理图及源程序 第8页
RET
;***********************读命令子程序***********
READ_18200:
MOV R4,#2
MOV R1,#29H
RE00: MOV R2,#8
RE01: CLR C
SETB P3.1
NOP
NOP
CLR P3.1
NOP
NOP
NOP
SETB P3.1
MOV R3,#9
RE10: DJNZ R3,RE10
MOV C,P3.1
MOV R3,#23
RE20: DJNZ R3,RE20
RRC A
DJNZ R2,RE01
MOV @R1,A
DEC R1
DJNZ R4,RE00
RET
;**********************左半屏写入数字子程序**************8
writeleft:
mov dptr,#table1
push column
mov cpage,#2
mov ccolumn,#0
mov a,pagef
anl a,#07h
orl a,#0b8h ;页地址,第0页
mov com,a
lcall prm0
mov a,column
anl a,#3fh
orl a,#40h ;列地址,第0列
mov com,a
lcall prm0
mov a,code
mov b,#16
mul ab
add a,dpl
mov dpl,a
mov a,b
addc a,dph
mov dph,a
lp1:
mov a,#00h
movc a,@a+dptr
mov dat,a
lcall prm1
inc ccolumn
mov a,ccolumn
inc dptr
cjne a,#8,lp1
dec cpage
inc pagef
mov a,cpage
jz over1
mov a,pagef
anl a,#07h
orl a,#0b8h
mov com,a
lcall prm0
pop column
mov a,column
anl a,#3fh
orl a,#40h
mov com,a
lcall prm0
mov ccolumn,#0
ljmp lp1
over1:
ret
;************右半屏写入数字子程序*******************
writeright:
mov dptr,#table1
push column2
mov cpage2,#2
mov ccolumn2,#0
mov a,pagef2
anl a,#07h
orl a,#0b8h
mov com,a
lcall prr0
mov a,column2
anl a,#3fh
orl a,#40h
mov com,a
lcall prr0
mov a,code
mov b,#16
mul ab
add a,dpl
mov dpl,a
mov a,b
addc a,dph
mov dph,a
lp2:
mov a,#00h
movc a,@a+dptr
mov dat,a
lcall prr1
inc ccolumn2
mov a,ccolumn2
inc dptr
cjne a,#8,lp2
dec cpage2
inc pagef2
mov a,cpage2
jz over2
mov a,pagef2
anl a,#07h
orl a,#0b8h
mov com,a
lcall prr0
pop column2
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>