/*判断运算法*/
MOV A, R1;
XRL A, #0AH;//判断是否为加法符
JZ ADD1;
MOV A, R1;
XRL A, #0BH;//判断是否为减法符
JZ SUBB1;
MOV A, R1;
XRL A, #0CH;//判断是否为乘法符
JZ MUL1;
MOV A, R1;
XRL A, #0DH;//判断是否为除法符
JZ DIV1;
MOV A, R1;
XRL A, #0EH;//判断是否为等于号
JZ EQUAL1;
MOV A, R1;
XRL A, #0FH;//判断是否为清零键
JZ ON1;
INC R0; //选择下一个地址
MOV A, R0; //存入r0的新数值
MOV R6, A;
POP PSW;
POP B;
pop ACC;
RET;
DELAY: MOV R7, #60;//消除抖动延时程序
DLY1: DJNZ R7, DLY1;
RET;
ADD1: MOV A, 80H; //加法程序
MOV 81H, A;
LJMP D1;
MOV A, 81H;
ADD A, 80H;
MOV 80H, A;
RET;
SUBB1: MOV A, 80H;//减法程序
MOV 81H, A;
LJMP DD1;
MOV A, 80H;
SUBB A, 81H;
MOV 80H, A;
RET;
MUL1: MOV A, 80H;//乘法程序
MOV 81H, A;
LJMP DD1;
MOV A, 80H;
MUL AB;
MOV 80H, A;
RET;
DIV1: MOV A, 80H;//除法程序
MOV 81H, A;
LJMP DD1;
MOV A, 80H;
DIV AB;
MOV 80H, A;
RET;
EQUAL1: MOV A, 80H;//等于程序
MOV B, #64H;//算百位数
DIV AB;
MOV 72H, A; //将此数除100,商数放72h,余数放71h。
MOV 71H, B;
MOV A, 71H;
MOV B, 0AH;//算十位数
DIV AB;
MOV 71H, A; //将此数除10,商数放71h,余数放70h。
MOV 70H, B;
RET;