ieeerdf2.abm (F2-CP128)

10           REM —

12           REM Read Double Word from 250 CPU, Convert to IEEE FP, and Display

14           REM

30           BMOVE R,VH(1420),K(4) :  REM 4 Byte Number

32           PRINT1 HEX$(SHARED(2)); : A=SHARED(2)

34           PRINT1 HEX$(SHARED(0)) : B=SHARED(0)

40           S=A.AND.08000H :  REM Sign Bit

42           PRINT1 “Sign     “, :  IF S THEN  PRINT1 “-” ELSE  PRINT1 “+”

50           E=((A.AND.07F80H)/128)-126 :  REM Exponent

52           PRINT1 “Exponent “,E

60           MMSB=A.AND.001FFH : MLSW=B

61           M=.5 :  REM MSB of Mantissa is always assumed to be ON (2**-1)

62           PWR=2 :  REM Start with 2**-2

64           FOR B=6 TO 0 STEP -1 :  REM Step through the 7 MSBits

66           IF PICK(MMSB,B(B)) THEN M=M+(2**(-PWR))

68           PWR=PWR+1

70           NEXT B

72           FOR B=15 TO 0 STEP -1 :  REM Step through the 16 Bits of the LSW

74           IF PICK(MLSW,B(B)) THEN M=M+2**(-PWR)

76           PWR=PWR+1

78           NEXT B

80           PRINT1 “Mantissa “,M

90           PRINT1 “FP #     “,(2**E)*M

×