汇编语言程序设计
DATE1:
MOV DI,AX
LODSB
CMP AL,'0'
JB DATE7
CMP AL,'9'
JA DATE6
DATE2:
AND AX,0FH
SHL DI,1
RCL DX,1
MOV BX,DI
MOV BP,DX
SHL DI,1
RCL DX,1
SHL DI,1
RCL DX,1
JCXZ DATE3
SHL DI,1
RCL DX,1
Jmp short DATE4
DATE3:
ADD DI,BX
ADC DX,BP
DATE4:
ADD AX,DI
ADC DX,0
JMP DATE1
DATE5:
ADD AL,9
JMP DATE2
DATE6:
JCXZ DATE7
CMP AL,'A'
JB DATE7
CMP AL,'F'
JBE DATE5
CMP AL,'a'
JB DATE7
CMP AL,'f'
JBE DATE5
DATE7:
MOV AX,DI
DEC SI
OR DI,DX
POP DI
POP BP
POP BX
RET
;数据1与数据2根据YSF1进行加减运算
JSJJ LABEL NEAR
MOV AX,NUM2
MOV DX,NUM2+2
CMP YSF1,'+'
JZ JSJJ1
SUB NUM1,AX
SBB NUM1+2,DX
JMP SHORT JSJJ2
JSJJ1:
ADD NUM1,AX
ADC NUM1+2,DX
JSJJ2:
RET
;数据1与数据2根据YSF1进行乘除运算
JSII1 LABEL NEAR
MOV BX,OFFSET NUM1
JMP SHORT JSII2_1
;数据2与数据3根据YSF2进行乘除运算
JSII2 LABEL NEAR
MOV BX,OFFSET NUM2
JSII2_1:
DB 66H
MOV AX,[BX]
DB 66H
MOV CX,[BX+4]
CMP YSF2,'*'
JNZ JSII2_2
DB 66H
IMUL CX
JMP SHORT JSII2_3
JSII2_2:
DB 66H
CWD
DB 66H
IDIV CX
CMP YSF2,'/'
JZ JSII2_3
DB 66H
XCHG DX,AX
JSII2_3:
DB 66H
MOV [BX],AX
RET
;显示结果
XUJG LABEL NEAR
MOV AX,JGV4
MOV DX,JGV4+2
MOV CX,10
CMP UV,10
JZ XUJG0
MOV CX,16
XUJG0:
TEST DX,8000H
751com.cn
CALL DOUT
XUJG2:
NOT AX
NOT DX
ADD AX,1
ADC DX,0
PUSH AX
CMP UV,10
JZ XUJG3
MOV AL,' '
CALL DISP
MOV AL,'('
CALL DISP
XUJG3:
MOV AL,'-'
CALL DISP
POP AX
CMP UV,10
上一页 [1] [2] [3] [4] [5] 下一页
汇编语言四则运算源代码+流程图 第3页下载如图片无法显示或论文不完整,请联系qq752018766