Q2) Find out the error of the following program: Process: Compile with the MASM compiler and remove the ERROR. include i
Posted: Sat May 14, 2022 3:27 pm
Q2) Find out the error of the following program:
Process: Compile with the MASM compiler and remove the ERROR.
include io.obj
.model small
.586
.data
prompt_msg1 DB 'Please input the first number:',0 prompt_msg2 DB 'Please input the second number:',0 sum_msg DB 'The sum is ',0
.code .startup
PutStr prompt_msg2
GetInt CX
nwln
PutStr prompt_msg3 GetInt DX
[1 Marks]
[1 Marks]
nwln
Call sum
PutStr sum-msg PutInt AX
nwln
done:
.exit;
sum:
mov AX,CX
add AX,DX
ret;
end
Process: Compile with the MASM compiler and remove the ERROR.
include io.obj
.model small
.586
.data
prompt_msg1 DB 'Please input the first number:',0 prompt_msg2 DB 'Please input the second number:',0 sum_msg DB 'The sum is ',0
.code .startup
PutStr prompt_msg2
GetInt CX
nwln
PutStr prompt_msg3 GetInt DX
[1 Marks]
[1 Marks]
nwln
Call sum
PutStr sum-msg PutInt AX
nwln
done:
.exit;
sum:
mov AX,CX
add AX,DX
ret;
end