Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > manipulate stac...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 4606 of 4729
Post > Topic >>

manipulate stack for calling in 16bit mode (.code16gcc)

by junkoi <spamtrap@[EMAIL PROTECTED] > Apr 6, 2008 at 09:49 PM

Hi,

I am writing some code in 16bit mode, using .code16gcc directive, and
compile with gcc 4.1. In the below code, I expect that (1) and (2) are
doing the same thing, that is executing "func). But actually while (1)
works OK, (2) crashs. So confused!!

Perhaps because "pushw" pushs 4 bytes into stack instead of 2 bytes
with .code16gcc??? (sorry I only guess after reading the Intel manual,
but cannot verify it)

Many thanks,
Jun

------
..code16gcc

call func        // (1)

pushw $1f
jmp     func   // (2)
1:

.....
func:
      ret
 




 4 Posts in Topic:
manipulate stack for calling in 16bit mode (.code16gcc)
junkoi <spamtrap@[EMA  2008-04-06 21:49:39 
Re: manipulate stack for calling in 16bit mode (.code16gcc)
Cyril Novikov <spamtr  2008-04-06 23:54:19 
Re: manipulate stack for calling in 16bit mode (.code16gcc)
junkoi <spamtrap@[EMA  2008-04-07 01:59:16 
Re: manipulate stack for calling in 16bit mode (.code16gcc)
Frank Kotler <spamtra  2008-04-07 18:22:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 14:57:25 CDT 2008.