给你一个单片机程序吧,我这个是完全可以运行的。
;2007-1-18
;CS1 BIT P2.0
;CS2 BIT P2.1
;DI BIT P2.2
;RW BIT P2.3
;E BIT P2.4
CS1 BIT P2.3
CS2 BIT P2.2
DI BIT P2.0
RW BIT P2.1
E BIT P1.2
RST BIT P2.5
WP BIT P1.0 ;24C02
SCL BIT P1.1
SDA BIT P1.2
LD1 BIT P1.3 ;发光二极管
LD2 BIT P1.4
LD3 BIT P1.5
LD4 BIT P1.6
KEY1 BIT P2.7 ;按键
KEY2 BIT P1.7
KEY3 BIT P3.2
KEY4 BIT P3.3
KEY5 BIT P3.4
KEY6 BIT P3.5
BEEP BIT P2.6
B_DISP BIT 00H ;平时为0 如果为高电电平 则表示可以显示数据
KEY_OK BIT 01H
DAT EQU 25H ;发送的数据
COM EQU 26H ;发送的命令
COLUMN EQU 27H
PPAGE EQU 28H
COODE EQU 29H
COUNT EQU 2AH
LED1 EQU 2BH
LED2 EQU 2CH
LED3 EQU 2DH
LED4 EQU 2EH
BUF0 EQU 30H
BUF1 EQU 31H
BUF2 EQU 32H
BUF3 EQU 33H
BBUF1 EQU 34H ;H低位字节
BBUF2 EQU 35H ;L高位字节
DATA0 EQU 36H
KEY EQU 37H ;按键数值存储
NUM_F EQU 38H
KEY_NUM EQU 39H
SLA EQU 3AH ;24C02器件地址
MTD EQU 3BH ;发送给2402的MCU中数据缓冲区首地址
MRD EQU 3CH ;接受2402中数据到中的缓冲区首地址
NUMBYT EQU 3DH ;收/发字节数
BUFF_2402_1 EQU 3EH ;2402
BUFF_2402_2 EQU 3FH ;
BUF_BIN_L EQU 40H ;BIN_L
NUM_H1 EQU 42H
NUM_H2 EQU 43H
NUM_L1 EQU 44H
NUM_L2 EQU 45H
TEM1H EQU 80H ;1#温度高
TEM1L EQU 81H ;1#温度低
TEM2H EQU 82H ;2#温度高
TEM2L EQU 83H ;2#温度低
TEM3H EQU 84H ;3#温度高
TEM3L EQU 85H ;3#温度低
TEM4H EQU 86H ;4#温度高
TEM4L EQU 87H ;4#温度低
TEM5H EQU 88H ;5#温度高
TEM5L EQU 89H ;5#温度低
TEM6H EQU 8AH ;6#温度高
TEM6L EQU 8BH ;6#温度低
TEM7H EQU 8CH ;7#温度高
TEM7L EQU 8DH ;7#温度低
TEM8H EQU 8EH ;8#温度高
TEM8L EQU 8FH ;8#温度低
TEM9H EQU 90H ;9#温度高
TEM9L EQU 91H ;9#温度低
TEM10H EQU 92H ;10#温度高
TEM10L EQU 93H ;10#温度低
TEM11H EQU 94H ;11#温度高
TEM11L EQU 95H ;11#温度低
TEM12H EQU 96H ;12#温度高
TEM12L EQU 97H ;12#温度低
TEM13H EQU 98H ;13#温度高
TEM13L EQU 99H ;13#温度低
TEM14H EQU 9AH ;14#温度高
TEM14L EQU 9BH ;14#温度低
TEM15H EQU 9CH ;15#温度高
TEM15L EQU 9DH ;15#温度低
TEM16H EQU 9EH ;16#温度高
TEM16L EQU 9FH ;16#温度低
TEM17H EQU 0A0H ;17#温度高
TEM17L EQU 0A1H ;17#温度低
TEM18H EQU 0A2H ;18#温度高
TEM18L EQU 0A3H ;18#温度低
TEM19H EQU 0A4H ;19#温度高
TEM19L EQU 0A5H ;19#温度低
TEM20H EQU 0A6H ;20#温度高
TEM20L EQU 0A7H ;20#温度低
TEM21H EQU 0A8H ;21#温度高
TEM21L EQU 0A9H ;21#温度低
TEM22H EQU 0AAH ;22#温度高
TEM22L EQU 0ABH ;22#温度低
TEM23H EQU 0ACH ;23#温度高
TEM23L EQU 0ADH ;23#温度低
TEM24H EQU 0AEH ;24#温度高
TEM24L EQU 0AFH ;24#温度低
TEM25H EQU 0B0H ;25#温度高
TEM25L EQU 0B1H ;25#温度低
TEM26H EQU 0B2H ;26#温度高
TEM26L EQU 0B3H ;26#温度低
TEM27H EQU 0B4H ;27#温度高
TEM27L EQU 0B5H ;27#温度低
TEM28H EQU 0B6H ;28#温度高
TEM28L EQU 0B7H ;28#温度低
TEM29H EQU 0B8H ;29#温度高
TEM29L EQU 0B9H ;29#温度低
TEM30H EQU 0BAH ;30#温度高
TEM30L EQU 0BBH ;30#温度低
TEM31H EQU 0BCH ;31#温度高
TEM31L EQU 0BDH ;31#温度低
TEM32H EQU 0BEH ;32#温度高
TEM32L EQU 0BFH ;32#温度低
BJ1_H1 EQU 0C0H ;1#温度高温报警高8位
BJ1_H2 EQU 0C1H ;1#温度高温报警低8位
BJ1_L1 EQU 0C2H ;1#温度低温报警高8位
BJ1_L2 EQU 0C3H ;1#温度低温报警低8位
BJ2_H1 EQU 0C4H ;2#温度高温报警高8位
BJ2_H2 EQU 0C5H ;2#温度高温报警低8位
BJ2_L1 EQU 0C6H ;2#温度低温报警高8位
BJ2_L2 EQU 0C7H ;2#温度低温报警低8位
BJ3_H1 EQU 0C8H ;3#温度高温报警高8位
BJ3_H2 EQU 0C9H ;3#温度高温报警低8位
BJ3_L1 EQU 0CAH ;3#温度低温报警高8位
BJ3_L2 EQU 0CBH ;3#温度低温报警低8位
BJ4_H1 EQU 0CCH ;4#温度高温报警高8位
BJ4_H2 EQU 0CDH ;4#温度高温报警低8位
BJ4_L1 EQU 0CEH ;4#温度低温报警高8位
BJ4_L2 EQU 0CFH ;4#温度低温报警低8位
T0M1H1 EQU 10H
T0M1H2 EQU 11H
T0M1L1 EQU 12H
T0M1L2 EQU 13H
T0M2H1 EQU 14H
T0M2H2 EQU 15H
T0M2L1 EQU 16H
T0M2L2 EQU 17H
T0M3H1 EQU 18H
T0M3H2 EQU 19H
T0M3L1 EQU 1AH
T0M3L2 EQU 1BH
T0M4H1 EQU 1CH
T0M4H2 EQU 1DH
T0M4L1 EQU 1EH
T0M4L2 EQU 1FH
ORG 0000H
LJMP MAIN
ORG 00BH
LJMP SCAN_KEY
ORG 0023H
LJMP TRX
ORG 0050H
MAIN: clr LD1
clr LD2
clr LD3
clr LD4
MOV SP, #50H
MOV R0, #80H
MOV R1, #128
LX: CLR A
MOV @R0, A
INC R0
DJNZ R1, LX
MOV R0, #20H
MOV R1, #50H
LX0: CLR A
MOV @R0, A
INC R0
DJNZ R1, LX0
MOV NUM_F, #00H
MOV KEY_NUM,#00H
ANL P2, #0E0H
NOP
MOV BUF1, #02H
MOV BUF2, #0FFH
;*********************串口中断的标准配置
MOV PCON, #00H
MOV SCON, #40H
MOV TMOD, #21H
MOV TH0,#0DcH ;10ms
MOV TL0,#00H
MOV TH1, #0fdh ;9600bit
MOV TL1, #0fdh
SETB EA ;1MS
CLR TB8
SETB PT0
SETB ET0
SETB TR1
SETB TR0
setb ren
SETB es
CLR WP
LCALL INT
LCALL CLEAR
MOV A, #T0M1H1
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取1#高温报警1
MOV R0, #BJ1_H1
MOV @R0, A
LCALL DEL0
MOV A, #T0M1H2
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取1#高温报警1
MOV R0, #BJ1_H2
MOV @R0, A
LCALL DEL0
MOV A, #T0M1L1
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取1#低温报警1
MOV R0, #BJ1_L1
MOV @R0, A
LCALL DEL0
MOV A, #T0M1L2
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取1#低温报警2
MOV R0, #BJ1_L2
MOV @R0, A
LCALL DEL0
MOV A, #T0M2H1
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取2#高温报警1
MOV R0, #BJ2_H1
MOV @R0, A
LCALL DEL0
MOV A, #T0M2H2
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取2#高温报警1
MOV R0, #BJ2_H2
MOV @R0, A
LCALL DEL0
MOV A, #T0M2L1
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取2#低温报警1
MOV R0, #BJ2_L1
MOV @R0, A
LCALL DEL0
MOV A, #T0M2L2
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取2#低温报警2
MOV R0, #BJ2_L2
MOV @R0, A
LCALL DEL0
MOV A, #T0M3H1
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取3#高温报警1
MOV R0, #BJ3_H1
MOV @R0, A
LCALL DEL0
MOV A, #T0M3H2
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取3#高温报警1
MOV R0, #BJ3_H2
MOV @R0, A
LCALL DEL0
MOV A, #T0M3L1
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取3#低温报警1
MOV R0, #BJ3_L1
MOV @R0, A
LCALL DEL0
MOV A, #T0M3L2
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取3#低温报警2
MOV R0, #BJ3_L2
MOV @R0, A
LCALL DEL0
MOV A, #T0M4H1
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取4#高温报警1
MOV R0, #BJ4_H1
MOV @R0, A
LCALL DEL0
MOV A, #T0M4H2
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取4#高温报警1
MOV R0, #BJ4_H2
MOV @R0, A
LCALL DEL0
MOV A, #T0M4L1
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取4#低温报警1
MOV R0, #BJ4_L1
MOV @R0, A
LCALL DEL0
MOV A, #T0M4L2
LCALL READ_2402_RAM1
MOV A, BUF_BIN_L ;读取4#低温报警2
MOV R0, #BJ4_L2
MOV @R0, A
LCALL DEL0
LCALL INT
MAIN1: LCALL CLEAR
DISP_M1:MOV PPAGE, #00H ;01
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #08H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #00H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM1H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #00H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #30H
MOV A, DATA0
ANL A, #0FH
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM1L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #00H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #48H
MOV A, DATA0
ANL A, #0FH
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
SWAP A
MOV NUM_H1, A
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
ADD A, NUM_H1
MOV NUM_H1, A
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0FH
MOV NUM_H2, A
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0FH
SWAP A
MOV NUM_L1, A
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
ADD A, NUM_L1
MOV NUM_L1, A
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0FH
MOV NUM_L2, A
CLR C
MOV R0, #TEM1H
MOV A, @R0
CLR C
CJNE A, NUM_H1, WENDU_J1
LJMP WENDU_J20 ;和实际温度一样,比较个位
WENDU_J1:JNC WENDU_J10
LJMP WENDU_J30 ;比实际温度小,跳转判低温
WENDU_J10: ;比实际温度高,报警 H LED1亮
SETB LD1
CLR BEEP
LJMP WENDU_X2
WENDU_J20: ;判断低温
CLR C
CJNE A, NUM_H2,WENDU_J201
LJMP WENDU_J202 ;温度相同,判断低位
WENDU_J201:JNC WENDU_J203
SETB LD1 ;低温报警
CLR BEEP
LJMP WENDU_X2
WENDU_J203: ;正常温度
CLR LD1
setb BEEP
LJMP WENDU_X2
WENDU_J30:MOV R0, #TEM1L ;判断低温
MOV A, @R0
ANL A, #0F0H
SWAP A
CLR C
CJNE A, NUM_L1, WENDU_J300
SETB LD1 ;温度相同,报警
CLR BEEP
LJMP WENDU_X2
WENDU_J300:
JNC WENDU_J301
setb LD1
CLR BEEP
LJMP WENDU_X2
WENDU_J301:
CLR LD1
SETB BEEP
LJMP WENDU_X2
WENDU_J202:
MOV R0, #TEM1L
MOV A, @R0
ANL A, #0F0H
SWAP A
CLR C
CJNE A, NUM_L2, WENDU_J2020
SETB LD1
CLR BEEP
LJMP WENDU_X2
WENDU_J2020:
JNC WENDU_J2021
CLR LD1
SETB BEEP
LJMP WENDU_X2
WENDU_J2021:
SETB LD1
CLR BEEP
WENDU_X2:
;LJMP MAIN1
MOV PPAGE, #01H ;02:
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #08H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #01H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM2H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #01H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #30H
MOV A, DATA0
ANL A, #0FH
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM2L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #01H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #01H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0FH
SWAP A
MOV NUM_H1, A
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
ADD A, NUM_H1
MOV NUM_H1, A
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0FH
MOV NUM_H2, A
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
SWAP A
MOV NUM_L1, A
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
ADD A, NUM_L1
MOV NUM_L1, A
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0FH
MOV NUM_L2, A
CLR C
MOV R0, #TEM2H
MOV A, @R0
CLR C
CJNE A, NUM_H1, WENDU_2J1
LJMP WENDU_2J20 ;和实际温度一样,比较个位
WENDU_2J1:JNC WENDU_2J10
LJMP WENDU_2J30 ;比实际温度小,跳转判低温
WENDU_2J10: ;比实际温度高,报警 H LED1亮
SETB LD2
CLR BEEP
LJMP WENDU_X3
WENDU_2J20: ;判断低温
CLR C
CJNE A, NUM_H2,WENDU_2J201
LJMP WENDU_2J202 ;温度相同,判断低位
WENDU_2J201:JNC WENDU_2J203
SETB LD2 ;低温报警
CLR BEEP
LJMP WENDU_X3
WENDU_2J203: ;正常温度
CLR LD2
SETB BEEP
LJMP WENDU_X3
WENDU_2J30:MOV R0, #TEM1L ;判断低温
MOV A, @R0
ANL A, #0F0H
SWAP A
CLR C
CJNE A, NUM_L1, WENDU_2J300
SETB LD2 ;温度相同,报警
CLR BEEP
LJMP WENDU_X3
WENDU_2J300:
JNC WENDU_2J301
setb LD2
CLR BEEP
LJMP WENDU_X3
WENDU_2J301:
CLR LD2
SETB BEEP
LJMP WENDU_X3
WENDU_2J202:
MOV R0, #TEM2L
MOV A, @R0
ANL A, #0F0H
SWAP A
CLR C
CJNE A, NUM_L2, WENDU_2J2020
SETB LD2
CLR BEEP
LJMP WENDU_X3
WENDU_2J2020:
JNC WENDU_2J2021
CLR LD2
SETB BEEP
LJMP WENDU_X3
WENDU_2J2021:
SETB LD2
CLR BEEP
WENDU_X3:
MOV PPAGE, #02H ;03:
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #08H
MOV COODE, #03H
LCALL CW_PR
MOV PPAGE, #02H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM3H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #02H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #02H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM3L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #2H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #02H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0FH
SWAP A
MOV NUM_H1, A
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
ADD A, NUM_H1
MOV NUM_H1, A
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0FH
MOV NUM_H2, A
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0FH
SWAP A
MOV NUM_L1, A
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
ADD A, NUM_L1
MOV NUM_L1, A
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0FH
MOV NUM_L2, A
CLR C
MOV R0, #TEM3H
MOV A, @R0
CLR C
CJNE A, NUM_H1, WENDU_3J1
LJMP WENDU_3J20 ;和实际温度一样,比较个位
WENDU_3J1:JNC WENDU_3J10
LJMP WENDU_3J30 ;比实际温度小,跳转判低温
WENDU_3J10: ;比实际温度高,报警 H LED1亮
SETB LD3
CLR BEEP
LJMP WENDU_X4
WENDU_3J20: ;判断低温
CLR C
CJNE A, NUM_H2,WENDU_3J201
LJMP WENDU_3J202 ;温度相同,判断低位
WENDU_3J201:JNC WENDU_3J203
SETB LD3 ;低温报警
CLR BEEP
LJMP WENDU_X4
WENDU_3J203: ;正常温度
CLR LD3
SETB BEEP
LJMP WENDU_X4
WENDU_3J30:MOV R0, #TEM3L ;判断低温
MOV A, @R0
ANL A, #0F0H
SWAP A
CLR C
CJNE A, NUM_L1, WENDU_3J300
SETB LD3 ;温度相同,报警
clr BEEP
LJMP WENDU_X4
WENDU_3J300:
JNC WENDU_3J301
setb LD3
CLR BEEP
LJMP WENDU_X4
WENDU_3J301:
CLR LD3
SETB BEEP
LJMP WENDU_X4
WENDU_3J202:
MOV R0, #TEM3L
MOV A, @R0
ANL A, #0F0H
SWAP A
CLR C
CJNE A, NUM_L2, WENDU_3J2020
SETB LD3
CLR BEEP
LJMP WENDU_X4
WENDU_3J2020:
JNC WENDU_3J2021
CLR LD3
SETB BEEP
LJMP WENDU_X4
WENDU_3J2021:
SETB LD3
CLR BEEP
WENDU_X4:
MOV PPAGE, #03H ;04
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #08H
MOV COODE, #04H
LCALL CW_PR
MOV PPAGE, #03H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM4H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #03H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #03H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM4L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #03H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #03H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0FH
SWAP A
MOV NUM_H1, A
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
ADD A, NUM_H1
MOV NUM_H1, A
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0FH
MOV NUM_H2, A
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
SWAP A
MOV NUM_L1, A
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
ADD A, NUM_L1
MOV NUM_L1, A
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0FH
MOV NUM_L2, A
CLR C
MOV R0, #TEM4H
MOV A, @R0
CLR C
CJNE A, NUM_H1, WENDU_4J1
LJMP WENDU_4J20 ;和实际温度一样,比较个位
WENDU_4J1:JNC WENDU_4J10
LJMP WENDU_4J30 ;比实际温度小,跳转判低温
WENDU_4J10: ;比实际温度高,报警 H LED1亮
SETB LD4
CLR BEEP
LJMP WENDU_X5
WENDU_4J20: ;判断低温
CLR C
CJNE A, NUM_H2,WENDU_4J201
LJMP WENDU_4J202 ;温度相同,判断低位
WENDU_4J201:JNC WENDU_4J203
SETB LD4 ;低温报警
CLR BEEP
LJMP WENDU_X5
WENDU_4J203: ;正常温度
CLR LD4
SETB BEEP
LJMP WENDU_X5
WENDU_4J30:MOV R0, #TEM4L ;判断低温
MOV A, @R0
ANL A, #0F0H
SWAP A
CLR C
CJNE A, NUM_L1, WENDU_4J300
SETB LD4 ;温度相同,报警
CLR BEEP
LJMP WENDU_X5
WENDU_4J300:
JNC WENDU_4J301
setb LD4
CLR BEEP
LJMP WENDU_X5
WENDU_4J301:
CLR LD4
SETB BEEP
LJMP WENDU_X5
WENDU_4J202:
MOV R0, #TEM4L
MOV A, @R0
ANL A, #0F0H
SWAP A
CLR C
CJNE A, NUM_L2, WENDU_4J2020
SETB LD4
CLR BEEP
LJMP WENDU_X5
WENDU_4J2020:
JNC WENDU_4J2021
CLR LD4
SETB BEEP
LJMP WENDU_X5
WENDU_4J2021:
SETB LD4
CLR BEEP
WENDU_X5:
MOV PPAGE, #04H ;05
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #08H
MOV COODE, #05H
LCALL CW_PR
MOV PPAGE, #04H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM5H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #04H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #04H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM5L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #04H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #04H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #05H ;06
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #08H
MOV COODE, #06H
LCALL CW_PR
MOV PPAGE, #05H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM6H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #05H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #05H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM6L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #05H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #05H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #06H ;07
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #08H
MOV COODE, #07H
LCALL CW_PR
MOV PPAGE, #06H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM7H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #06H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #06H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM7L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #06H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #06H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #07H ;08
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #08H
MOV COODE, #08H
LCALL CW_PR
MOV PPAGE, #07H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM8H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #07H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #07H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM8L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #07H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #07H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
LCALL SEND_DATA
LCALL DEL_5S
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV PPAGE, #00H ;09
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #08H
MOV COODE, #09H
LCALL CW_PR
MOV PPAGE, #00H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM9H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #00H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #00H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM9L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #00H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #00H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #01H ;10:
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #08H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #01H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM10H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #01H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #01H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM10L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #01H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #01H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #02H ;11:
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #08H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #02H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM11H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #02H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #02H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM11L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #02H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #02H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #03H ;12
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #08H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #03H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM12H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #03H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #03H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM12L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #03H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #03H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #04H ;13
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #08H
MOV COODE, #03H
LCALL CW_PR
MOV PPAGE, #04H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM13H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #04H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #04H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM13L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #04H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #04H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #05H ;14
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #08H
MOV COODE, #04H
LCALL CW_PR
MOV PPAGE, #05H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM14H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #05H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #05H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM14L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #05H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #05H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #06H ;15
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #08H
MOV COODE, #05H
LCALL CW_PR
MOV PPAGE, #06H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM15H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #06H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #06H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM15L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #06H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #06H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #07H ;16
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #08H
MOV COODE, #06H
LCALL CW_PR
MOV PPAGE, #07H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM16H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #07H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #07H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM16L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #07H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #07H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
LCALL SEND_DATA
LCALL DEL_5S
;;;222222222222222222222222222222222222222222222222222222222222222
MOV PPAGE, #00H ;17
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #08H
MOV COODE, #07H
LCALL CW_PR
MOV PPAGE, #00H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM17H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #00H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #00H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM17L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #00H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #00H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #01H ;18:
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #08H
MOV COODE, #08H
LCALL CW_PR
MOV PPAGE, #01H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM18H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #01H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #01H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM18L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #01H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #01H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #02H ;19:
MOV COLUMN, #00H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #08H
MOV COODE, #09H
LCALL CW_PR
MOV PPAGE, #02H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM19H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #02H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #02H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM19L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #02H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #02H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #03H ;20
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #08H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #03H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM20H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #03H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #03H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM20L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #03H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #03H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #04H ;21
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #08H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #04H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM21H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #04H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #04H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM21L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #04H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #04H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #05H ;22
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #08H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #05H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM22H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #05H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #05H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM22L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #05H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #05H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #06H ;23
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #08H
MOV COODE, #03H
LCALL CW_PR
MOV PPAGE, #06H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM23H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #06H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #06H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM23L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #06H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #06H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #07H ;24
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #08H
MOV COODE, #04H
LCALL CW_PR
MOV PPAGE, #07H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM24H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #07H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #07H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM24L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #07H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #07H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
LCALL SEND_DATA
LCALL DEL_5S
;;;;;;;;;;;;;;;;;;;;;;;;;;33333333333333333333333333333333333333333
MOV PPAGE, #00H ;25
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #08H
MOV COODE, #05H
LCALL CW_PR
MOV PPAGE, #00H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM25H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #00H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #00H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM25L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #00H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #00H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #01H ;26:
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #08H
MOV COODE, #06H
LCALL CW_PR
MOV PPAGE, #01H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM26H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #01H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #01H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM26L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #01H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #01H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #02H ;27:
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #08H
MOV COODE, #07H
LCALL CW_PR
MOV PPAGE, #02H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM27H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #02H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #02H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM27L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #02H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #02H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #03H ;28
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #08H
MOV COODE, #08H
LCALL CW_PR
MOV PPAGE, #03H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM28H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #03H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #03H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM28L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #03H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #03H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #04H ;29
MOV COLUMN, #00H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #08H
MOV COODE, #09H
LCALL CW_PR
MOV PPAGE, #04H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM29H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #04H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #04H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM29L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #04H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #04H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #05H ;30
MOV COLUMN, #00H
MOV COODE, #03H
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #08H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #05H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM30H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #05H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #05H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM30L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #05H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #05H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #06H ;31
MOV COLUMN, #00H
MOV COODE, #03H
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #08H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #06H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM31H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #06H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #06H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM31L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #06H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #06H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #07H ;32
MOV COLUMN, #00H
MOV COODE, #03H
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #08H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #07H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV R0, #TEM32H
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #07H ;
MOV COLUMN, #28H
MOV COODE, A
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #07H ;
MOV COLUMN, #30H
MOV COODE, A
LCALL CW_PR
MOV R0, #TEM32L
MOV A, @R0
MOV DATA0, A
ANL A, #0F0H
SWAP A
MOV PPAGE, #07H ;
MOV COLUMN, #38H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #40H
MOV COODE, #0BH
LCALL CW_PR
MOV A, DATA0
ANL A, #0FH
MOV PPAGE, #07H ;
MOV COLUMN, #48H
MOV COODE, A
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
LCALL SEND_DATA
LCALL DEL_5S
LJMP MAIN1
DISP_MENU:
LCALL DISP_MENU_F
;开始判断按键的程序
K_MENU0:CLR KEY_OK
MOV A, KEY
CJNE A, #01H, K_MENU1
MOV KEY, #00H
LCALL DEL
CLR B_DISP
LJMP DISP_MENU
K_MENU1:CJNE A, #02H, K_MENU2
LCALL K_ZUOYI
LCALL DISP_MENU_F
LCALL DEL
MOV KEY, #00H
CLR B_DISP
LJMP K_MENU0
K_MENU2:CJNE A, #03H, K_MENU3
LCALL K_YOUYI
MOV KEY, #00H
LCALL DISP_MENU_F
LCALL DEL
MOV KEY, #00H
CLR B_DISP
LJMP K_MENU0
K_MENU3:CJNE A, #04H, K_MENU4
LCALL K_ADD
MOV KEY, #00H
LCALL DISP_MENU_F
LCALL DEL
MOV KEY, #00H
CLR B_DISP
LJMP K_MENU0
K_MENU4:CJNE A, #05H, K_MENU5
LCALL K_SUB
MOV KEY, #00H
LCALL DISP_MENU_F
LCALL DEL
MOV KEY, #00H
CLR B_DISP
LJMP K_MENU0
K_MENU5:CJNE A, #06H, K_MENU0
MOV KEY, #00H
LCALL K_TO_24C02
;
LCALL DEL
MOV KEY, #00H
MOV KEY, #00H
CLR B_DISP
CLR KEY_OK
LJMP MAIN1
;*******************************************************
;移位功能键:左移
;*******************************************************
K_ZUOYI:MOV A, NUM_F
CLR C
CJNE A, #00H, K_ZUOYI1
LJMP K_ZUOYI2
K_ZUOYI1:
DEC NUM_F
K_ZUOYI2:LCALL DISP_MENU_F
RET
;*******************************************************
;移位功能键:右移
;*******************************************************
K_YOUYI:MOV A, NUM_F
clr C
CJNE A, #31, K_YOUYI1
MOV NUM_F, #31
LJMP K_YOUYI2
K_YOUYI1:JNC K_YOUYI10
INC NUM_F
LJMP K_YOUYI2
K_YOUYI10:MOV NUM_F, #31
LJMP K_YOUYI2
K_YOUYI2:LCALL DISP_MENU_F
RET
;*******************************************************
;功能键:加数
;*******************************************************
K_ADD: MOV A, NUM_F
CJNE A, #00H, K_ADD1
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
JNZ K_ADD0 ;!=0转移
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ1_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD0: MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ1_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD1:
CJNE A, #01H, K_ADD2
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ1_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD2:
CJNE A, #02H, K_ADD3
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ1_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD3:
CJNE A, #03H, K_ADD4
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ1_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD4:
CJNE A, #04H, K_ADD5
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0F0H
JNZ K_ADD40 ;!=0转移
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ1_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD40: MOV A, BJ1_L1
ANL A, #0FH
MOV R0, #BJ1_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD5:
CJNE A, #05H, K_ADD6
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ1_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD6:
CJNE A, #06H, K_ADD7
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ1_L2;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD7:
CJNE A, #07H, K_ADD8
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ1_L2;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD8:
CJNE A, #08H, K_ADD9
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0F0H
JNZ K_ADD80 ;!=0转移
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ2_H1;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD80: MOV A, BJ2_H1
ANL A, #0FH
MOV R0, #BJ2_H1;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD9:
CJNE A, #09H, K_ADD10
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ2_H1;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD10:
CJNE A, #10, K_ADD11
MOV A, BJ2_H2
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ2_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD11:
CJNE A, #11, K_ADD12
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ2_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD12:
CJNE A, #12, K_ADD13
MOV A, BJ2_L1
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0F0H
JNZ K_ADD120 ;!=0转移
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ2_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD120: MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ2_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD13:
CJNE A, #13, K_ADD14
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ2_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD14:
CJNE A, #14, K_ADD15
MOV A, BJ2_L2
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ2_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD15:
CJNE A, #15, K_ADD16
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ2_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD16:
CJNE A, #16, K_ADD17
MOV A, BJ3_H1
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0F0H
JNZ K_ADD160 ;!=0转移
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ3_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD160: MOV A, BJ3_H1
ANL A, #0FH
MOV R0, #BJ3_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD17:
CJNE A, #17, K_ADD18
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ3_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD18:
CJNE A, #18, K_ADD19
MOV A, BJ3_H2
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ3_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD19:
CJNE A, #19, K_ADD20
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ3_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD20:
CJNE A, #20, K_ADD21
MOV A, BJ3_L1
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0F0H
JNZ K_ADD200 ;!=0转移
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ3_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD200: MOV A, BJ3_L1
ANL A, #0FH
MOV R0, #BJ3_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD21:
CJNE A, #21, K_ADD22
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ3_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD22:
CJNE A, #22, K_ADD23
MOV A, BJ3_L2
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ3_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD23:
CJNE A, #23, K_ADD24
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ3_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD24:
CJNE A, #24, K_ADD25
MOV A, BJ4_H1
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0F0H
JNZ K_ADD240 ;!=0转移
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ4_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD240: MOV A, BJ4_H1
ANL A, #0FH
MOV R0, #BJ4_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD25:
CJNE A, #25, K_ADD26
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ4_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD26:
CJNE A, #26, K_ADD27
MOV A, BJ4_H2
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ4_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD27:
CJNE A, #27, K_ADD28
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ4_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD28:
CJNE A, #28, K_ADD29
MOV A, BJ4_L1
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0F0H
JNZ K_ADD280 ;!=0转移
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ4_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD280: MOV A, BJ4_L1
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ4_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD29:
CJNE A, #29, K_ADD30
MOV A, BJ4_L1
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV A, BJ4_L1
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ4_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD30:
CJNE A, #30, K_ADD31
MOV A, BJ4_L2
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET
MOV A, BJ4_L2
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ4_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD31:
CJNE A, #31, K_ADD32
MOV A, BJ4_L2
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET
MOV A, BJ4_L2
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ4_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_ADD32:
LJMP K_ADD
RET
;*******************************************************
;功能键:减数
;*******************************************************
K_SUB:
MOV A, NUM_F
CJNE A, #00H, K_SUB1
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
JNZ K_SUB0 ;!=0转移
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ1_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB0: MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ1_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB1:
CJNE A, #01H, K_SUB2
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ1_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB2:
CJNE A, #02H, K_SUB3
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ1_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB3:
CJNE A, #03H, K_SUB4
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ1_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB4:
CJNE A, #04H, K_SUB5
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0F0H
JNZ K_SUB40 ;!=0转移
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ1_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB40: MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ1_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB5:
CJNE A, #05H, K_SUB6
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ1_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB6:
CJNE A, #06H, K_SUB7
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ1_L2;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB7:
CJNE A, #07H, K_SUB8
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ1_L2;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB8:
CJNE A, #08H, K_SUB9
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0F0H
JNZ K_SUB80 ;!=0转移
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ2_H1;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB80: MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ2_H1;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB9:
CJNE A, #09H, K_SUB10
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ2_H1;, A
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB10:
CJNE A, #10, K_SUB11
MOV A, BJ2_H2
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ2_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB11:
CJNE A, #11, K_SUB12
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ2_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB12:
CJNE A, #12, K_SUB13
MOV A, BJ2_L1
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0F0H
JNZ K_SUB120 ;!=0转移
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ2_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB120: MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ2_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB13:
CJNE A, #13, K_SUB14
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ2_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB14:
CJNE A, #14, K_SUB15
MOV A, BJ2_L2
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ2_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB15:
CJNE A, #15, K_SUB16
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ2_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB16:
CJNE A, #16, K_SUB17
MOV A, BJ3_H1
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0F0H
JNZ K_SUB160 ;!=0转移
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ3_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB160: MOV A, BJ3_H1
ANL A, #0FH
MOV R0, #BJ3_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB17:
CJNE A, #17, K_SUB18
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ3_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB18:
CJNE A, #18, K_SUB19
MOV A, BJ3_H2
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ3_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB19:
CJNE A, #19, K_SUB20
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ3_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB20:
CJNE A, #20, K_SUB21
MOV A, BJ3_L1
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0F0H
JNZ K_SUB200 ;!=0转移
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ3_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB200: MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ3_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB21:
CJNE A, #21, K_SUB22
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ3_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB22:
CJNE A, #22, K_SUB23
MOV A, BJ3_L2
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ3_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB23:
CJNE A, #23, K_SUB24
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ3_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB24:
CJNE A, #24, K_SUB25
MOV A, BJ4_H1
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0F0H
JNZ K_SUB240 ;!=0转移
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ4_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB240: MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ4_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB25:
CJNE A, #25, K_SUB26
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ4_H1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB26:
CJNE A, #26, K_SUB27
MOV A, BJ4_H2
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ4_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB27:
CJNE A, #27, K_SUB28
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ4_H2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB28:
CJNE A, #28, K_SUB29
MOV A, BJ4_L1
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0F0H
JNZ K_SUB280 ;!=0转移
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
ADD A, #10H
MOV R0, #BJ4_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB280:
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
MOV R0, #BJ4_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB29:
CJNE A, #29, K_SUB30
MOV A, BJ4_L1
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV A, BJ4_L1
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ4_L1
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB30:
CJNE A, #30, K_SUB31
MOV A, BJ4_L2
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV KEY_NUM, A
LCALL K_GET0
MOV A, BJ4_L2
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0FH
SWAP A
ADD A, KEY_NUM
SWAP A
MOV R0, #BJ4_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB31:
CJNE A, #31, K_SUB32
MOV A, BJ4_L2
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0FH
MOV KEY_NUM, A
LCALL K_GET0
MOV A, BJ4_L2
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0F0H
ADD A, KEY_NUM
MOV R0, #BJ4_L2
MOV @R0, A
LCALL DISP_MENU_F
RET
K_SUB32:
LJMP K_SUB
RET
RET
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;=====================================================
;程序入口:KEY_NUM 将对应的数值放在这个里面
;程序:KEY_NUM 对应的数值放在这个里面
;=====================================================
K_GET:
MOV A, KEY_NUM
CLR C
CJNE A, #09H, KEY_GET1
MOV KEY_NUM,#09H
RET
KEY_GET1:JNC KEY_GET10
MOV A, KEY_NUM
INC KEY_NUM
RET
KEY_GET10:
MOV KEY_NUM, #09H
RET
;=====================================================
;程序入口:KEY_NUM 将对应的数值放在这个里面
;程序:KEY_NUM 对应的数值放在这个里面
;=====================================================
K_GET0:
MOV A, KEY_NUM
CLR C
CJNE A, #00H, KEY_GET01
MOV KEY_NUM,#00H
RET
KEY_GET01:
MOV A, KEY_NUM
DEC KEY_NUM
RET
;**************************************************************8
;显示反显的当前那个数据
;**************************************************************
DISP_MENU_F:
LCALL CLEAR ;清掉
MOV PPAGE, #00H ;01: H +123.C
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #08H
MOV COODE, #01H
LCALL CW_PR
MOV PPAGE, #00H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV PPAGE, #00H
MOV COLUMN, #20H
MOV COODE, #10H
LCALL CW_PR
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU1
MOV COODE, #13H
JMP D_MENU2
JMP D_MENU2
D_MENU1:MOV COODE, #0FH
D_MENU2:MOV PPAGE, #00H
MOV COLUMN, #30H
LCALL CW_PR
NOP
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #00H
MOV COLUMN, #38H
LCALL CW_PR
NOP
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #00H
MOV COLUMN, #40H
LCALL CW_PR
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #00H
MOV COLUMN, #48H
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #00H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #01H ;L
MOV COLUMN, #20H
MOV COODE, #11H
LCALL CW_PR
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU1L
MOV COODE, #13H
JMP D_MENU2L
JMP D_MENU2L
D_MENU1L:MOV COODE, #0FH
D_MENU2L:MOV PPAGE, #01H
MOV COLUMN, #30H
LCALL CW_PR
NOP
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #01H
MOV COLUMN, #38H
LCALL CW_PR
NOP
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #01H
MOV COLUMN, #40H
LCALL CW_PR
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #01H
MOV COLUMN, #48H
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #01H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
;02
MOV PPAGE, #02H ;02: H +123.C
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #08H
MOV COODE, #02H
LCALL CW_PR
MOV PPAGE, #02H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV PPAGE, #02H
MOV COLUMN, #20H
MOV COODE, #10H
LCALL CW_PR
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU22
MOV COODE, #0EH
JMP D_MENU22
D_MENU21:MOV COODE, #0FH
D_MENU22:MOV PPAGE, #02H
MOV COLUMN, #30H
LCALL CW_PR
NOP
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #02H
MOV COLUMN, #38H
LCALL CW_PR
NOP
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #02H
MOV COLUMN, #40H
LCALL CW_PR
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #02H
MOV COLUMN, #48H
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #02H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #03H ;L
MOV COLUMN, #20H
MOV COODE, #11H
LCALL CW_PR
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU21L
MOV COODE, #13H
JMP D_MENU22L
JMP D_MENU22L
D_MENU21L:MOV COODE, #0FH
D_MENU22L:MOV PPAGE, #03H
MOV COLUMN, #30H
LCALL CW_PR
NOP
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #03H
MOV COLUMN, #38H
LCALL CW_PR
NOP
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #03H
MOV COLUMN, #40H
LCALL CW_PR
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #03H
MOV COLUMN, #48H
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #03H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
;03
MOV PPAGE, #04H ;01: H +123.C
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #08H
MOV COODE, #03H
LCALL CW_PR
MOV PPAGE, #04H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV PPAGE, #04H
MOV COLUMN, #20H
MOV COODE, #10H
LCALL CW_PR
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU31
MOV COODE, #13H
JMP D_MENU32
JMP D_MENU32
D_MENU31:MOV COODE, #0FH
D_MENU32:MOV PPAGE, #04H
MOV COLUMN, #30H
LCALL CW_PR
NOP
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #04H
MOV COLUMN, #38H
LCALL CW_PR
NOP
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #04H
MOV COLUMN, #40H
LCALL CW_PR
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #04H
MOV COLUMN, #48H
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #04H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #05H ;L
MOV COLUMN, #20H
MOV COODE, #11H
LCALL CW_PR
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU31L
MOV COODE, #13H
JMP D_MENU32L
JMP D_MENU32L
D_MENU31L:MOV COODE, #0FH
D_MENU32L:MOV PPAGE, #05H
MOV COLUMN, #30H
LCALL CW_PR
NOP
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #05H
MOV COLUMN, #38H
LCALL CW_PR
NOP
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #05H
MOV COLUMN, #40H
LCALL CW_PR
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #05H
MOV COLUMN, #48H
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #05H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
;04
MOV PPAGE, #06H ;04: H +123.C
MOV COLUMN, #00H
MOV COODE, #00H
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #08H
MOV COODE, #04H
LCALL CW_PR
MOV PPAGE, #06H
MOV COLUMN, #10H
MOV COODE, #0AH
LCALL CW_PR
MOV PPAGE, #06H
MOV COLUMN, #20H
MOV COODE, #10H
LCALL CW_PR
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU41
MOV COODE, #13H
JMP D_MENU42
JMP D_MENU42
D_MENU41:MOV COODE, #0FH
D_MENU42:MOV PPAGE, #06H
MOV COLUMN, #30H
LCALL CW_PR
NOP
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #06H
MOV COLUMN, #38H
LCALL CW_PR
NOP
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #06H
MOV COLUMN, #40H
LCALL CW_PR
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #06H
MOV COLUMN, #48H
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #06H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
MOV PPAGE, #07H ;L
MOV COLUMN, #20H
MOV COODE, #11H
LCALL CW_PR
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU41L
MOV COODE, #13H
JMP D_MENU42L
JMP D_MENU42L
D_MENU41L:MOV COODE, #0FH
D_MENU42L:MOV PPAGE, #07H
MOV COLUMN, #30H
LCALL CW_PR
NOP
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #07H
MOV COLUMN, #38H
LCALL CW_PR
NOP
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #07H
MOV COLUMN, #40H
LCALL CW_PR
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #07H
MOV COLUMN, #48H
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #50H
MOV COODE, #0CH
LCALL CW_PR
MOV PPAGE, #07H ;
MOV COLUMN, #58H
MOV COODE, #0DH
LCALL CW_PR
;开始显示反显的数据
MOV A, NUM_F
CJNE A, #00H, MENU_F0
MOV PPAGE, #00H ;
MOV COLUMN, #30H
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU1L_F
MOV COODE, #0EH
JMP D_MENU2L_F
JMP D_MENU2L_F
D_MENU1L_F:MOV COODE, #0FH
D_MENU2L_F:MOV PPAGE, #0H
MOV COLUMN, #30H
LCALL CW_FPR
RET
MENU_F0:
CJNE A, #01H, MENU_F1
MOV R0, #BJ1_H1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #00H
MOV COLUMN, #38H
LCALL CW_FPR
RET
MENU_F1:CJNE A, #02H, MENU_F2
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #00H
MOV COLUMN, #40H
LCALL CW_FPR
RET
MENU_F2:CJNE A, #03H, MENU_F3
MOV R0, #BJ1_H2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #00H
MOV COLUMN, #48H
LCALL CW_FPR
RET
MENU_F3:CJNE A, #04H, MENU_F4
MOV PPAGE, #01H ;
MOV COLUMN, #30H
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU3L_F
MOV COODE, #0EH
JMP D_MENU4L_F
JMP D_MENU4L_F
D_MENU3L_F:MOV COODE, #0FH
D_MENU4L_F:MOV PPAGE, #01H
MOV COLUMN, #30H
LCALL CW_FPR
RET
MENU_F4:CJNE A, #05, MENU_F5
MOV R0, #BJ1_L1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #01H
MOV COLUMN, #38H
LCALL CW_FPR
RET
MENU_F5:CJNE A, #06, MENU_F6
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #01H
MOV COLUMN, #40H
LCALL CW_FPR
RET
MENU_F6:CJNE A, #07, MENU_F7
MOV R0, #BJ1_L2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #01H
MOV COLUMN, #48H
LCALL CW_FPR
RET
MENU_F7:CJNE A, #08, MENU_F8
MOV PPAGE, #02H ;
MOV COLUMN, #30H
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU7L_F
MOV COODE, #0EH
JMP D_MENU8L_F
JMP D_MENU8L_F
D_MENU7L_F:MOV COODE, #0FH
D_MENU8L_F:MOV PPAGE, #02H
MOV COLUMN, #30H
LCALL CW_FPR
RET
MENU_F8:CJNE A, #09, MENU_F9
MOV R0, #BJ2_H1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #02H
MOV COLUMN, #38H
LCALL CW_FPR
RET
MENU_F9:CJNE A, #010, MENU_F10
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #02H
MOV COLUMN, #40H
LCALL CW_FPR
RET
MENU_F10:CJNE A, #11, MENU_F11
MOV R0, #BJ2_H2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #02H
MOV COLUMN, #48H
LCALL CW_FPR
RET
MENU_F11:CJNE A, #12, MENU_F12
MOV PPAGE, #03H ;
MOV COLUMN, #30H
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU11L_F
MOV COODE, #0EH
JMP D_MENU12L_F
JMP D_MENU12L_F
D_MENU11L_F:MOV COODE, #0FH
D_MENU12L_F:MOV PPAGE, #03H
MOV COLUMN, #30H
LCALL CW_FPR
RET
MENU_F12:CJNE A, #13, MENU_F13
MOV R0, #BJ2_L1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #03H
MOV COLUMN, #38H
LCALL CW_FPR
RET
MENU_F13:CJNE A, #14, MENU_F14
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #03H
MOV COLUMN, #40H
LCALL CW_FPR
RET
MENU_F14:CJNE A, #15, MENU_F15
MOV R0, #BJ2_L2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #03H
MOV COLUMN, #48H
LCALL CW_FPR
RET
MENU_F15:CJNE A, #16, MENU_F16
MOV PPAGE, #04H ;
MOV COLUMN, #30H
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU15L_F
MOV COODE, #0EH
JMP D_MENU16L_F
JMP D_MENU16L_F
D_MENU15L_F:MOV COODE, #0FH
D_MENU16L_F:MOV PPAGE, #04H
MOV COLUMN, #30H
LCALL CW_FPR
RET
MENU_F16:CJNE A, #17, MENU_F17
MOV R0, #BJ3_H1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #04H
MOV COLUMN, #38H
LCALL CW_FPR
RET
MENU_F17:CJNE A, #18, MENU_F18
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #04H
MOV COLUMN, #40H
LCALL CW_FPR
RET
MENU_F18:CJNE A, #19, MENU_F19
MOV R0, #BJ3_H2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #04H
MOV COLUMN, #48H
LCALL CW_FPR
RET
MENU_F19:CJNE A, #20, MENU_F20
MOV PPAGE, #05H ;
MOV COLUMN, #30H
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU19L_F
MOV COODE, #0EH
JMP D_MENU20L_F
JMP D_MENU20L_F
D_MENU19L_F:MOV COODE, #0FH
D_MENU20L_F:MOV PPAGE, #05H
MOV COLUMN, #30H
LCALL CW_FPR
RET
MENU_F20:CJNE A, #21, MENU_F21
MOV R0, #BJ3_L1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #05H
MOV COLUMN, #38H
LCALL CW_FPR
RET
MENU_F21:CJNE A, #22, MENU_F22
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #05H
MOV COLUMN, #40H
LCALL CW_FPR
RET
MENU_F22:CJNE A, #23, MENU_F23
MOV R0, #BJ3_L2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #05H
MOV COLUMN, #48H
LCALL CW_FPR
RET
MENU_F23:CJNE A, #24, MENU_F24
MOV PPAGE, #06H ;
MOV COLUMN, #30H
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU23L_F
MOV COODE, #0EH
JMP D_MENU24L_F
JMP D_MENU24L_F
D_MENU23L_F:MOV COODE, #0FH
D_MENU24L_F:MOV PPAGE, #06H
MOV COLUMN, #30H
LCALL CW_FPR
RET
MENU_F24:CJNE A, #25, MENU_F25
MOV R0, #BJ4_H1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #06H
MOV COLUMN, #38H
LCALL CW_FPR
RET
MENU_F25:CJNE A, #26, MENU_F26
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #06H
MOV COLUMN, #40H
LCALL CW_FPR
RET
MENU_F26:CJNE A, #27, MENU_F27
MOV R0, #BJ4_H2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #06H
MOV COLUMN, #48H
LCALL CW_FPR
RET
MENU_F27:CJNE A, #28, MENU_F28
MOV PPAGE, #07H ;
MOV COLUMN, #30H
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0F0H
SWAP A
CJNE A, #00H, D_MENU27L_F
MOV COODE, #0EH
JMP D_MENU28L_F
JMP D_MENU28L_F
D_MENU27L_F:MOV COODE, #0FH
D_MENU28L_F:MOV PPAGE, #07H
MOV COLUMN, #30H
LCALL CW_FPR
RET
MENU_F28:CJNE A, #29, MENU_F29
MOV R0, #BJ4_L1
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #07H
MOV COLUMN, #38H
LCALL CW_FPR
RET
MENU_F29:CJNE A, #30, MENU_F30
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0F0H
SWAP A
MOV COODE, A
MOV PPAGE, #07H
MOV COLUMN, #40H
LCALL CW_FPR
RET
MENU_F30:CJNE A, #31, MENU_F31
MOV R0, #BJ4_L2
MOV A, @R0
ANL A, #0FH
MOV COODE, A
MOV PPAGE, #07H
MOV COLUMN, #48H
LCALL CW_FPR
RET
MENU_F31:RET
;********************************中断子程序**************************
;串口中断子程序
TRX: PUSH ACC
JNB RI, ENDRTX0
CLR RI
CLR RB8
MOV BUF3, BUF2
MOV BUF2, BUF1
MOV BUF1, BUF0
MOV BUF0, SBUF
MOV A, BUF3
CJNE A, #0AAH, ENDRTX0
MOV A, BUF2
CJNE A, #01H, TR_2
MOV R0, #TEM1H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
ENDRTX0:LJMP ENDRTX
TR_2: CJNE A, #02, TR_3
MOV R0, #TEM2H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_3: CJNE A, #03, TR_4
MOV R0, #TEM3H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_4: CJNE A, #04, TR_5
MOV R0, #TEM4H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_5: CJNE A, #05, TR_6
MOV R0, #TEM5H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_6: CJNE A, #06, TR_7
MOV R0, #TEM6H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_7: CJNE A, #07, TR_8
MOV R0, #TEM7H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_8: CJNE A, #08, TR_9
MOV R0, #TEM8H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_9: CJNE A, #09, TR_10
MOV R0, #TEM9H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_10: CJNE A, #10, TR_11
MOV R0, #TEM10H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_11: CJNE A, #11, TR_12
MOV R0, #TEM11H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_12: CJNE A, #12, TR_13
MOV R0, #TEM12H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_13: CJNE A, #13, TR_14
MOV R0, #TEM13H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_14: CJNE A, #14, TR_15
MOV R0, #TEM14H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_15: CJNE A, #15, TR_16
MOV R0, #TEM15H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_16: CJNE A, #16, TR_17
MOV R0, #TEM16H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_17: CJNE A, #17, TR_18
MOV R0, #TEM17H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_18: CJNE A, #18, TR_19
MOV R0, #TEM18H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_19: CJNE A, #19, TR_20
MOV R0, #TEM19H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_20: CJNE A, #20, TR_21
MOV R0, #TEM20H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_21: CJNE A, #21, TR_22
MOV R0, #TEM21H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_22: CJNE A, #22, TR_23
MOV R0, #TEM22H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_23: CJNE A, #23, TR_24
MOV R0, #TEM23H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_24: CJNE A, #24, TR_25
MOV R0, #TEM24H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_25: CJNE A, #25, TR_26
MOV R0, #TEM25H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_26: CJNE A, #26, TR_27
MOV R0, #TEM26H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_27: CJNE A, #27, TR_28
MOV R0, #TEM27H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_28: CJNE A, #28, TR_29
MOV R0, #TEM28H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_29: CJNE A, #29, TR_30
MOV R0, #TEM29H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_30: CJNE A, #30, TR_31
MOV R0, #TEM30H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_31: CJNE A, #31, TR_32
MOV R0, #TEM31H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
TR_32: CJNE A, #32, ENDRTX
MOV R0, #TEM32H
MOV @R0, BUF1
INC R0
MOV @R0, BUF0
LJMP ENDRTX
ENDRTX: POP ACC
RETI
;********************************双字节转换成bcd**********************
;程序入口:BBUF1--高字节 BBUF2--低字节
;程序出口:LED1 LED2 LED3 LED4
;*********************************************************************
;BBIN_BCD:MOV 10H, BBUF2
MOV 11H, BBUF1
MOV R1, #12H
MOV R5, #03H
CLR A
LOOP1: MOV @R1, A
INC R1
DJNZ R5, LOOP1
MOV R7, #10H
LOOP4: MOV R0, #10H
MOV R6, #02H
CLR C
LOOP2: MOV A, @R0
RLC A
MOV @R0, A
INC R0
DJNZ R6, LOOP2
MOV R1, #12H
MOV R5, #02H
LOOP3: MOV A, @R1
ADDC A, @R1
DA A
MOV @R1, A
INC R1
DJNZ R5, LOOP3
DJNZ R7, LOOP4
MOV A, 13H
ANL A, #0F0H
SWAP A
ADD A, #10H
MOV LED1, A
MOV A, 13H
ANL A, #0FH
ADD A, #10H
MOV LED2, A
MOV A, 12H
ANL A, #0F0H
SWAP A
ADD A, #10H
MOV LED3, A
MOV A, 12H
ANL A, #0FH
ADD A, #10H
MOV LED4, A
RET
;***********************************点阵字符显示***********************
;作者:练祥华
;2007-01-04
;程序的出口:PPAGE 液晶的页面地址
; COLUMN 字符的间隔 每8个点COLUMN加1
; COODE 字符的代码
CW_PR: MOV DPTR, #CTAB ;将字符字模块的首地址存放在DPTR中
MOV A, COODE ;取代码
MOV B, #08h ;字模块的宽度为8个字节 显示的是8*8数据
MUL AB ;代码乘以8,表示偏移地址
ADD A, DPL ;字符字模块的首地址
MOV DPL, A ;这个表示字模块首地址+代码*8 也就是按照8个字节进行查询数据
MOV A, B ;将数据继续调用进行运算
ADDC A, DPH ;运算字符块地址
MOV DPH, A ;运算字符块地址
MOV COODE, #00H ;COODE数据清零
MOV A, PPAGE ;读页地址寄存器
JB ACC.7, CW_1 ;判断是什么字符
MOV COUNT, #06H ;这个就是选择的是6*8的点阵数据
LJMP CW_2 ;跳转到显示子程序
CW_1: MOV COUNT, #08H ;这个就是现实8*8的点阵数据
CW_2: ANL A, #07H ;取页地址值
ORL A, #0B8H ;或页地址指令代码
MOV COM, A ;写也地址指针
LCALL PRL0 ;显示左半屏数据
LCALL PRM0 ;显示右半屏数据
MOV A, COLUMN ;读列地址寄存器
CLR C ;清除c标志位
SUBB A, #40H ;列地址减去64,这个是跟屏幕的行列有关系,12864点阵中 64表示列
JC CW_3 ;<0 表示显示左半屏显示区域
MOV COLUMN, A ;还原列值
SUBB A, #40H ;列地址减去64
JC CW_21 ;<0为中间屏显示区域,也就是12864点阵的右半屏
MOV COLUMN, A ;》=0为右屏显示区域
MOV A, PPAGE ;读取页地址值
SETB ACC.5 ;设置区域标志标志位
MOV PPAGE, A ;读取页地址
LJMP CW_3 ;跳转显示列
CW_21: MOV A, PPAGE ;读取页地址
SETB ACC.4 ;设置区域标志位
MOV PPAGE, A ;将数据保存进页地址
CW_3: MOV COM, COLUMN ;设置列地址值
ORL COM, #40H ;或 列地址指令标志位
MOV A, PPAGE ;判断区域标志位,以便确定是哪一个显示区域
ANL A, #30H ;读取页地址中的第五位和第四位,以判断是哪一个区
CJNE A, #10H, CW_32 ;01为中区
LCALL PRM0 ;调用显示中区
LJMP CW_4 ;跳转
CW_32: LCALL PRL0 ;00为左区,显示左区
CW_4: MOV A, COODE ;取代码数据
MOVC A, @A+DPTR ;取字符字模数据
MOV DAT ,A ;写数据
MOV A, PPAGE ;判断区域标志位
ANL A, #30H ;判断区域
CJNE A, #10H, CW_41 ;01为中区
LCALL PRM1 ;显示中区数据
LJMP CW_5 ;跳转
CW_41: LCALL PRL1 ;00为左区
CW_5: INC COODE ;间址寄存器值加1
INC COLUMN ;列地址加一
MOV A, COLUMN ;判断列地址是否超越范围
CJNE A, #40H, CW_6 ;判断是否超越64个列值
CW_6: JC CW_9 ;未超出则继续显示
MOV COLUMN, #00H ;将列值清零
MOV A, PPAGE ;超出则判断在哪一个区域
JB ACC.5, CW_9 ;判断是否在右区域,如果是,则跳出
SETB ACC.4 ;在左区则转中区
MOV PPAGE, A ;保存数据
MOV COM, #40H ;设置中区列地址为0
LCALL PRM0 ;显示中区
LJMP CW_9 ;跳转返回
CW_9: DJNZ COUNT, CW_4 ;8个数据显示完,没完就继续
RET
;***********************************点阵字符反显示***********************
;作者:练祥华
;2007-01-04
;程序的出口:PPAGE 液晶的页面地址
; COLUMN 字符的间隔 每8个点COLUMN加1
; COODE 字符的代码
; 本程序和上述正显示的程序唯一不同的地方就是将字库里面的数据进行取反显示
CW_FPR: MOV DPTR, #CTAB ;将字符的地址存放在DPTR中
MOV A, COODE
MOV B, #08h
MUL AB
ADD A, DPL
MOV DPL, A
MOV A, B
ADDC A, DPH
MOV DPH, A
MOV COODE, #00H
MOV A, PPAGE
JB ACC.7, CW_F1
MOV COUNT, #06H
LJMP CW_F2
CW_F1: MOV COUNT, #08H
CW_F2: ANL A, #07H
ORL A, #0B8H
MOV COM, A
LCALL PRL0
LCALL PRM0
MOV A, COLUMN
CLR C
SUBB A, #40H
JC CW_F3
MOV COLUMN, A
SUBB A, #40H
JC CW_F21
MOV COLUMN, A
MOV A, PPAGE
SETB ACC.5
MOV PPAGE, A
LJMP CW_F3
CW_F21: MOV A, PPAGE
SETB ACC.4
MOV PPAGE, A
CW_F3: MOV COM, COLUMN
ORL COM, #40H
MOV A, PPAGE
ANL A, #30H
CJNE A, #10H, CW_F32
LCALL PRM0
LJMP CW_F4
CW_F32: LCALL PRL0
CW_F4: MOV A, COODE
MOVC A, @A+DPTR
CPL A ; 这里就是取反显示的核心
MOV DAT ,A
MOV A, PPAGE
ANL A, #30H
CJNE A, #10H, CW_F41
LCALL PRM1
LJMP CW_F5
CW_F41: LCALL PRL1
CW_F5: INC COODE
INC COLUMN
MOV A, COLUMN
CJNE A, #40H, CW_F6
CW_F6: JC CW_F9
MOV COLUMN, #00H
MOV A, PPAGE
JB ACC.5, CW_F9
SETB ACC.4
MOV PPAGE, A
MOV COM, #40H
LCALL PRM0
LJMP CW_F9
CW_F9: DJNZ COUNT, CW_F4
RET
;***************初始化子程序*******************
INT: MOV COM, #0C0H ;设置显示起始行为第一行
LCALL PRL0 ;设置左页
LCALL PRM0 ;设置中页,12864中为右页
MOV COM, #3FH ;开显示设置
LCALL PRL0 ;设置左页
LCALL PRM0 ;设置中页
RET
;***************清显示ram区********************
CLEAR: MOV R4, #00H ;页面地址暂存器设置
CLEAR1: MOV A, R4 ;读取页面地址
ORL A, #0B8H ;或页面地址设置代码
MOV COM, A ;页面地址设置
LCALL PRL0 ;显示左半区
LCALL PRM0 ;显示右半区
MOV COM, #40H ;列地址设置为0
LCALL PRL0 ;设置左半区的数据
LCALL PRM0 ;设置中半区的数据
MOV R3, #40H ;一页清64个字节 8个字节*8个零数据
CLEAR2: MOV DAT, #00H ;显示数据位0
LCALL PRL1 ;左半屏显示数据0,即为全空
LCALL PRM1 ;中间半屏显示数据00,全空
DJNZ R3, CLEAR2 ;判断是否完成了一页,也就是说一行全部清0
INC R4 ;页地址加1
CJNE R4, #08H, CLEAR1 ;判断是否完成了8页
RET
;****************泻命令代码(左)****************
;程序入口:COM
;**********************************************
PRL0: CLR CS1 ;片选设置为01
SETB CS2
CLR DI ;数据口为1
SETB RW ;读写线为1
PRL01: MOV P0, #0FFH ;P1口至高电平,将数据口拉高,起到保护程序作用
SETB E ;E=1
MOV A, P0 ;读取状态字,
CLR E ;E=0
JB ACC.7, PRL01 ;判断忙标志位是否为0,为0继续判断
CLR RW ;RW=0
MOV P0, COM ;写指令代码
SETB E ;E=1
NOP
NOP
CLR E ;E=0 形成一个脉冲
RET
;******************写显示数据(左)*******************
;程序入口:DAT
;***********************************************
PRL1: CLR CS1 ;片选设置为01 ;
SETB CS2
CLR DI ;数据口为1
SETB RW ;读写线为1
PRL11: MOV P0, #0FFH ;P1口至高电平,将数据口拉高,起到保护程序作用
SETB E ;E=1
MOV A, P0 ;读取状态字,
CLR E ;E=0
JB ACC.7, PRL11 ;判断忙标志位是否为0,为0继续判断
SETB DI ;DI=1 表示写入的是数据
CLR RW ;RW=0
MOV P0, DAT ;写数据
SETB E ;E=1
NOP
CLR E ;E=0 形成一个脉冲
RET
;******************读显示数据(左)********************
;程序出口:DAT
;************************************************
PRL2: CLR CS1 ;片选设置为01
SETB CS2
CLR DI ;数据口为1
SETB RW ;读写线为1
PRL21: MOV P0, #0FFH ;P1口至高电平,将数据口拉高,起到保护程序作用
SETB E ;E=1
MOV A, P0 ;读取状态字,
CLR E ;E=0
JB ACC.7, PRL21 ;判断忙标志位是否为0,为0继续判断
SETB DI ;DI=1 表示写入的是数据
MOV P0, #0FFH ;将P0口数据至高,这样保证读取数据的准确
SETB E ;E=1
MOV DAT, P0 ;将数据读出
CLR E ;E=0 形成一个脉冲
RET
;****************泻命令代码(中)********************
;程序入口:COM
;**********************************************
PRM0: SETB CS1 ;片选设置为01
CLR CS2
CLR DI ;数据口为0 表示命令
SETB RW ;读写线为1
PRM01: MOV P0, #0FFH ;P1口至高电平,将数据口拉高,起到保护程序作用
SETB E ;E=1
MOV A, P0 ;读取P0的数值
CLR E ;E=0
JB ACC.7, PRM01 ;判断忙标志位是否为0,为0继续判断
CLR RW ;进行写操作
MOV P0, COM ;写命令
SETB E ;E=1
NOP
NOP
CLR E ;E=0 形成一个脉冲
RET
;******************写显示数据(中)*******************
;程序入口:DAT
;***********************************************
PRM1: SETB CS1 ;片选设置为01
CLR CS2
CLR DI ;数据口为0 表示命令
SETB RW ;读写线为1
PRM11: MOV P0, #0FFH ;P1口至高电平,将数据口拉高,起到保护程序作用
SETB E ;E=1
MOV A, P0 ;读取P0的数值
CLR E ;E=0
JB ACC.7, PRM11 ;判断忙标志位是否为0,为0继续判断
SETB DI ;写数据
CLR RW ;写命令
MOV P0, DAT ;写数据
SETB E ;E=1
NOP
CLR E ;E=0 形成一个脉冲
RET
;******************读显示数据(中)********************
;程序出口:DAT
;************************************************
PRM2: SETB CS1 ;片选设置为01
CLR CS2
CLR DI ;数据口为0 表示命令
SETB RW ;读写线为1
PRM21: MOV P0, #0FFH ;P1口至高电平,将数据口拉高,起到保护程序作用
SETB E ;E=1
MOV A, P0 ;读取P0的数值
CLR E
JB ACC.7, PRM21 ;判断忙标志位是否为0,为0继续判断
SETB DI ;数据
MOV P0, #0FFH ;将P0口数据至高,这样保证读取数据的准确
SETB E
MOV DAT, P0 ;将数据读出
CLR E
RET
;*****************************************************
;发送数据给电脑
;*****************************************************
SEND_DATA:
;CLR P3.7
NOP
NOP
NOP
MOV SBUF, #0CCH
JNB TI, $
CLR TI
MOV R0, #80H
MOV R1, #64
SEND_DATA1:
MOV A, @R0
MOV SBUF, A
JNB TI, $
CLR TI
INC R0
DJNZ R1, SEND_DATA1
SETB P3.7
RET
;====================================================
;
;======================================================
SCAN_KEY:MOV TH0,#0DcH ;10ms
MOV TL0,#00H
JB KEY_OK, SCAN_K6
JB KEY1, SCAN_K1
MOV KEY, #01H
SETB KEY_OK
RETI
SCAN_K1:JB KEY2, SCAN_K2
MOV KEY, #02H
SETB KEY_OK
RETI
SCAN_K2:JB KEY3, SCAN_K3
MOV KEY, #03H
SETB KEY_OK
RETI
SCAN_K3:JB KEY4, SCAN_K4
MOV KEY, #04H
SETB KEY_OK
RETI
SCAN_K4:JB KEY5, SCAN_K5
MOV KEY, #05H
SETB KEY_OK
RETI
SCAN_K5:JB KEY6, SCAN_K6
MOV KEY, #06H
SETB KEY_OK
RETI
SCAN_K6:RETI
K_TO_24C02:
;此处插入24c02写程序,将所有的4组数据写入24c02中
MOV R0, #BJ1_H1
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M1H1
LCALL WRITE_2402_RAM1 ;写入1号报警高位数值H1
LCALL DEL0
LCALL DEL0
MOV R0, #BJ1_H2
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M1H2
LCALL WRITE_2402_RAM1 ;写入1号报警高位数值H2
LCALL DEL0
LCALL DEL0
MOV R0, #BJ1_L1
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M1L1
LCALL WRITE_2402_RAM1 ;写入1号报警低位数值L1
LCALL DEL0
LCALL DEL0
MOV R0, #BJ1_L2
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M1L2
LCALL WRITE_2402_RAM1 ;写入1号报警高位数值L2
LCALL DEL0
LCALL DEL0
MOV R0, #BJ2_H1
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M2H1
LCALL WRITE_2402_RAM1 ;写入2号报警高位数值H1
LCALL DEL0
LCALL DEL0
MOV R0, #BJ2_H2
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M2H2
LCALL WRITE_2402_RAM1 ;写入2号报警高位数值H2
LCALL DEL0
LCALL DEL0
MOV R0, #BJ2_L1
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M2L1
LCALL WRITE_2402_RAM1 ;写入2号报警低位数值L1
LCALL DEL0
LCALL DEL0
MOV R0, #BJ2_L2
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M2L2
LCALL WRITE_2402_RAM1 ;写入2号报警高位数值L2
LCALL DEL0
LCALL DEL0
MOV R0, #BJ3_H1
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M3H1
LCALL WRITE_2402_RAM1 ;写入3号报警高位数值H1
LCALL DEL0
MOV R0, #BJ3_H2
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M3H2
LCALL WRITE_2402_RAM1 ;写入3号报警高位数值H2
LCALL DEL0
MOV R0, #BJ3_L1
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M3L1
LCALL WRITE_2402_RAM1 ;写入3号报警低位数值L1
LCALL DEL0
MOV R0, #BJ3_L2
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M3L2
LCALL WRITE_2402_RAM1 ;写入3号报警高位数值L2
LCALL DEL0
MOV R0, #BJ4_H1
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M4H1
LCALL WRITE_2402_RAM1 ;写入4号报警高位数值H1
LCALL DEL0
MOV R0, #BJ4_H2
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M4H2
LCALL WRITE_2402_RAM1 ;写入4号报警高位数值H2
LCALL DEL0
MOV R0, #BJ4_L1
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M4L1
LCALL WRITE_2402_RAM1 ;写入4号报警低位数值L1
LCALL DEL0
MOV R0, #BJ4_L2
MOV A, @R0
MOV BUF_BIN_L,A
MOV A, #T0M4L2
LCALL WRITE_2402_RAM1 ;写入4号报警高位数值L2
LCALL DEL0
ret
;==================================================
;24c02读写程序
;==================================================
STA: SETB SDA
SETB SCL
NOP
NOP
NOP
NOP
CLR SDA
NOP
NOP
NOP
NOP
CLR SCL
RET
STOP: CLR SDA
SETB SCL
NOP
NOP
NOP
NOP
SETB SDA
NOP
NOP
NOP
NOP
CLR SCL
RET
MACK: CLR SDA
SETB SCL
NOP
NOP
NOP
NOP
CLR SCL
SETB SDA
RET
MNACK: SETB SDA
SETB SCL
NOP
NOP
NOP
NOP
CLR SCL
CLR SDA
RET
CACK: SETB SDA
SETB SCL
CLR F0
JNB SDA, CAC
SETB F0
CAC: CLR SCL
NOP
NOP
RET
WBYTE: MOV R0, #08H
WLP: RLC A
JC WR1
LJMP WR0
WLP1: DJNZ R0,WLP
RET
WR1: SETB SDA
SETB SCL
NOP
NOP
NOP
NOP
CLR SCL
CLR SDA
LJMP WLP1
WR0: CLR SDA
SETB SCL
NOP
NOP
NOP
NOP
CLR SCL
LJMP WLP1
RBYTE: MOV R0, #08H
MOV R2, #00H
RLP: SETB SDA
SETB SCL
JNB SDA, RD0
LJMP RD1
RLP1: DJNZ R0, RLP
MOV A, R2
RET
RD0: CLR C
MOV A, R2
RLC A
MOV R2, A
CLR SCL
LJMP RLP1
RD1: SETB C
MOV A, R2
RLC A
MOV R2, A
CLR SCL
LJMP RLP1
WNBYTE: PUSH PSW
MOV PSW,#18H
LCALL STA
MOV A, SLA
LCALL WBYTE
LCALL CACK
JB F0,WNBYTE
MOV R1,MTD
WRDA: MOV A,@R1
LCALL WBYTE
LCALL CACK
JB F0,WNBYTE
INC R1
DJNZ NUMBYT,WRDA
LCALL STOP
POP PSW
RET
RNBYTR: PUSH PSW
MOV PSW, #18H
LCALL STA
MOV A, SLA
LCALL WBYTE
LCALL CACK
JB F0, RNBYTR
RDN: MOV R1, MRD
RDN1: LCALL RBYTE
MOV @R1,A
DJNZ NUMBYT,ACK
LCALL MNACK
LCALL STOP
POP PSW
RET
ACK: LCALL MACK
INC R1
JMP RDN1
;========================================================
;入口在A(存放地址),
;出口在BUF_BIN_L(存放数据)
;========================================================
READ_2402_RAM1:MOV BUFF_2402_1,A ;1字节
MOV MTD,#BUFF_2402_1 ;
MOV NUMBYT,#01H
MOV SLA,#0AEH
LCALL WNBYTE
MOV SLA,#0AFH
MOV NUMBYT,#01H
MOV MRD,#BUF_BIN_L
LCALL RNBYTR
SETB SDA
SETB SCL
RET
;============================================================
;入口,A(地址),BUF_BIN_L(数据)
;;1字节
;============================================================
WRITE_2402_RAM1:MOV BUFF_2402_1, A ;
MOV BUFF_2402_2, BUF_BIN_L
MOV MTD,#BUFF_2402_1
MOV SLA,#0AEH
MOV NUMBYT,#02H
LCALL WNBYTE
RET
;******************延时5秒程序***********************
;
;****************************************************
DEL_5S:MOV R5, #10H
DELAY_52:MOV R6, #0FFH
DELAY_51:MOV R7, #0FFH
DELAY_50:
MOV A, KEY
JNZ DEL_KEY
DJNZ R7, DELAY_50
DJNZ R6, DELAY_51
DJNZ R5, DELAY_52
RET
DEL_KEY:CJNE A, #01H, DEL_KEY0
LCALL INT
LJMP DISP_MENU
LCALL INT
LJMP DISP_MENU
DEL_KEY0:MOV KEY, #00H
LJMP DELAY_50
DEL:
CLR BEEP
MOV R6, #0FFH
DELAY_510:MOV R7, #0FFH
DELAY_500:NOP
NOP
DJNZ R7, DELAY_500
DJNZ R6, DELAY_510
SETB BEEP
SETB BEEP
SETB BEEP
SETB BEEP
RET
DEL0: MOV R6, #07FH
DEL00: MOV R7, #0FFH
DJNZ R7, $
DJNZ R6, DEL00
RET
;********************************点阵字库******************************
CTAB: db 00h, 3Eh, 51h, 49h, 45h, 3Eh, 00h, 00h ; -0- 0H
db 00h, 00h, 42h, 7Fh, 40h, 00h, 00h, 00h ; -1- 01H
db 00h, 62h, 51h, 49h, 49h, 46h, 00h, 00h ; -2- 02H
db 00h, 21h, 41h, 49h, 4Dh, 33h, 00h, 00h ; -3- 03H
db 00h, 18h, 14h, 12h, 7Fh, 10h, 00h, 00h ; -4- 04H
db 00h, 27h, 45h, 45h, 45h, 39h, 00h, 00h ; -5- 05H
db 00h, 3Ch, 4Ah, 49h, 49h, 31h, 00h, 00h ; -6- 06H
db 00h, 01h, 71h, 09h, 05h, 03h, 00h, 00h ; -7- 07H
db 00h, 36h, 49h, 49h, 49h, 36h, 00h, 00h ; -8- 08H
db 00h, 46h, 49h, 49h, 29h, 1Eh, 00h, 00h ; -9- 09H
db 00h, 00h, 36h, 36h, 00h, 00h, 00h, 00h ; -:- 0AH
db 00h, 00h, 60h, 60h, 00h, 00h, 00h, 00h ; -.- 0BH
db 00h, 00h, 00h, 00h, 03h, 03h, 00h, 00h ; -.- 0CH
db 00h, 3Eh, 41h, 41h, 41h, 22h, 00h, 00h ; -C- 0DH
db 00h, 08h, 08h, 7Fh, 08h, 08h, 00h, 00h ; -+- 0EH
db 00h, 08h, 08h, 08h, 08h, 08h, 00h, 00h ; --- 0FH
db 00h, 7Fh, 08h, 08h, 08h, 7Fh, 00h, 00h ; -H- 10h
db 00h, 7Fh, 40h, 40h, 40h, 40h, 00h, 00h ; -L- 11h
db 00h, 26h, 49h, 49h, 49h, 32h, 00h, 00h ; -S- 12h
db 00h, 00h, 00h, 00h, 00h, 00h, 00h, 00h ; -S- 13h
db 08h, 08h, 7Fh, 08h, 08h ; -+-
END
南京璞晓电子 www.cpx0.com需要
msn:njlianjian@hotmail.com