单不进入中断子程序时显示堆栈溢出。
但是直接运行是没有显示溢出,但是也好像进去不了中断程序。因为用的是定时器,感觉好像定时器没发挥作用。
include HT66F0185.inc
ds .section 'data'
cs .section at 000h 'code'
MY_DATA .SECTION 'DATA'
DEL1 DB ?
DEL2 DB ?
DEL3 DB ?
DEL4 DB ?
DEL5 DB ?
DEL6 DB ?
STACK_A DB ?
STACK_STATUS DB ?
DIGIT DB 2 DUP (?)
SCAN DB ?
SCAN1 DB ?
COUNT DB ?
COUNT1 DB ?
SEG_PORT EQU PC
SEG_PORTC EQU PCC
SCAN_PORT EQU PB
SCAN_PORTC EQU PBC
SCAN1_PORT EQU PD
SCAN1_PORTC EQU PDC
MY_CODE .SECTION AT 0 'CODE'
ORG 00H
JMP INIT
ORG 14H
MOV A,10101000B
MOV WDTC,A
JMP ISR_STM
INIT:
CLR SCAN_PORTC
CLR SCAN1_PORTC
MOV A,10101000B
MOV WDTC,A
MOV A,00000000B
MOV TM2C0,A
MOV A,11000001B
MOV TM2C1,A
MOV A,LOW 1000
MOV TM2AL,A
MOV A,HIGH 1000
MOV TM2AH,A
SET MF0E
SET T2AE
SET EMI
;SET T2ON
MOV A,00010000B
MOV SCAN,A
MOV SCAN_PORT,A
CLR SEG_PORTC
MOV A,OFFSET TAB_7_SEG
MOV TBLP,A
MOV A,10
MOV COUNT,A
MOV COUNT1,A
RE_START:
CLR DIGIT[0]
CLR DIGIT[1]
LOOP:
SET T2ON
MOV A,OFFSET TAB_7_SEG
MOV TBLP,A
MOV A,DIGIT[0]
ADDM A,TBLP
TABRDL SEG_PORT
MOV A,00010000B
MOV SCAN,A
MOV SCAN_PORT,A
MOV A,1
CALL DELAY1
CLR SCAN_PORT
LOOP1:
MOV A,OFFSET TAB_7_SEG
MOV TBLP,A
MOV A,DIGIT[1]
ADDM A,TBLP
TABRDL SEG_PORT
MOV A,00000001B
MOV SCAN1,A
MOV SCAN1_PORT,A
MOV A,1
CALL DELAY1
CLR SCAN1_PORT
JMP LOOP
ISR_STM:
MOV STACK_A,A
MOV A,STATUS
MO
MOV STACK_STATUS,A
INC DIGIT[0]
SDZ COUNT1
JMP $+9
MOV A,10
MOV COUNT1,A
CLR DIGIT[0]
INC DIGIT[1]
SDZ COUNT
JMP $+3
MOV A,10
MOV COUNT,A
CLR T2ON
CLR T2AF
MOV A,STACK_STATUS
MOV STATUS,A
MOV A,STACK_A
RETI