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