Question: Assembly Language - val1 = (val2 - val3)*(val4/val2)-(val3*3) - to access the values in the caller frame, use EBP (remember EBP is created at the
Assembly Language
- val1 = (val2 - val3)*(val4/val2)-(val3*3)
- to access the values in the caller frame, use EBP (remember EBP is created at the callee side).
- name the subroutine INtegerArithmeticProc
- when calling or creating the IntegerArithmeticcProc subroutine, you are not allowed to used any of the following directives: invoke, addr, proc with lists, and roto or proto with lists
call IntegerARithmetic
invoke ExitProcess,0
main endp
IntegerARithmetic proc
push ebp
mov ebp, esp
mov eax,[ebp + 8]
mov ebx, [ebp + 12]
idiv ebx
mov ebx,edx
mov eax, 3
imul val3
sub ebx,eax ;(val4/val2)-(val3*3)
mov eax,ebx
mov ebx, val2
sub ebx, val3
imul ebx
mov val1, eax
pop ebp
ret
IntegerARithmetic endp
I did it little bit, but it is wrong
can you fix it?
thank yo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
