Please provide x86 [MASM] . 386 (32-bit) [not .model tiny or .model small] assem
ID: 3913850 • Letter: P
Question
Please provide x86 [MASM] .386 (32-bit) [not .model tiny or .model small] assembly program for the following (needs to be compatible with Visual Studio 2015.asm file)
5 points) Implement the following expression in assembly language, using 32-bit signed operands: vall = (val2 / val3) ? (val1+ val2)-(va14 3) Use the appropriate multiplication and division instructions. Use the CBW, CWD, or CDQ instructions when needed. For (val4* 3), you must use the mul two operands format. Run your program using the debugger to verify your answers. o Submit the following: - Lastname1.asnmExplanation / Answer
The code will be
.model tiny
.386
.data
val1 dd ?
val2 dd ?
val3 dd ?
val4 dd ?
result dd ?
.code
.startup
mov edx,val3
mov eax,val2
cdq
idiv edx
mov edx,val2
mov ebx,val4
add ebx,edx
imul ebx
mov result,eax
mov eax,val4
mov edx,3
imul edx
sub result,eax
.exit
end
Do give a thumbs up and in case there are doubts leave a comment.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.