TITLE Add and Subtract (AddSub.asm) ; This program adds and subtracts 32-bit int
ID: 3910063 • Letter: T
Question
TITLE Add and Subtract (AddSub.asm)
; This program adds and subtracts 32-bit integers.
INCLUDE Irvine32.inc
.code
main PROC
mov eax,10000h ; EAX = 10000h
add eax,40000h ; EAX = 50000h
sub eax,20000h ; EAX = 30000h
call DumpRegs ; display registers
exit
main ENDP
END main
The AddSub sample programs.
Type in the AddSub.asm or the AddSubAlt.asm program.
After you get it working, add some more statements.
For example, you could use the register ebx, instead of eax.
And you could use octal, binary, or decimal numbers instead of hexadecimal constants.
Tell me what you added to the program.
Submit the program listing AND program output.
In order to learn anything, you need to type these programs in.
Then you will see what happens if you make mistakes, and then can use the program listing in the book to correct your errors.
Before you can do this exercise, you will need to have the assembly language compiler and learn how to type the program in and compile program.
When you submit the program listing, also submit the program output.
After you get the program working, you can learn a lot by inserting errors in the program and see what sort of error message you get.
This will teach you how to read the syntax error messages.
Explanation / Answer
Hello,
Program.asm
The above code will solve your problem.
Thank you :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.