Skip to main content

Status, Control and Tag register in 8087 math co-processer

 

 Status Register

  • The status register tells the overflow status of the 8087 coprocessor.
  • It is a 16-bit register.
  • It is accessed by executing the FSTSW instruction.
  • This instruction stores the content of the status register in memory.
  • Once the status is stored in memory the bit positions of the status register can be examined.
  • Busy: It indicates that the coprocessor is busy executing the task.
  • Condition codes ( C0-C3 ): They indicate various conditions about the coprocessor.
  • Top of Stack: It indicates a register as the top of the stack out of the eight stack registers.
  • Exception Flat: It is set if any of the exception flag bits ( SF, PR, UF, OF, ZD, ZD, IO) are set.
  • Stack Fault: It is not available in 8087. It is active only in 80387 and above.
  • Precision: It indicates that the result has exceeded the selected precision.
  • Underflow: It tells if the result is too small to fit in a register.
  • Overflow: It tells if the result is too large to fit in a register.
  • Zero Division: It indicates that you try to divide a non-zero by zero.
  • Denormalized: It indicates that at least one of the operands is denormalized.
  • Invalid Operation: It indicates an invalid operation. for e.g pushing more than eight items onto the stack, or attempting to pop an item off an empty stack. or taking the square root of a negative number.

Control Register

  • The control register controls the operating modes of 8087.
  • It is also a 16-bit register.
  • It performs rounding control and precision control.
  • It is also used to do masking and unmasking of the exception bits that correspond to the rightmost six bits of the status register.
  • FLDCW instruction is used to load the value into the control register.

Rounding Control: It determines the type of rounding or truncating to be done.
  • 00 = Round to nearest or even.
  • 01 = Round down towards minus infinity.
  • 10 = Round up towards plus infinity.
  • 11 = Chop or truncate towards zero.
Precision Control: It sets the precision of the result.
  • 00 = Single precision ( Short ).
  • 01 = Reserved.
  • 10 = Double precision ( long ).
  • 11 = Extended precision ( temporary ).
Exception Masks: These determine whether an error affects the exception bit in the status register.
  • If it is one, then the corresponding error is ignored.
  • If it is zero and the corresponding error occurs, then generates an interrupt, and the corresponding bit in the status register is set.

Tag Register



  • The tag register is used to indicate the contents of each register in the stack.
  • There are total of 8 tags (Tag 0 to Tag 7 ) in this register and each tag uses 2 bits to represent a value.
  • Therefore, it is a 16-bit register.
  • Tag values 
    • 00 = Valid
    • 01 = Zero
    • 10 = Invalid
    • 11 = Empty


Comments

Popular posts from this blog

8087 Math Co-Processor

   What is a co-processor? A co-processor is a specially designed circuit on a microprocessor chip that can perform the same task very quickly that the microprocessor performs. The main advantage of a co-processor is it reduces the workload of the main processor. Co-processors share the same memory, I/O system, bus control, and clock generator. The co-processor handles specialized tasks like mathematical calculation, graphical display on the screen, etc. 8087 co-processor It was the first math co-processor designed by Intel to pair with 8086/8088 resulting in the easier and faster calculation. The purpose of 8087 was to speed up the computation involving floating point calculation. 8087 math co-processor is also known as Numeric Data Processor (NDP), Numeric Processor Extension (NPX), Floating Point Unit (FPU) Features of 8087 This increase the overall speed and system performance of the entire system. Addition, subtraction, multiplication, and division of simple numbers are n...

Architecture of 8087 Math co-processor

  Introduction  8087 coprocessor is designed to operate with an 8086 microprocessor. The microprocessor and coprocessor can execute their respective instructions simultaneously. The microprocessor interprets and executes the normal instruction set and the coprocessor interprets and executes only the coprocessor instructions. All the coprocessor instructions are ESC instructions i.e. they start with ''F'', Architecture of 8087 The  internal structure of the 8087 coprocessor is divided into two major sections : the control unit ( CU ) Numeric Execution Unit ( NEU ) Control Unit ( CU ) It interfaces the coprocessor to the microprocessor system bus. It also synchronized the operation of the coprocessor and the microprocessor. This unit has a control word, status word, and Data buffer. If an instruction is ESC instruction, then the coprocessor executes it. If not, then the microprocessor executes. Numeric Execution Unit ( NEU ) This unit is responsible for executing all copr...