The MASM Forum Archive 2004 to 2012

Project Support Forums => 64 Bit Assembler => Topic started by: GUAN DE DIO on August 25, 2008, 06:21:02 PM

Title: pushfd /popfd
Post by: GUAN DE DIO on August 25, 2008, 06:21:02 PM
Hi everybody,

       In 32 bits I used pushfd/popfd to save/restore the flag register but in 64 bit platform I had the next issue when I compile the code

       error A2008: syntax error : pushad

       Which is the alternative?

Thanks,
GUAN
Title: Re: pushfd /popfd
Post by: evlncrn8 on August 26, 2008, 05:51:11 AM
pushaq / popaq maybe, though i dont think that worked for me last time i tried it...
so you may have to go the long route of push rax->all registers you want preserved etc...

using pushad/popad is a bit excessive though, are you really using all the registers?
Title: Re: pushfd /popfd
Post by: jj2007 on August 26, 2008, 06:04:26 AM
Quote from: GUAN DE DIO on August 25, 2008, 06:21:02 PM
       In 32 bits I used pushfd/popfd to save/restore the flag register but in 64 bit platform I had the next issue when I compile the code
       error A2008: syntax error : pushad
Unclear what you mean: You want to use pushfd but get an error for pushad?
Title: Re: pushfd /popfd
Post by: GUAN DE DIO on August 26, 2008, 08:17:05 AM
Sorry, It was a mistake.

    I wanted to mean pushfd/popfd to save/restore the flag register.

    I found the solution, the new instructions are pushfq and popfq

Thanks for all.

GUAN