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 > Re: Segment pus...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 21 Topic 4599 of 4822
Post > Topic >>

Re: Segment push in RM

by "Rod Pemberton" <spamtrap@[EMAIL PROTECTED] > Apr 1, 2008 at 06:30 AM

"Cranky" <spamtrap@[EMAIL PROTECTED]
> wrote in message
news:e7f84580-90d3-4416-9fd3-b22663ee7dbd@[EMAIL PROTECTED]
> Using an operand override with a segment push in RM seems to push the
> lower 16bits of EFlags onto the stack as well as the segment register
> i.e.
>
> db 66
> push ds
> pop ax
> pop bx
>
> will produce ax=ds, bx=flags on my P3. Is this normal or just an
> example of 'undefined'
>

Using "db 0x66" - operand size override, you told "push" to push a 32-bit
operand onto a 16-bit stack:

....
ELSE StackAddrSize = 16
 IF OperandSize = 16
 THEN
  ...
 ELSE (* OperandSize = 32 *)
  SP <- (SP - 4);
  SS:SP <- SRC; (* Push doubleword *)
 FI;
FI;

But, DS is only 16-bits so "push" must get 16 more bits from somewhere...
For FS or GS, Intel defines the outcome of pu****ng the additional 16-bits:

"If the source operand is the FS or GS and its size is less than the
address
size of the stack, the zero-extended value is pushed on the stack."


Rod Pemberton
 




 21 Posts in Topic:
Segment push in RM
Cranky <spamtrap@[EMA  2008-04-01 00:39:33 
Re: Segment push in RM
Frank Kotler <spamtra  2008-04-01 10:13:49 
Re: Segment push in RM
"Wolfgang Kern"  2008-04-01 14:53:19 
Re: Segment push in RM
"Rod Pemberton"  2008-04-01 06:30:27 
Re: Segment push in RM
Cranky <spamtrap@[EMA  2008-04-01 05:52:51 
Re: Segment push in RM
Cranky <spamtrap@[EMA  2008-04-01 07:23:22 
Re: Segment push in RM
Frank Kotler <spamtra  2008-04-01 22:04:44 
Re: Segment push in RM
"Rod Pemberton"  2008-04-02 04:05:32 
Re: Segment push in RM
Robert Redelmeier <red  2008-04-02 18:05:57 
Re: Segment push in RM
"Rod Pemberton"  2008-04-02 20:26:45 
Re: Segment push in RM
Robert Redelmeier <red  2008-04-03 21:30:34 
Re: Segment push in RM
"Rod Pemberton"  2008-04-03 21:23:12 
Re: Segment push in RM
"Wolfgang Kern"  2008-04-04 17:40:22 
Re: Segment push in RM
Robert Redelmeier <red  2008-04-04 20:19:13 
Re: Segment push in RM
"Rod Pemberton"  2008-04-05 07:53:21 
Re: Segment push in RM
Cranky <spamtrap@[EMA  2008-04-01 23:59:11 
Re: Segment push in RM
Cranky <spamtrap@[EMA  2008-04-02 21:03:26 
Re: Segment push in RM
Cranky <spamtrap@[EMA  2008-04-02 20:28:18 
Re: Segment push in RM
Cranky <spamtrap@[EMA  2008-04-03 23:33:40 
Re: Segment push in RM
"Rod Pemberton"  2008-04-05 07:30:07 
Re: Segment push in RM
Cranky <spamtrap@[EMA  2008-04-06 11:42:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Tue Oct 7 12:38:59 CDT 2008.