Whetstones and Fortran

5 views
Skip to first unread message

Dawson Rosell

unread,
Nov 21, 2017, 3:03:07 PM11/21/17
to PDP-12 Restoration Project
Hey everyone,

I have break this week and finally will have a free moment to look at why Whetstones isn't working on simh.

I have made a few changes and got it to compile, but still produces no output.

Does anyone have some insight in to this?  (I attached the rk05 disk image below with the source on it, titled WHET.FT)

Thanks in advance!!!

Dawson
disk2.fortran.rk05

CLASystems

unread,
Nov 21, 2017, 3:18:31 PM11/21/17
to Dawson Rosell, PDP-12 Restoration Project
Can you provide the exact OS/8 commands you used to get this far?

then I can replicate it in SIMH.

The PEPS package is still not quite releasable, mostly a matter of documentation at this point [and protecting me from lawyers!].

But I can run your program and see what happens.

Also, PEPS maintains a complete log file, so  I can edit it down to an extract for all to peruse, etc.

cjl [busy, but I can give a little time to this now; just a dull roar now, only trying to do SIX things at once!].


--
You received this message because you are subscribed to the Google Groups "PDP-12 Restoration Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdp+uns...@d.umn.edu.



--
"In the future, OS/2 will be on everyone's desktop"

Bill Gates, 1992

Dawson Rosell

unread,
Nov 21, 2017, 3:27:03 PM11/21/17
to clasystems, PDP-12 Restoration Project
I am running:

R F4
WHET,WHET,WHET,WHET<WHET.FT/G<ESC>

which actually does produce the following (I forgot about the /G option)

BENCHMARK #2 -- SINGLE PRECISION WHETSTONE (A001)

START YOUR STOPWATCH AND PRESS PRESS CONTINUE SWITCH

USER ERROR MAIN   0045
.
My text about pressing continue was back when I was trying to use the PAUSE command (which I have commented out).

So it's complaining about ISN 0045, which is this:  IF (JJ.EQ.II)CALL POUT(N1,N1,N1,X1,X2,X3,X4)

Thanks for your willingness to help!

Dawson

Peter Peterson

unread,
Nov 27, 2017, 3:02:25 PM11/27/17
to Dawson Rosell, clasystems, PDP-12 Restoration Project
Hi all, 

Just a bump on this one. Anyone have any idea why this is failing?

Thanks very much!

Peter
--
Peter A. H. Peterson, Ph.D.
Assistant Professor
Department of Computer Science
University of Minnesota Duluth

CLASystems

unread,
Nov 27, 2017, 4:53:36 PM11/27/17
to Peter Peterson, Dawson Rosell, PDP-12 Restoration Project

Is it .EQ. or should it be ..EQU. ?

cjl

Virus-free. www.avast.com

Dawson Rosell

unread,
Nov 27, 2017, 9:42:03 PM11/27/17
to clasystems, Peter Peterson, PDP-12 Restoration Project
I tried .EQU. and it spat out:
OP  0035
OP  0051
OP  0051
OP  0061
OP  0061
OP  0062
OP  0062
OP  0067
OP  0067
...

So, it seems .EQ. is correct. I wonder if it has something to do with POUT that gets called on ISN 0061.

The code for POUT is as follows:

SUBROUTINE POUT(N,J,K,X1,X2,X3,X4)
C        IMPLICIT REAL*4 (A-H,O-Z)
        COMMON/PTIME/PTIME,TIME0
        REAL PTIME,TIME1,TIME0,WALLTIME
        TIME1 = WALLTIME()
        PRINT 10, NINT(TIME1-TIME0),NINT(TIME1-PTIME),N,J,K,X1,X2,X3,X4


Looking at this now, it seems WALLTIME() and NINT() are problems. I know WALLTIME() was a function that used different functions for timing the PDP didn't support, so I need to change that. I want to say NINT() was written later and not supported by PDP Fortran (I know gnuFortran supports it)

I will take a look at that.

Any suggestions on how to time the code effectively? Besides pulling out a stopwatch and hitting the start and stop button?

Dawson Rosell

unread,
Nov 28, 2017, 1:01:28 PM11/28/17
to clasystems, PDP-12 Restoration Project
As to assigning results of equivalence to a variable... I actually don't know if they can or not... I will have to do some digging.


On Mon, Nov 27, 2017 at 10:30 PM, CLASystems <clasy...@gmail.com> wrote:
Compatibility issues with different Fortran implementations can be a real bear.

As to the logical operators, I now figured out my own mistake.  AND and NOT are 3-letters while must of the others are 2-letters, quite confusing!

Can Fortran [any of them] assign the result of an equivalence into a variable [and then you can use the T/F of the variable value?

And apparently, the syntax would be .EQ. for that as well.

I never learned Fortran, because back in the day we did PL/I which uses a larger character set among other things.  languages are just enough different to plague you, but version-specific stuff takes it one step further.

The compiler cannot know what the result is of calling a function externally, but as I remember it, the LINKER should complain that it wasn't resolved if it dosn't exist.  If yoiu do not get complaints at that level, there is still no rule that they work the same way.  You cannot trust that a decades-later version implements the same thing at all.  Revisionism is inevitable.  [Not saying what was done back in the day is correct, just that it is reasonable they do not agree with each other!]

cjl

Maury Pepper

unread,
Nov 29, 2017, 2:31:05 AM11/29/17
to p...@d.umn.edu
In case you haven't already figured this out, according to the handbook, USER ERROR means: "Illegal subroutine call, or call to undefined subroutine. Execution continues only if the E option was requested."

A slightly different definition is given elsewhere: "The user tried to reference an entry point of a program which was not loaded, or he failed to define a subscripted variable in a DIMENSION statement."

Dawson Rosell

unread,
Nov 30, 2017, 2:27:03 AM11/30/17
to Maury Pepper, PDP-12 Restoration Project
Thanks for the heads up Maury. I thought it had something to do with the call to POUT in that line (the code is attached in the first email if you are curious).

Has anyone ever had luck with the CLOCK function in simh? (Or on a real machine?) I am confused on how it exactly works and wondering if it's maybe simh that doesn't like the CLOCK function.

I wrote a simple test program that (as far as I know) should work (if I'm calling CLOCK right)
 

        WRITE(4,1)
   1   FORMAT(/' CLOCK TEST')
C
C       START CLOCK
C
        CALL CLOCK(7,60)   
C
C       WASTE TIME
C      
        II = 0
        DO 5 I=1,100
        II = II + 1
        WRITE(4,3)II
   3   FORMAT(I5)
   5   CONTINUE
        CALL TIME(J)
        WRITE(4,2)J
   2   FORMAT(I5)
        END


According to the manual (OS8 Handbook page 8-51) CLOCK works as follows:

Its called as CALL CLOCK(FUNCTN,RATE) where FUNCTN is a combination of numbers from a table to enable different Schmitt triggers or external inputs and RATE is either the number of Hz and specifies the rate of clock interrupts, or its specified by a external rate (I believe).

So I call  CALL CLOCK(7,60), which enables all 3 Schmitt triggers and has clock interrupts at a rate of 60Hz.

When I run this in simh it gets to the printed 'CLOCK TEST' statement, prints it on the screen, and then hangs until I CTRL-C out of it.

Any thoughts?

CLASystems

unread,
Nov 30, 2017, 2:42:30 AM11/30/17
to Dawson Rosell, Maury Pepper, PDP-12 Restoration Project
I sincerely believe SIMH has no implementation of the advanced clock functions, thus any library assuming they DO exist cannot work.

In point of fact, only the KW12 and the DK8E-P clock have those features.  [There are things you can do on the LAB-8/E the -12 cannot do]

cjl

Virus-free. www.avast.com

Dawson Rosell

unread,
Nov 30, 2017, 11:01:08 AM11/30/17
to clasystems, Maury Pepper, PDP-12 Restoration Project
(run it on the PDP-12 because ours has the KW12 option)

On Thu, Nov 30, 2017 at 10:00 AM, Dawson Rosell <rose...@d.umn.edu> wrote:
Ah, that would make sense. 

When I have a chance I'll try and run it on the PDP-12 and make sure I'm using it right.

Thank you!

Dawson Rosell

unread,
Nov 30, 2017, 11:01:24 AM11/30/17
to clasystems, Maury Pepper, PDP-12 Restoration Project
Ah, that would make sense. 

When I have a chance I'll try and run it on the PDP-12 and make sure I'm using it right.

Thank you!
On Thu, Nov 30, 2017 at 1:41 AM, CLASystems <clasy...@gmail.com> wrote:

CLASystems

unread,
Nov 30, 2017, 12:05:39 PM11/30/17
to Dawson Rosell, Maury Pepper, PDP-12 Restoration Project
On Thu, Nov 30, 2017 at 11:00 AM, Dawson Rosell <rose...@d.umn.edu> wrote:
(run it on the PDP-12 because ours has the KW12 option)

​Which one?  [No, they are not all the same, but you likely do have the KW12C with the 3 Schmitt Triggers on it.

cjl​
 

Dawson Rosell

unread,
Dec 1, 2017, 1:29:23 AM12/1/17
to clasystems, Maury Pepper, PDP-12 Restoration Project
I don't recall exactly (haven't had a chance to check), but I believe its the KW12A.

I'm still working on the USER ERROR stuff. It doesn't seem to like calling any sort of subroutine from a logical IF statement i.e. IF(II.EQ.JJ) CALL TEST
Where TEST is a subroutine that reads:
      SUBROUTINE TEST
      WRITE(4,10)
 10 FORMAT(/' THIS IS A TEST')
      RETURN
      END


As far as I've read in the book, this should work... I wonder if it has something to do with how I'm compiling it? (WHET,WHET,WHET<WHET.FT/G$)

Reply all
Reply to author
Forward
0 new messages