Question
f(x,y).
;Your function will be equivalent to the following C/C++ code.
;int f(int x,int y)
;{
; return y - 3*(x+1);
;}
;********************************************************
SECTION .text
GLOBAL f
f:
; prolog
push ebp ; save old base pointer
mov ebp,esp ; setup new base pointer
push ebx ; preserve EBX for caller
; [ebp+8] - x (arg1)
; [ebp+12] - y (arg2)
; ------------------------------------------
; perform actual function calculation here
mov eax,1
; ------------------------------------------
; %eax = return value fib(n)
; epilog
pop ebx ; restore EBX for caller
pop ebp ; restore old base pointer
ret
Solution Preview
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.
SECTION .textGLOBAL f
f:
; prolog
push ebp ; save old base pointer
mov ebp,esp ; setup new base pointer
push ebx ; preserve EBX for caller
; [ebp+8] - x (arg1)...
By purchasing this solution you'll be able to access the following files:
Solution.asm.