汇编加法器源代码
答案:2 悬赏:0 手机版
解决时间 2021-03-22 10:49
- 提问者网友:相思似海深
- 2021-03-21 12:28
汇编加法器源代码
最佳答案
- 五星知识达人网友:山河有幸埋战骨
- 2021-03-21 13:53
文件头:
DATA SEGMENT
MSG1 DB 'Input number1:$'
MSG2 DB 0Dh,0Ah,'Inupt number2:$'
RESULT DB 0Dh,0Ah,'Sum=$'
BUF1 DB 100 DUP(?)
BUF2 DB 100 DUP(?)
N1 DW 0
N2 DW 0
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:DATA
START: MOV AX,DATA
MOV DS,AX
MOV ES,AX
MOV AH,09H
MOV DX,OFFSET MSG1
INT 21H
INPUT1: MOV AH,01H
INT 21H
CMP AL,0DH
JE Next1
PUSH AX
INC N1
JMP INPUT1
NEXT1: MOV DX,OFFSET MSG2
MOV AH,09H
INT 21H
INPUT2: MOV AH,01H
INT 21H
CMP AL,0DH
JE Next2
PUSH AX
INC N2
JMP Input2
NEXT2: MOV DI,OFFSET BUF2
MOV CX,N2
LOOP1: POP AX
STOSB
LOOP LOOP1
MOV DI,OFFSET BUF1
MOV CX,N1
LOOP2: POP AX
STOSB
LOOP LOOP2
MOV DX,OFFSET RESULT
MOV AH,09H
INT 21H
MOV BX,N2
CMP N1,BX
DATA SEGMENT
MSG1 DB 'Input number1:$'
MSG2 DB 0Dh,0Ah,'Inupt number2:$'
RESULT DB 0Dh,0Ah,'Sum=$'
BUF1 DB 100 DUP(?)
BUF2 DB 100 DUP(?)
N1 DW 0
N2 DW 0
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:DATA
START: MOV AX,DATA
MOV DS,AX
MOV ES,AX
MOV AH,09H
MOV DX,OFFSET MSG1
INT 21H
INPUT1: MOV AH,01H
INT 21H
CMP AL,0DH
JE Next1
PUSH AX
INC N1
JMP INPUT1
NEXT1: MOV DX,OFFSET MSG2
MOV AH,09H
INT 21H
INPUT2: MOV AH,01H
INT 21H
CMP AL,0DH
JE Next2
PUSH AX
INC N2
JMP Input2
NEXT2: MOV DI,OFFSET BUF2
MOV CX,N2
LOOP1: POP AX
STOSB
LOOP LOOP1
MOV DI,OFFSET BUF1
MOV CX,N1
LOOP2: POP AX
STOSB
LOOP LOOP2
MOV DX,OFFSET RESULT
MOV AH,09H
INT 21H
MOV BX,N2
CMP N1,BX
全部回答
- 1楼网友:纵马山川剑自提
- 2021-03-21 14:19
可以私聊我~
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯