;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; FLOATPT ; ; Driver for Parsing Floating-Point Strings ; ; Include File ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This file contains the assembly language definitions for the floating-point ; parser. Mainly these are the state and token type definitions. ; ; Revision History: ; 2/26/03 Glen George initial revision ; 2/25/05 Glen George added special floating point values ; State definitions ; note that these MUST match the layout of the transition table ST_INITIAL EQU 0 ;initial state ST_MANSIGN EQU 1 ;have a mantissa sign ST_LEADINGDP EQU 2 ;number starts with a decimal point ST_MANDIGIT EQU 3 ;digit to left of decimal point ST_FRACDIGIT EQU 4 ;digit to right of decimal point ST_EXP EQU 5 ;got the exponent symbol (E or e) ST_EXPSIGN EQU 6 ;have an exponent sign ST_EXPDIGIT EQU 7 ;have another exponent digit ST_ERROR EQU 8 ;got an error of some kind ST_END EQU 9 ;all done NUM_STATES EQU 10 ;number of states ; Token Type Definitions ; note that these MUST match the layout of the transition table TOKEN_DIGIT EQU 0 ;token is a digit: 0 to 9 TOKEN_SIGN EQU 1 ;token is a sign: + or - TOKEN_DP EQU 2 ;token is a decimal point: . TOKEN_EXP EQU 3 ;token is exponent character: E or e TOKEN_EOS EQU 4 ;token is end of string: <null> TOKEN_OTHER EQU 5 ;anything else NUM_TOKEN_TYPES EQU 6 ;number of token types ; Other Constants TOKEN_MASK EQU 01111111B ;mask high bit of token ;Single Precision (32-bit) Floating Point Special Values ;Quiet Not a Number (values from 0x7FC00000 to 0x7FFFFFFF and 0xFFC00000 to ; 0xFFFFFFFF are valid) SP_NaN_Q_W1 EQU 07FC0H ;high word SP_NaN_Q_W0 EQU 00000H ;low word ;Signaling Not a Number (values from 0x7F800001 to 0x7FBFFFFF and 0xFF800001 ; to 0xFFBFFFFF are valid) SP_NaN_S_W1 EQU 07F80H ;high word SP_NaN_S_W0 EQU 00001H ;low word ;Negative Infinity (always 0xFF800000) SP_Neg_Inf_W1 EQU 0FF80H ;high word SP_Neg_Ing_W0 EQU 00000H ;low word ;Positive Infinity (always 0x7F800000) SP_Pos_Inf_W1 EQU 07F80H ;high word SP_Pos_Ing_W0 EQU 00000H ;low word ;Double Precision (64-bit) Floating Point Special Values ;Quiet Not a Number (values from 0x7FF8000000000000 to 0x7FFFFFFFFFFFFFFF and ; 0xFFF8000000000000 to 0xFFFFFFFFFFFFFFFF are valid) DP_NaN_Q_W3 EQU 07FF8H ;high word DP_NaN_Q_W2 EQU 00000H DP_NaN_Q_W1 EQU 00000H DP_NaN_Q_W0 EQU 00000H ;low word ;Signaling Not a Number (values from 0x7FF0000000000001 to 0x7FF7FFFFFFFFFFFF ; and 0xFFF0000000000001 to 0xFFF7FFFFFFFFFFFF are valid) DP_NaN_S_W3 EQU 07FF0H ;high word DP_NaN_S_W2 EQU 00000H DP_NaN_S_W1 EQU 00000H DP_NaN_S_W0 EQU 00001H ;low word ;Negative Infinity (always 0xFFF0000000000000) DP_Neg_Inf_W3 EQU 0FFF0H ;high word DP_Neg_Inf_W2 EQU 00000H DP_Neg_Inf_W1 EQU 00000H DP_Neg_Ing_W0 EQU 00000H ;low word ;Positive Infinity (always 0x7FF0000000000000) DP_Pos_Inf_W3 EQU 07FF0H ;high word DP_Pos_Inf_W2 EQU 00000H DP_Pos_Inf_W1 EQU 00000H DP_Pos_Ing_W0 EQU 00000H ;low word