ORG 0000H
AJMP MAIN
ORG 000BH
AJMP SETR0
MAIN: MOV A,#0FFH
MOV P1,A
MOV TMOD,#01H
MOV TH0, #0FCH
MOV TL0, #018H
MOV R0, #7
SETB EA
SETB TR0
SETB ET0
SJMP $
SETR0: MOV TH0,#0FCH
MOV TL0,#018H ;定时器重新赋值
DJNZ R0,NEXT ;如果R0-1不等于0,跳到NEXT
MOV A,P1 ;P1赋给A
CPL A ;A进行取反
MOV P1,A ;再把A赋给P1
JZ A, XH ;判断A是否为0,否则跳转到XH,这里编译出错
MOV R0,#7
SJMP NEXT
XH: MOV R0,#3
NEXT: RETI
END
Rebuild target 'Target 1'
assembling 400us.asm...
400us.asm(21): error A38: NUMBER OF OPERANDS DOES NOT MATCH INSTRUCTION
Target not created.
Build Time Elapsed: 00:00:02
这个是我照着程序来弄的,只是我的程序选用12M晶振,IO口换成了P1口,就编程出错了,请大家帮我看看为什么?
|