| | |
please help me check code Tasm fibonacci
Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2006
Posts: 26
Reputation:
Solved Threads: 0
im converting a fibonacci c code to tasm assembly... i've started my code but im having a difficulty in the part where
return fibo(n-1)+fibo(n-2)...please help
the red fonts is where im not sure if my code is correct...can you please help
c code:
Tasm assembly code:
return fibo(n-1)+fibo(n-2)...please help
the red fonts is where im not sure if my code is correct...can you please help
c code:
int fib(int n)
{
if (n <= 2) return 1
else return fib(n-1) + fib(n-2)
}Tasm assembly code:
fibo proc near
push bp
mov bp, sp
push ax
push bx
push cx
mov ax, [bp+6]
cmp ax,2
jle one
sub sp,2
mov ax, [bp+6]
push ax
mov ax, [bp+4]
push ax
call fibo
pop ax
mov cx, [bp+6]
add ax
mov [bp+8], ax
jmp done
one:
mov [bp+8],1
done:
pop cx
pop bx
pop ax
pop bp
ret 4
fiboendp![]() |
Similar Threads
- could you check my code ? (C)
- Code Check, Please (ASP)
- check this code pleeeeeeeeeease (C++)
- Again please someone check my code (C++)
- Check the code!! (C++)
- DrawHouse code help... (Java)
- DrawHouse Code Problem (Java)
Other Threads in the Assembly Forum
- Previous Thread: Need anyone to tell me how to read this properly
- Next Thread: 8 Queens Problem!?
| Thread Tools | Search this Thread |





