Floating point math in FORTRAN IV on PDP-8

mark at wickensonline.co.uk mark at wickensonline.co.uk
Thu Sep 20 00:12:00 CDT 2018


Hi Kyle 

Just out of interest I ran this on VAX Fortran (Compaq Fortran 77 6.6-201) and I think got the results expected:

$ type for004.dat
    1.000000    1.000000    0.000000
    2.000000    1.414214    0.693147
    3.000000    1.732051    1.098612
    4.000000    2.000000    1.386294
    5.000000    2.236068    1.609438
...
   98.000000    9.899495    4.584968
   99.000000    9.949874    4.595120
  100.000000   10.000000    4.605170

However, I am no Fortran expert!

Regards, Mark.

-----Original Message-----
From: cctalk <cctalk-bounces at classiccmp.org> On Behalf Of Kyle Owen via cctalk
Sent: Wednesday, September 19, 2018 11:44 PM
To: General Discussion: On-Topic and Off-Topic Posts <cctalk at classiccmp.org>
Subject: Floating point math in FORTRAN IV on PDP-8

At VCF MW this past weekend, I was playing around with an FPP8/A stuffed into a PDP-8/M with a fan removed. This hex-wide two-board set will happily work in a quad-wide backplane, as it needs no signals that an 8/A would otherwise provide.

I wanted to benchmark the FPP8/A with the software emulation that FORTRAN IV supposedly does. Mind you, I also don't have an EAE in mine, so software emulation for integer multiplication/division would also be used.

I tried running a simple program to print some natural logs and square roots, which ran quite well with the FPP8/A in place.

Without the FPP8/A...all of the results were wrong. Significantly. Negative numbers in many cases. No clear pattern as to what it's doing.

Would anyone be able to try my program on some other real hardware (or another emulator) to verify? With and without EAE would also be desirable.
I'm not sure how to disable the EAE in SIMH, else I'd try that too.

Here's what SIMH looks like with my program:

PDP-8 simulator V4.0-0 Current        git commit id: d35b8725
sim> at rk0 disk2.fortran.rk05
sim> b rk

.TYPE FLOAT.FT
      DO 50 I=1,100
      F = FLOAT(I)
      G = SQRT(F)
      H = ALOG(F)
      WRITE(4,100) F,G,H
50    CONTINUE
100   FORMAT(' ',F12.6,F12.6,F12.6)
      END

.R F4
*FLOAT/G$
    1.000002    1.000002    0.000000
    2.000002    1.414215    0.693147
    3.000002    1.732053    1.098614
    4.000002    2.000002    1.386296
    5.000002    2.236070    1.609439
[snip]
   98.000001    9.899495    4.584968
   99.000000    9.949874    4.595121
  100.000023   10.000008    4.605171

.

Much appreciated,

Kyle



More information about the cctech mailing list