我用keil c51仿真,时分秒都变化太快了。实在找不出是哪里的问题,给位帮我看看吧! ;时钟程序。40,41,42分别为时分秒。振荡频率12mHZ ORG 0 AJMP M ORG 0BH AJMP T0INT ORG 40H M: MOV TMOD,#1 MOV TL0,#0B0H MOV TH0,#3CH CLR 40H CLR 41H CLR 42H CLR 43H SETB TR0 SETB ET0 SETB EA
SJMP $ T0INT: MOV TL0,#3CH MOV TH0,#0B0H INC 43H MOV R0,43H CJNE R0,#20,RT MOV 43H,#0 INC 42H MOV R0,42H CJNE R0,#3CH,RT MOV 42H,#0 INC 41H MOV R0,41H CJNE R0,#3CH,RT MOV 41H,#0 INC 40H MOV R0,40H CJNE R0,#18H,RT MOV 40H,#0 RT: RETI RET END
|