我先放2段
;************************* 串行接收中断 ***********************************
USART0_RX
PUSH R6
BIC.B #URXIE0,&IE1 ;关中断
BIT.B #RECEIVING0,&BIT_FLAG1
JNZ USART0_5
CMP.B #23H,&RXBUF0
JNZ USART0_4
BIT.B #RECEIVE0_HEAD,&BIT_FLAG1
JNZ USART0_3
USART0_4 BIC.B #RECEIVE0_HEAD,&BIT_FLAG1
MOV #RECEIVE0_BUFF,RECEIVE0_POINT
MOV RECEIVE0_POINT,R6
MOV.B #23H,0(R6)
INC RECEIVE0_POINT
INC R6
MOV.B #23H,0(R6)
INC RECEIVE0_POINT
JMP USART0_RX_RET
USART0_5
MOV RECEIVE0_POINT,R6
MOV.B &RXBUF0,0(R6)
INC RECEIVE0_POINT
USART0_RX_RET BIS.B #URXIE0,&IE1 ;开中断
POP R6
RETI
;
;************************* 显示电话号码 **********************************
;REGISTER:R7 PHONE NUMBER COUNTER
; R8 PHONE NUBER ADDRESS
;****************************DIS_PHONE*******************************************
DIS_PHONE
PUSH R8
PUSH R9
PUSH R7
CALL #LCM_CLS
MOV #0,R9
MOV #0,R7
CMP.B #EDIT_STATE_11,EDIT_STATE_FLAG
JZ DIS_P1
JMP DIS_PHONE_RET
DIS_P1
;MOV.B #0,DISPLAY_X
;MOV.B #48,DISPLAY_Y
;MOV.B #16,REVERSE_H
;CALL #LCM_REVERSE
; ;显示汉字:未接来电
;MOV.B #0,LCM_STATE
;JMP DIS_PHONE_RET
;DIS_PP1
MOV #DIAL_MEM,R8
JMP DIS_PHONE_MAIN
;DIS_P2
;MOV #RECEIVED_MEM,R8
;JMP DIS_PHONE_MAIN
;DIS_P3
;MOV #NORECEIVED_MEM,R8
;JMP DIS_PHONE_MAIN
DIS_PHONE_MAIN
DIS_PHONE_COM
CMP.B #16,R9
JZ DIS_PHONE1B
ADD.B #1,DISPLAY_X
JMP DIS_PHONE10
DIS_PHONE110
CMP.B #39H,DISPLAY_VALUE
JHS DIS_PHONE_COM
CALL #FIND_DOT
CMP.B #16,R9
JNZ DIS_PHONE1A
JMP DIS_PHONE1B
DIS_PHONE1A
ADD.B #1,DISPLAY_X
JMP DIS_PHONE10
DIS_PHONE1B
MOV.B #1,DISPLAY_X
ADD.B #16,DISPLAY_Y
MOV #0,R9
JMP DIS_PHONE10
DIS_PHONE_RET
MOV.B #FIN_DIALING_STATE,WORK_STATE
POP R7
POP R9
POP R8
RET