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 3 of 21 Topic 4599 of 4824
Post > Topic >>

Re: Segment push in RM

by "Wolfgang Kern" <spamtrap@[EMAIL PROTECTED] > Apr 1, 2008 at 02:53 PM

"Cranky" wrote:

> 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'

Stack will contain previous used data, and even there is a good chance
that a previous IRQ pushed the flags as the last item, I wouldn't rely
on this by any means.

you can try:
cli
....
push 0
sti
....
pop cx
db 66          ;this just effects SP (-4 instead of -2)
push DS        ;only 16 bits are copied to the stack
pop ax
pop bx
cmp bx,0
;may be nz if your code were interrupted inbetween push 0 ... pop cx
;but it should read zero if no IRQ occured.

__
wolfgang
 




 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 Sat Oct 11 7:59:39 CDT 2008.