浮点数代数值比较(不影响待比较操作数)
入口条件:待比较操作数分别在[R0]和[R1]中。
出口信息:若CY=1,则[R0] < [R1],若CY=0且A=0则 [R0] = [R1],否则[R0] > [R1]。
影响资源:A、B、PSW 堆栈需求: 2字节
FCMP: MOV A,@R0
XRL A,@R1
JNB ACC.7,CMP2
MOV A,@R0
RLC A
MOV A,#0FFH
RET
CMP2: MOV A,@R1
MOV C,ACC.6
MOV ACC.7,C
MOV B,A
MOV A,@R0
MOV C,ACC.7
MOV F0,C
MOV C,ACC.6
MOV ACC.7,C
CLR C
SUBB A,B
JZ CMP6
RLC A
JNB F0,CMP5
CPL C
CMP5: MOV A,#0FFH
RET
CMP6: INC R0
INC R0
INC R1
INC R1
CLR C
MOV A,@R0
SUBB A,@R1
MOV B,A
DEC R0
DEC R1
MOV A,@R0
SUBB A,@R1
DEC R0
DEC R1
ORL A,B
JZ CMP7
JNB F0,CMP7
CPL C
CMP7: RET