Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <b>fprem partial remainder exception flags: i d u</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FPREM             Partial Remainder           Exception Flags: I D U

FPREM

       Logic:      ST . repeat (ST - ST(1)) until ST . ST(1)
                   If ST > ST(1) then C2 = 1, PREM = ST
                   If ST = ST(1) then C2 = 0, REM = 0
                   If ST < ST(1) then C2 = 0, REM = ST

     FPREM calculates ST mod (ST(1)). It leaves the remainder of the division
     ST/ST(1) in ST. The sign of the remainder is the same as the sign of the
     original dividend.

     FPREM also indicates the least-significant three bits of the quotient
     generated by FPREM in C3 C1 and C0 as follows:

                C3 C2 C1 C0 Meaning
                -- -- -- -- -------
                ?  1  ?  ?  Incomplete reduction
                0  0  0  0  quotient MOD 8 = 0
                0  0  0  1  quotient MOD 8 = 4
                0  0  1  0  quotient MOD 8 = 1
                0  0  1  1  quotient MOD 8 = 5
                1  0  0  0  quotient MOD 8 = 2
                1  0  0  1  quotient MOD 8 = 6
                1  0  1  0  quotient MOD 8 = 3
                1  0  1  1  quotient MOD 8 = 7

  --------------------------------------------------------------------------
   Operands            Clocks         Bytes           Example
   FPREM               15-190           3             FPREM
  --------------------------------------------------------------------------

        Note:          If you use ./4 as a modulus, FPREM reduces an
                       argument so that it is in the range of FPTAN.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson