On Wed, 5 Mar 2008 06:15:49 -0800 (PST), phulepriya
<spamtrap@[EMAIL PROTECTED]
> wrote:
>Hi,
>
>I am trying to develop an application in 16 bit. {Intel: Windows OS}
>
>When I have code size(where i want to jump) of 11 k the lable jump is
>happening ..
>and when code size (where i want to jump) increases to 12 k the BOUCHS
>gives error as
>IRET: Top 6 bytes of stack are currupted.
>
>jmp 0x2A00:0: jumps when code after 2a00 (linked using NASAM) is belOw
>12 k
>
>and same does not jump if code size after 2a00 icreases above 12k
>
>IS THERE ANY RELATION BETWEEN THE CODE SIZE AND JUMP/STACK in 16 BIT?
>
>Thanks in advance...
>
There is a definite relation if you are using the COM format, since
the code and stack share the same segment, with the stack growing
down from above. The COM model unfortunately leads one down
the primrose path here, since most programs work perfectly fine... but
as your code grows (or the stack usage) a collision eventually
results. By then you may have completely forgotten about the initial
constraint.
One solution is to set your own stack segment at start-up.
Note that under "DOS rules" you own all the memory up to
the display adapter at A000. (Not exactly true... you can get
the exact limit from the PSP.) So just set SS so that there
can never be a collision. A trick that I used to use is to keep
SS the same, but set SP to 100h as soon as you are done
using the PSP. This always worked out nicely for me since
I never used the stack much (no recursion or structure passing, etc),
so it was a "set-and-forget" deal.
Best regards,
Bob Masta
DAQARTA v3.50
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Scope, Spectrum, Spectrogram, FREE Signal Generator
Science with your sound card!


|