程序如下:
ORG 0000H
LJMP START
ORG 0003H
LJMP EXT0
ORG TIM0
START: MOV SP,#70H
MOV TMOD,#00000001B
MOV TH0,#HIGH(65536-10000)
MOV TL0,#LOW(65536-10000)
SETB TR0
MOV IE,#10000011B
MOV IP,#00000001B
MOV R5,#100
MOV R1,#0FEH
JMP $
TIM0: PUSH ACC
PUSH PSW
MOV TH0,#HIGH(65536-10000)
MOV TL0,#LOW(65536-10000)
DJNZ R3,LOOP
MOV R3,#100
MOV A,R1
MOV P2,A
RL A
MOV R1,A
LOOP: POP PSW
POP ACC
RETI
EXT0: PUSH ACC
PUSH PSW
MOV A,#00
MOV R2,#10
LOOP3: MOV P2,A
CALL DELAY
CPL A
DJNZ R2,LOOP3
POP PSW
POP ACC
RETI
DELAY: MOV R5,#20
D1: MOV R6,#20
D2: MOV R7,#248
DJNZ R7,$
DJNZ R6,D2
DJNZ R5,D1
RET
END
报警如下:
Build target 'Target 1'
assembling AAAA.asm...
AAAA.asm(7): error A42: PHASE ERROR (PASS-2)
Target not created
关于这个设置堆栈数值为啥会错,求大神解答下,应该是对的啊,
此帖出自
小平头技术问答
一周热门 更多>