UMBC CMSC 211

UMBC | CSEE |


The FPU Stack

The most important registers in the FPU are a stack of eight extended floating point numbers and a 2-bit tag field for each of the eight. One of the registers is designated as the top of the stack (ST) and all other registers are relative to it: ST(1), ST(2). Data is pushed on the stack with a load. In every FPU computation, one of the operands is ST. If an attempt to put value on a non-empty entry will result in an error.

FPU Load (Push)

fld mem32 or mem64 ; short or long fp load
fld ST(n) ; load from another stack entry
fild mem16 or mem32 ; int or long int load
fbld mem80 ; BCD load
NOTE: The argument is converted to internal format of FPU and pushed on the stack.
NOTE: A simple register cannot be used as the operand.

FPU Load (Push) constants

fld1 ; load 1
fldz ; load zero
fldpi ; load p
fldl2t ; load log210
fldl2e ; load log2e
fldlg2 ; load log102
fldln2 ; load loge2

FPU Store (and pop) ST

fst[p] mem32 or mem64 ; store [and pop] ST
fst[p] ST(n) ; copy [then pop] ST to ST(n)
fist[p] mem16 or mem32 ; store [and pop] ST as int
fbst mem80 ; store and pop ST as BCD

FPU Miscellaneous Stack Instructions

fcomp ST ; pop FPU stack
fld ST ; load duplicate of stack top
fxch ST(n) ; exchange contents of ST and ST(n)
fxch ; exchange contents of ST and ST(1)


UMBC | CSEE