10 DIM A(8) 20 X=0 30 READ A$ 40 IF A$="###" THEN 80 50 POKE &HFFF+X,VAL("&H"+A$) 60 X=X+1 70 GOTO 30 80 EXEC &HFFF 90 FOR X=0 TO 30 100 FOR Y=0 TO 7 110 A(Y)=PEEK(&H2000+X*8+Y) 120 NEXT Y 130 'CONVERT FROM IEEE 754 DOUBLE TO ASCII 140 IF A(0) > 127 THEN S=1:A(0)=256-A(0) 150 E=A(0)*16+INT(A(1)/16) 160 E=E-1023 170 A(1) = A(1) AND 15 180 'COMPUTE MANTISSA (WE LEAVE OFF THE LAST 2 BYTES) 190 M=0 200 FOR I=1 TO 5 210 M=M*256 220 M=M+A(I) 230 NEXT I 240 R=2^E*(1.0+(M/68719476735)) 250 IF (R-INT(R)) < 0.01 THEN R=INT(R) 260 PRINT R 270 NEXT X 280 END 290 DATA 41 ' switch to RISC mode 300 DATA 28,18,C0,00 ' 1000 310 DATA 28,10,00,01 ' 1004 320 DATA 30,20,00,01 ' 1008 330 DATA 30,42,00,01 ' 100C 340 DATA 61,42,00,0D ' 1010 350 DATA 30,21,00,01 ' 1014 360 DATA 26,08,86,00 ' 1018 370 DATA 33,29,00,1F ' 101C 380 DATA 28,10,C0,00 ' 1020 390 DATA 28,18,40,00 ' 1024 400 DATA 21,02,06,00 ' 1028 410 DATA 30,42,00,08 ' 102C 420 DATA 71,01,41,F8 ' 1030 430 DATA 24,18,44,00 ' 1034 440 DATA 21,02,06,00 ' 1038 450 DATA 41,00,00,00 ' 103C 460 DATA 39 ' 6809 RTS instruction 470 DATA ### RUN