单片机编程问题,仿真的时候出现几个问题求解
我编的是12小时倒计时程序,仿真出现了以下问题1:时分秒倒计时出现16进制情况,初始状况显示11:60:60开始运行后出现11:60:65秒位依次出现65,64,63,62,61,60,59......52,51,50,55,54,53,52,51,50,49,49...依次如此,分钟时钟也同。问题2:时钟到1后我认为即使出现1的问题也应该跳变15,但是却跳变65....我的程序如下: ORG 0000H
AJMP MAIN
ORG 000BH
LJMP START
MAIN: MOV R0,#011H
MOV A,R0
ADD A,#00H
DA A
MOV P0,A
MOV R1,#02H
MOV A,R1
ADD A,#00H
DA A
MOV P1,A
MOV R2,#60H
MOV A,R2
ADD A,#00H
DA A
MOV P2,A
MOV TMOD,#01H
MOV TL0,#0E0H
MOV TH0,#0B1H
MOV R3,#32H
SETB TR0
SETB ET0
SETB EA
SJMP $
START:MOV TL0,#0E0H
MOV TH0,#0B1H
DJNZ R3,DELAY
MOV R3,#32H
MOV A,R2
ADD A,#00H
DA A
DEC A
MOV R2,A
CJNE A,#00H,J0
MOV R2,#59H
MOV A,R2
ADD A,#00H
DA A
MOV P2,A
LJMP K0
K0:
MOV A,R1
DEC A
MOV R1,A
CJNE A,#00H,J1
MOV R1,#59H
MOV A,R1
ADD A,#00H
DA A
MOV P1,A
LJMP K1
K1:
MOV A ,R0
DEC A
MOV R0,A
CJNE A,#00H,J2
LJMP START
J0: MOV A,R2
ADD A,#00H
DA A
MOV P2,A
LJMP START
J1: MOV A,R1
ADD A,#00H
DA A
MOV P1,A
LJMP START
J2: MOV A,R0
ADD A,#00H
DA A
MOV P0,A
LJMP START
DELAY:RETI
END 高手指点下啊!!!!