51单片机伟福仿真器
51单片机伟福仿真器,程序如下(求多个字节乘法),为什么出现NIMULmn符号没定义的出错?求解……ORG0000HLJMPMAINORG0040HMAIN:MOVSP,...
51单片机伟福仿真器,程序如下(求多个字节乘法),为什么出现NIMULmn符号没定义的出错?求解……
ORG 0000H
LJMP MAIN
ORG 0040H
MAIN: MOV SP,#5FH
SETB PSW.3
MOV R0,#30H
MOV R1,#50H
MOV R2,#03H
MOV R3,#02H
LCALL NIMULmn
SJMP $
END
NIMULmn: MOV A,R0
MOV R4,A
MOV A,R3
MOV R7,A
MOV A,R1
MOV R5,A
INITIAL: CLR C
SUBB A,R7
MOV R6,A
MOV R1,A
LCALL INIT1
MOV A,R2
PUSH ACC
MOV A,R7
ADD A,R2
MOV R2,A
POP ACC
MOV B,#08H
MUL AB
MULRL1: PUSH ACC
MOV A,R6
MOV R1,A
MOV A,R2
MOV R3,A
LCALL MULRL101
JNC MULRL4
MOV A,R7
MOV R3,A
MOV A,R6
MOV R0,A
MOV A,R4
MOV R1,A
CLR C
MULRL2: MOV A,@R0
ADDC A,@R1
MOV @R0,A
INC R0
INC R1
DJNZ R3,MULRL2
JNC MULRL4
MOV A,R5
MOV R1,A
MOV A,R7
MOV R3,A
MULRL3: MOV A,@R1
ADDC A,#00H
MOV @R1,A
JNC MULRL4
INC R1
DJNZ R3,MULRL3
MULRL4: POP ACC
DEC A
JNZ MULRL1
MOV A,R2
MOV R3,A
MOV A,R6
MOV R0,A
RET
INIT1: CLR A
INTT10: MOV @R1,A
INC R1
DJNZ R3,INIT10
RET
MULRL101: CLR C
INIT102: MOV A,@R1
RLC A
MOV @R1,A
INC R1
DJNZ R3,INIT102
RET 展开
ORG 0000H
LJMP MAIN
ORG 0040H
MAIN: MOV SP,#5FH
SETB PSW.3
MOV R0,#30H
MOV R1,#50H
MOV R2,#03H
MOV R3,#02H
LCALL NIMULmn
SJMP $
END
NIMULmn: MOV A,R0
MOV R4,A
MOV A,R3
MOV R7,A
MOV A,R1
MOV R5,A
INITIAL: CLR C
SUBB A,R7
MOV R6,A
MOV R1,A
LCALL INIT1
MOV A,R2
PUSH ACC
MOV A,R7
ADD A,R2
MOV R2,A
POP ACC
MOV B,#08H
MUL AB
MULRL1: PUSH ACC
MOV A,R6
MOV R1,A
MOV A,R2
MOV R3,A
LCALL MULRL101
JNC MULRL4
MOV A,R7
MOV R3,A
MOV A,R6
MOV R0,A
MOV A,R4
MOV R1,A
CLR C
MULRL2: MOV A,@R0
ADDC A,@R1
MOV @R0,A
INC R0
INC R1
DJNZ R3,MULRL2
JNC MULRL4
MOV A,R5
MOV R1,A
MOV A,R7
MOV R3,A
MULRL3: MOV A,@R1
ADDC A,#00H
MOV @R1,A
JNC MULRL4
INC R1
DJNZ R3,MULRL3
MULRL4: POP ACC
DEC A
JNZ MULRL1
MOV A,R2
MOV R3,A
MOV A,R6
MOV R0,A
RET
INIT1: CLR A
INTT10: MOV @R1,A
INC R1
DJNZ R3,INIT10
RET
MULRL101: CLR C
INIT102: MOV A,@R1
RLC A
MOV @R1,A
INC R1
DJNZ R3,INIT102
RET 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询