A processor is configured to support a programmable flags masking during processing
of a system call instruction such as Syscall. The processor includes a register
storing a mask, where an indication within the mask corresponds to each of a plurality
of flags used by the processor. Based on the state of the indication, the processor
may clear a corresponding flag or may retain the value of the corresponding flag.
By programming the register appropriately, the desired clearing and retaining of
the plurality of flags may be performed as part of the system call instruction.
Flexibility may be provided for different operating systems having different sets
of flags to be preserved or cleared.