Question: Assembly errors on visual studio INCLUDE Irvine32.inc .386 .model flat, stdcall .stack 4096 ExitProcess proto, dwExitCode:dword .model small .stack 100h .data prompt1 db 13, 10,
Assembly errors on visual studio

INCLUDE Irvine32.inc
.386 .model flat, stdcall .stack 4096 ExitProcess proto, dwExitCode:dword
.model small
.stack 100h
.data
prompt1 db 13, 10, 'First number','$'
prompt2 db 13, 10, 'Second number','$'
prompt3 db 13, 10, 'Third number','$'
prompt4 db 13, 10, 'Fourth number','$'
result db 13, 10, 'input number','$'
;Variables
num1 dw ?
num2 dw ?
num3 dw ?
num4 dw ?
sum dw ?
.code
main proc
mov ax,@data ;get data segment address
mov ds,ax ;initialize ds
;Display prompt
mov ah,9 ;print string function
mov dx,offset prompt1 ;dsdx points to string
int 21h
; Numbers from the user
mov ah,1 ;input function
int 21h
xor ah,ah
mov num1, ax
mov ah,9
lea dx, prompt2 ;print prompt
int 21h
mov ah,2 ;input second function
int 21h
xor ah,ah
mov num2, ax
mov ah,9 ;print string function
mov dx,offset prompt3 ;ds:dx points to string
int 21h
mov ah,3 ;input function
int 21h
xor ah,ah
mov num3, ax
mov ah,9
lea dx, prompt4 ;print prompt
int 21h
mov ah,4 ;input fourth function
int 21h
xor ah,ah
mov num4, ax
;Addition
sub num1,'0'
sub num2,'0'
sub num3,'0'
sub num4,'0'
mov ax,num1 ;move num1 into ax
add ax,num2 ;add first and second numbers together
sub ax,num3
add ax,num4
mov sum,ax ;move the total sum of numbers in sum
add sum,'0'
;Print Sum
mov ah,9
lea dx, result ; print result
int 21h
mov ah,2
mov dl,bl
int 21h
mov dl,'+' ;display + sign
int 21h
mov dl,bh
int 21h
mov dl,'=' ;display = sign
int 21h
mov dl,bh
int 21h
mov ah,4ch
int 21h
invoke ExitProcess,0
main endp
end main
Properties 100 % Error List 4Errors | 2 warnings (D 0 Messages | Build-IntelliSense Search Error List Entire Solution Code A4011 A4011 Description Project MASM MASM File main.asm main.asm main.asm main.asm main.asm Line Suppression State multiple.MODEL directives found : .MODEL ignored multiple .MODEL directives found : .MODEL ignored instruction ope instruction operands must be the same size rands must be the same size A2022 A2004 48 80 40 MASM symbol type conflict The command "ml.exe/cologo/Sg/Zi/Fo"Debugimain.obj/ MSB3721 FI"MASM.Ist" /I"C:lirvine" /W3 /errorReport:prompt /Tamain.asm" exited MASM masm.targets 69 with code 1 Properties 100 % Error List 4Errors | 2 warnings (D 0 Messages | Build-IntelliSense Search Error List Entire Solution Code A4011 A4011 Description Project MASM MASM File main.asm main.asm main.asm main.asm main.asm Line Suppression State multiple.MODEL directives found : .MODEL ignored multiple .MODEL directives found : .MODEL ignored instruction ope instruction operands must be the same size rands must be the same size A2022 A2004 48 80 40 MASM symbol type conflict The command "ml.exe/cologo/Sg/Zi/Fo"Debugimain.obj/ MSB3721 FI"MASM.Ist" /I"C:lirvine" /W3 /errorReport:prompt /Tamain.asm" exited MASM masm.targets 69 with code 1
Step by Step Solution
There are 3 Steps involved in it
Lets address the errors and issues in the assembly code Errors Explanation and Solutions Multiple MODEL Directives You have model flat stdcall and mod... View full answer
Get step-by-step solutions from verified subject matter experts
