CPU Register - Eflag

Z80 Registers

About

The 32-bit EFLAGS register contains:

Eflags Registers

Automatic Managment

Task

When suspending a task, the processor automatically saves the state of the EFLAGS register in the task state segment (TSS) for the task being suspended.

When binding itself to a new task, the processor loads the EFLAGS register with data from the new task’s TSS.

Interrupt or exception handler

When a call is made to an interrupt or exception handler procedure, the processor automatically saves the state of the EFLAGS registers on the procedure stack.

When an interrupt or exception is handled with a task switch, the state of the EFLAGS register is saved in the TSS for the task being suspended.

Management

Init

Following initialization of the processor, the state of the EFLAGS register is 00000002H.

Reserved

Bits 1, 3, 5, 15, and 22 through 31 of this register are reserved. Software should not use or depend on the states of any of these bits.

Move

The following instructions can be used to move groups of flags to and from the procedure stack or the EAX register:

  • LAHF,
  • SAHF,
  • PUSHF,
  • PUSHFD,
  • POPF,
  • and POPFD.

Modification

Some of the flags in the EFLAGS register can be modified directly, using special-purpose instructions. There are no instructions that allow the whole register to be examined or modified directly.

After the contents of the EFLAGS register have been transferred to the procedure stack or EAX register, the flags can be examined and modified using the processor’s bit manipulation instructions (BT, BTS, BTR, and BTC).

Show

See modification

Documentation / Reference





Discover More
Cpu Moore Law Transistor
CPU - Task

the processor’s multitasking facilities When suspending a task, the processor automatically saves the state of the EFLAGS register in the task state segment (TSS) for the task being suspended....
Card Puncher Data Processing
Instruction - Exception

An exception is an event that occurs when: when an instruction causes an error. Example: an attempt to divide by zero generates an exception overflow at a breakpoints Some types of exceptions...
Instruction Cycle
Instruction Cycle - Interrupt

In a instruction cycle, the interrupt is the last part. Interrupts occur at random times during the execution of a program, in response to signals from hardware. Type Mean of Communication between ...
Cpu Memory Management Segmented Model
Memory Segment - Task state segment (TSS)

When suspending a task, the processor automatically saves the state of the EFLAGS register in the task state segment (TSS) for the task being suspended. When binding itself to a new task, the processor...
Status Flag Register
Register - Status Flag

The status flags (bits 0, 2, 4, 6, 7, and 11) of the EFLAGS register indicate the results of arithmetic instructions. The status flags allow a single arithmetic instructions to produce results...



Share this page:
Follow us:
Task Runner