Lobsters retrocomputing - 27 Nov 2026
Page 3 of 3
| | # 017 040 3nr mov Rd, CRn (n = 0-3) |
| | # 017 041 3nr mov Rd, DRn (n = 0-3, 6-7) |
| | # 017 042 3nr mov CRn, Rd (n = 0, 2-3) |
| | # 017 043 3nr mov DRn, Rd (n = 0-3, 6-7) |
| | # 017 044 3nr mov Rd, TRn (n = 6-7) |
| | # 017 046 3nr mov TRn, Rd (n = 6-7) |
| | CO-PROCESSOR ESCAPE SEQUENCE |
| | ---------------------------- |
| | Comments: |
| | * This escape sequence is intended to be used with an external co-processor |
| | with the most common application being the 80x87 floating point unit. |
| | * Starting in the 80486, the floating point unit was made internal to the |
| | processor. |
| | ESC TL, Ea Escape, operation TL, address mode Ea. |
| | 33T xLm esc TL Ea |
| | (6) Floating Point Operations |
| | The Floating Point unit consists of 8 internal registers arranged in a |
| | circular stack, and the Control Word (CW), Status Word (SW) and Tag Word (TW) |
| | registers. The floating point stack registers all store data in Real80 |
| | format (described below). |
| | Operations are carried out on data in the following formats (low-order bits |
| | on right): |
| | INTEGER: 16/32/64 bits (Int16, Int32, Int64) |
| | BCD: (BCD80) |
| | S 0000000 D D D D D D D D D D D D D D D D D D |
| | S = 1-bit sign (1 = negative, 0 = positive) |
| | D = 4-bit digit (encodes digits 0-9). |
| | FLOATING POINT: 32/64/80 bits (Real32, Real64, Real80) |
| | S Exponent Mantissa |
| | S = 1-bit sign (1 = negative, 0 = positive) |
| | Exponent = 8/11/15 bit biased exponent |
| | Mantissa = 23/52/64 bit decimal fraction. |
| | The values of floating point numbers in each format are as follows: |
| | Real32: (-1)^S (1 + Mantissa)/2^23 x 2^(Exponent - 127) |
| | Real64: (-1)^S (1 + Mantissa)/2^52 x 2^(Exponent - 1023) |
| | Real80: (-1)^S Mantissa/2^63 x 2^(Exponent - 16383) |
| | The floatng point formats do not cover all the logical combination of binary |
| | 0's and 1's, and the remaining combinations are defined for special purposes: |
| | Sign Exponent Mantissa Meaning |
| | S 0 0 0 ... 0 0 0 0 ... 0 0 |
| | S 0 0 0 ... 0 ... 1 ... DENORMAL (Infinitesimal) |
| | S 1 1 1 ... 1 0 0 0 ... 0 INFINITY |
| | S 1 1 1 ... 1 0 ... 1 ... Signalling NaN (Not a Number) |
| | S 1 1 1 ... 1 1 ... Quiet NaN |
| | This is all IEEE standard format. Quiet NaN's are set by the FP Unit to |
| | indicate invalid operations. |
| | Notation: |
| | ST(n) -- the nth item below the stack top. |
| | ST ----- ST(0), the stack top. |
| | Int*, BCD*, Real* -- described above. |
| | All Int*, BCD*, and Real* operands are stored in memory and are encoded in |
| | the 80x86's current addressing mode (16 or 32 bit). All opcodes are |
| | listed in the format: |
| | T L xm for 8086 escape code 33T xLm |
| | Since only memory addresses are used in the operations, that frees up all |
| | the combinations xm where x = 3. These are generally used to encode the |
| | operations that do not involve memory addresses. In the following |
| | presentation where "xm" is listed generally, it is understood that x is not 3. |
| | The operations FENI, FDISI are specific to the 8887; FSETPM to the 80287 |
| | and FUCOM*, FPREM1, and the trig. operations FSIN, FCOS, FSINCOS are all |
| | present only in the 80387 and after. |
| | DATA TRANSFER |
| | ------------- |
| | Comments: |
| | * The followng table is used: |
| | P 0 2 3 |
| | F-OP fld fst fstp |
| | I-OP fild fist fistp |
| | FLD Arg ST = (Real80)Arg |
| | FST Arg Arg = (typeof Arg)ST |
| | FSTP Arg Arg = (typeof Arg)ST; pop(); |
| | FXCH Arg Arg <--> ST, with appropriate type conversions. |
| | 1 P xm F-OP Real32 |
| | 3 P xm I-OP Int32 |
| | 5 P xm F-OP Real64 |
| | 7 P xm I-OP Int16 |
| | 3 5 xm fld Real80 |
| | 3 7 xm fstp Real80 |
| | 7 4 xm fbld BCD80 |
| | 7 5 xm fild Int64 |
| | 7 6 xm fbstp BCD80 |
| | 7 7 xm fistp Int64 |
| | 1 0 3m fld ST(m) |
| | 1 1 3m fxch ST(m) |
| | 5 2 3m fst ST(m) |
| | 5 3 3m fstp ST(m) |
| | COMPARISON |
| | ---------- |
| | Comments: |
| | * The followng table is used: |
| | P 2 3 |
| | F-OP fcom fcomp |
| | I-OP ficom ficomp |
| | FCOM Arg cmp ST, Arg |
| | FCOMP Arg cmp ST, Arg; pop(); |
| | 0 P xm F-OP Real32 |
| | 2 P xm I-OP Int32 |
| | 4 P xm F-OP Real64 |
| | 6 P xm I-OP Int16 |
| | 0 P 3m F-OP ST(m) |
| | FCOMPP cmp ST, ST(1); pop(); pop(); |
| | 6 3 31 fcompp |
| | FTST cmp ST, 0.0 |
| | 1 4 34 ftst |
| | FXAM examine ST |
| | 1 4 35 fxam |
| | FUCOM Arg unordered compare ST, Arg |
| | FUCOMP Arg unordered compare ST, Arg; pop(); |
| | FUCOMPP Arg unordered compare ST, ST(1); pop(); pop(); |
| | 5 4 3m fucom ST(m) |
| | 5 5 3m fucomp ST(m) |
| | 2 5 31 fucompp |
| | ARITHMETIC OPERATIONS |
| | --------------------- |
| | Comments: |
| | * The followng table is used: |
| | P 0 1 4 5 6 7 |
| | F-OP fadd fmul fsub fsubr fdiv fdivr |
| | I-OP fiadd fimul fisub fisubr fidiv fidivr |
| | P-OP faddp fmulp fsubp fsubrp fdivp fdivrp |
| | * Dest is ST and Src the listed operand except where noted below. |
| | FADD Arg Dest += Src |
| | FSUB Arg Dest += Src |
| | FSUBR Arg Dest = Src - Dest |
| | FMUL Arg Dest *= Src |
| | FDIV Arg Dest /= Src |
| | FDIVR Arg Dest = Src/Dest |
| | 0 P xm F-OP Real32 |
| | 2 P xm I-OP Int32 |
| | 4 P xm F-OP Real64 |
| | 6 P xm I-OP Int16 |
| | 0 P 3m F-OP ST(m) |
| | 4 P 3m F-OP ST(m) (Dest = ST(m), Src = ST) |
| | 6 P 3m P-OP ST(m) (Dest = ST(m), Src = ST) |
| | CONSTANTS |
| | --------- |
| | FLD1 ST = 1.0 |
| | FLDL2T ST = log_2(10) |
| | FLDL2E ST = log_2(e) |
| | FLDPI ST = pi |
| | FLDLG2 ST = log_10(2) |
| | FLDLN2 ST = ln(2) |
| | FLDZ ST = 0.0 |
| | 1 5 30 fld1 |
| | 1 5 31 fldl2t |
| | 1 5 32 fldl2e |
| | 1 5 33 fldpi |
| | 1 5 34 fldlg2 |
| | 1 5 35 fldln2 |
| | 1 5 36 fldz |
| | BUILT-IN FUNCTIONS |
| | ------------------ |
| | Comments: |
| | * The stack replacements entail pop()'s. |
| | FCHS ST = -ST |
| | FABS ST = \|ST\| |
| | F2XM1 ST = 2^ST - 1 |
| | FYL2X Replace the stack: ST(1), ST -> ST(1)*log_2(ST) |
| | FPTAN Replace the stack: ST -> tan(ST), 1.0 |
| | FPATAN Replace the stack: ST(1), ST -> atan(ST(1)/ST) |
| | FXTRACT Replace the stack: ST -> exponent(ST), mantissa(ST) |
| | FPREM1 ST = remainder(ST/ST(1)), IEEE consistent |
| | FPREM ST = remainder(ST/ST(1)) |
| | FYL2XPI Replace the stack: ST(1), ST -> ST(1)*log_2(ST + 1) |
| | FSQRT ST = sqrt(ST) |
| | FSINCOS Replace the stack: ST -> sin(ST), cos(ST) |
| | FRNDINT ST = round(ST) |
| | FSCALE ST *= 2^(int)ST(1) |
| | FSIN ST = sin(ST) |
| | FCOS ST = cos(ST) |
| | 1 4 30 fchs |
| | 1 4 31 fabs |
| | 1 6 30 f2xm1 |
| | 1 6 31 fyl2x |
| | 1 6 32 fptan |
| | 1 6 33 fpatan |
| | 1 6 34 fxtract |
| | 1 6 35 fprem1 |
| | 1 7 30 fprem |
| | 1 7 31 fyl2xpi |
| | 1 7 32 fsqrt |
| | 1 7 33 fsincos |
| | 1 7 34 frndint |
| | 1 7 35 fscale |
| | 1 7 36 fsin |
| | 1 7 37 fcos |
| | CONTROL |
| | ------- |
| | Comments: |
| | * The save and load operations for the environment and state are used |
| | primarily for multitasking applications where 2 or more processes are |
| | using the FP unit concurrently. |
| | FNOP Delay 1 cycle. |
| | FLDENV Arg Load FP environment from [Arg] |
| | FLDCW Arg CW = Arg |
| | FSTENV Arg Save FP environment to [Arg] |
| | FSTCW Arg Arg = CW |
| | FDECSTP TOP = (TOP - 1) mod 8 |
| | FINCSTP TOP = (TOP + 1) mod 8 |
| | FENI Enable interrupts (8087 only) |
| | FDISI Disable interrupts (8087 only) |
| | FCLEX Clear out FP exception flags |
| | FINIT Initialize FP registers |
| | FSETPM Enter Protected Mode (80287 only) |
| | FFREE ST(m) Mark register m as unused. |
| | FRSTOR Arg Restore FP state from [Arg] |
| | FSAVE Arg Save FP state to [Arg] |
| | FSTSW Arg Arg = SW |
| | 1 2 30 fnop |
| | 1 4 xm fldenv Ea |
| | 1 5 xm fldcw Ea |
| | 1 6 xm fstenv Ea |
| | 1 7 xm fstcw Ea |
| | 1 6 36 fdecstp |
| | 1 6 37 fincstp |
| | 3 4 30 feni |
| | 3 4 31 fdisi |
| | 3 4 32 fclex |
| | 3 4 33 finit |
| | 3 4 34 fsetpm |
| | 5 0 3m ffree ST(m) |
| | 5 4 xm frstor Ea |
| | 5 6 xm fsave Ea |
| | 5 7 xm fstsw Ea |
| | 7 4 30 fstsw AX |
Author
Author
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Previous page | More Lobsters retrocomputing | Headlines
Original: https://gist.github.com/seanjensengrey/f971c20d05d4d0efc0781f2f3c0353da