老师让我们编程序求多为到符号数减法,下面是我写的程序,肯定不对,求大神帮忙改正
DATA SEGMENT
A DB 'BEIJIAN=','$'
B DB 'JIANSHU=','$'
C DB 'JIEGUO=' ,'$'
DATA ENDS
;回车换行
CRLF MACRO
MOV DL,0DH
MOV AH,02H
INT 21H
MOV DL,0AH
MOV AH,02H
INT 21H
ENDM
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:MOV
AX,DATA
MOV DS,AX
;键盘输入被减数
CRLF LEA DX,A
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
MOV BL,AL
;键盘输入减数
CRLF
LEA DX,B
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
MOV BH,AL
CRLF
LEA DX,C
MOV AH,09H
INT 21H
;做减法
SBB BL,BH
MOV AL,BL
;好像是进行BCD码转换,照书抄的,不太明白
MOV CL,AL
MOV AL,0
LP2: ADD AL,1
AAA
dec cl
JNZ LP2
MOV BL,AL
;送显
ADD BL,30H
MOV DL,BL
MOV AH,02H
INT 21H
;结束
CRLF MOV AH,0H
INT 16H
MOV AX,4CH
INT 21H
CODE ENDS
END START
DATA SEGMENT
A DB 'BEIJIAN=','$'
B DB 'JIANSHU=','$'
C DB 'JIEGUO=' ,'$'
DATA ENDS
;回车换行
CRLF MACRO
MOV DL,0DH
MOV AH,02H
INT 21H
MOV DL,0AH
MOV AH,02H
INT 21H
ENDM
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:MOV
AX,DATA
MOV DS,AX
;键盘输入被减数
CRLF LEA DX,A
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
MOV BL,AL
;键盘输入减数
CRLF
LEA DX,B
MOV AH,09H
INT 21H
MOV AH,01H
INT 21H
MOV BH,AL
CRLF
LEA DX,C
MOV AH,09H
INT 21H
;做减法
SBB BL,BH
MOV AL,BL
;好像是进行BCD码转换,照书抄的,不太明白
MOV CL,AL
MOV AL,0
LP2: ADD AL,1
AAA
dec cl
JNZ LP2
MOV BL,AL
;送显
ADD BL,30H
MOV DL,BL
MOV AH,02H
INT 21H
;结束
CRLF MOV AH,0H
INT 16H
MOV AX,4CH
INT 21H
CODE ENDS
END START