Reading up on EFLAGS, got me thinking, what about 64 bit flag register? Is this register only 32bit? I looked online, and there is extended to 64bits with RFLAGS. I looked it up in the Intel Guide, and it simply says,
RFLAGS Register in 64-Bit Mode In 64-bit mode, EFLAGS is extended to 64 bits and called RFLAGS. The upper 32 bits of RFLAGS register is reserved. The lower 32 bits of RFLAGS is the same as EFLAGS.
I wasn't sure however, what "reserved" means. Does anything use RFLAGS? Is it used internally by Intel? The docs seem to suggest that the register is 64 bit, but is there any way to even interact with the upper 32 bits when PUSHFD and POPFD seem to be double words, and quad words. Will a future processor likely deliver PUSHFQ and POPFQ?
If a calling procedure needs to maintain the state of the EFLAGS register, it can save and restore all or part of the register using the
PUSHF/PUSHFDandPOPF/POPFDinstructions. ThePUSHFinstruction pushes the lower word of theEFLAGSregister on the stack, while thePUSHFDinstruction pushes the entire register. ThePOPFinstruction pops a word from the stack into the lower word of theEFLAGSregister, while thePOPFDinstruction pops a double word from the stack into the register.