![]() |
I have to create a assembly program that does the Fibonacci series using recursion. I wrote the program in 16bit code using a subproc for the fibonacci recursion and debugged it until it works. Then I converted the code to 32bit code by adding the E's to the registers and adding a few lines to the top. I also doubled the pointer addresses that I use. This program also has to be complied with C++ code.
Like I said when the program runs in 16-bit mode, everything work fine. But when it's converted and complied w/ C++ code, when I input 1, it works fine. However when I put in 2 I get 4551668. However when I put in 3, i get 4551669. If i substract 4551668 from whatever number I get, it works. So here's my question - where does the 4551668 come from? Is there something i'm not taking into consideration when i'm debugging it? any suggestion would be extremely helpful... thanks Matt here's my code... :
.386p:
#include <iostream> |
Can you post the original 16-bit code?
|
Maybe you cleared ax and not eax?
PS: In your code change Postitive > Positive |
They're compatible. If you want to take advantage of 32-bit registers, instead of ax write eax. I use 16-bit though because i'm used to it and I haven't needed more room.
|
Christian_Rosenkreuz_777: I thought that's what he did:
Quote:
|
| All times are GMT -5. The time now is 4:09 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC