• Please review our updated Terms and Rules here

Running MTREK on the VAX

daver2

10k Member
Joined
Jun 19, 2012
Messages
14,402
Location
UK - Worcester
Ok, I can understand the IOFC codes (apart from the TIMEOUT/AFTER3). I am not expecting to see that value displayed?

Previously, the value of the timeout was -1. Looking at the RATFOR source, the timeout bit shouldn't be set. Looking at the FORTRAN source, the timeout bit shouldn't be set either...

The GOTO 2120 should be executed.

Dave
 

daver2

10k Member
Joined
Jun 19, 2012
Messages
14,402
Location
UK - Worcester
Code:
      IF (.NOT.(TIMOUT .GE. 0)) GOTO 2120
        P3 = TIMOUT
      IOFC = IOFC .OR. %LOC(IO$M_TIMED)
        GOTO 2130
2120  CONTINUE
        P3 = 0
2130  CONTINUE

If TIMOUT is -1 then (TIMOUT .GE. 0) should be FALSE.

.NOT.(.FALSE.) should be TRUE.

Therefore IF (TRUE) GOTO 2120 should be executed.

As a result, P3 should be set to 0; IOFC should not have the ...TIMED flag set; and (from your listing above) the AFTER3= text should not be displayed.

Is there something I am misunderstanding here?

Dave
 

vaxorcist

Experienced Member
Joined
Apr 26, 2012
Messages
96
Location
Germany
It depends on your choice when you choose the vessel.
a) If you choose a vessel not chosen before, TIMOUT=0
b) If you choose a vessel already chosen before, TIMOUT=-1

I saw that only now.

The following vessels are available for use.
Ship 1
Ship 2
Ship 3
Ship 4
Ship 5
Ship 6
Ship 7
Ship 8
Enter the number of the vessel you wish to command:2
routine break at INCHAR
DBG>exa timout
INCHAR\TIMOUT: 0

The following vessels are available for use.
Ship 1
Ship 3
Ship 4
Ship 5
Ship 6
Ship 7
Ship 8
Enter the number of the vessel you wish to command:2

This ship already has a commander.
Do you wish to share this command?
routine break at INCHAR
DBG>ex timout
INCHAR\TIMOUT: -1

DBG>

The following code works as you expected. I stepped forward and it jumped to 2120 in case of TIMOUT=-1 .
I hope I did not send you rubbish ...
Ulli
 

daver2

10k Member
Joined
Jun 19, 2012
Messages
14,402
Location
UK - Worcester
Ok, we did have two separate posts, so I did assume that they were connected - but not so...

No problem...

In that case, have you got a DEC document that describes what the values of the integers are that map onto the symbols used to create IOFC and the ISW return value?

If not, you could add a WRITE statement to print them all out. Let's see if we can make sense of the values shall we?

I would be especially interested in what SS$_NORMAL is, and whether it equates to an ISW value of 316 or not. If not, we would need to know how to decode the return value of 316 to see what the code is telling us...

Dave
 

vaxorcist

Experienced Member
Joined
Apr 26, 2012
Messages
96
Location
Germany
Have a look at the manuals.
Unfortunately the relevant manuals for VMS V3.x are not available, but I'm quite sure there's not much of a difference.

Ulli
 

daver2

10k Member
Joined
Jun 19, 2012
Messages
14,402
Location
UK - Worcester
So, first off, a value of 316 (decimal) is 0001 0011 1100 (binary).

The least significant three bits (100 binary = 4 decimal) indicates the severity of the return and a value of 4 (decimal) means a "severe error"!

Table 1-4 (page 1-21) of the VAX/VMS I/O User's Guide indicates the symbolic names of the status flags that could be returned from the $QIOW call. I can't, however, see the numerical values of these status flags. Perhaps you could WRITE out the values of these in a dummy FORTRAN program?

Clearly, the QIOW call is getting upset for some reason. It is trying very hard to tell us why (if we can understand it)...

Dave
 

vaxorcist

Experienced Member
Joined
Apr 26, 2012
Messages
96
Location
Germany
I used:
C
EXTERNAL SS$_NORMAL,SS$_ACCVIO,SS$_EXQUOTA,SS$_ILLEFC
*,SS$_INSFMEM,SS$_IVCHAN,SS$_NOPRIV,SS$_UNASEFC,SS$_ABORT
*,SS$_INSFARG,SS$_ILLSER
TYPE *,' SS$_NORMAL =',%LOC(SS$_NORMAL)
TYPE *,' SS$_ACCVIO =',%LOC(SS$_ACCVIO)
TYPE *,' SS$_EXQUOTA=',%LOC(SS$_EXQUOTA)
TYPE *,' SS$_ILLEFC =',%LOC(SS$_ILLEFC)
TYPE *,' SS$_INSFMEM=',%LOC(SS$_INSFMEM)
TYPE *,' SS$_IVCHAN =',%LOC(SS$_IVCHAN)
TYPE *,' SS$_NOPRIV =',%LOC(SS$_NOPRIV)
TYPE *,' SS$_UNASEFC=',%LOC(SS$_UNASEFC)
TYPE *,' SS$_ABORT =',%LOC(SS$_ABORT)
TYPE *,' SS$_INSFARG=',%LOC(SS$_INSFARG)
TYPE *,' SS$_ILLSER =',%LOC(SS$_ILLSER)
C

END

and got:
$ run wristat
SS$_NORMAL = 1
SS$_ACCVIO = 12
SS$_EXQUOTA= 28
SS$_ILLEFC = 236
SS$_INSFMEM= 292
SS$_IVCHAN = 316
SS$_NOPRIV = 36
SS$_UNASEFC= 564
SS$_ABORT = 44
SS$_INSFARG= 276

SS$_ILLSER = 260

So we have: "an invalid channel number was specified in an I/O request"

Ulli
 

daver2

10k Member
Joined
Jun 19, 2012
Messages
14,402
Location
UK - Worcester
That makes sense as the call to invoke IOINIT had been commented out (see post #9) and I was wondering how the I/O channel number had been defined...

I was wondering if it defaulted to something. Maybe not, but that begs the question of why this worked in the first place... Or didn't it?

Dave
 

vaxorcist

Experienced Member
Joined
Apr 26, 2012
Messages
96
Location
Germany
Removing the comment and recompiling/relinking results in:

Code:
$ MC MTREK

Welcome to MULTI-TREK.

The following vessels are available for use.
Ship 1
Ship 2
Ship 3
Ship 4
Ship 5
Ship 6
Ship 7
Ship 8
Enter the number of the vessel you wish to command:1
                        .                                   .
   Energy   :  9950.0                                                 Scores
   Shields  :     0.0
                                                                    1       0. *
   Warp     :    0.00                                               2       0.
   Course   :    3.00                                               3       0.
                                  *                                 4       0.
   X co-ord :    77.5                                               5       0.
   Y co-ord :    81.5                     1                 *       6       0.
                            6                                       7       0.
   Torps    :       9                                               8       0.
   Seekers  :       4
   Hyper    :       3
                                                                    Scan:     1
   Def Ship :       1                           H         *         Dir :  3.00
   Def Direc:    3.00             *                                 Dist:  0.00
                                                                    Sect:  7, 8
                        .                                   .
B  BEAMS                    M  SEND MESSAGE          T  FIRE TORPEDOES
C  COURSE HEADING           N  FREEZE ANTI-MATTER    W  SET WARP SPEED
F  FADE/APPEAR (CLOAKING)   P  FIRE PHASERS          X  DETONATE ANTI-MATTER
H  HYPERSPACE SETTING       Q  QUIT                  Z  LAUNCH ANTI-MATTER
K  FIRE HOMING TORPEDO      R  RESET DISPLAY         V  VERBOSE ON/OFF
L  LOCATE SHIP              S  SHIELD CHANGE         E  ENERGY NETS ON/OFF

I think we've got it !!!
Now I'll study the game manual how to play it.

Thank you ever so much!

Ulli
 

daver2

10k Member
Joined
Jun 19, 2012
Messages
14,402
Location
UK - Worcester
Excellent!

Interestingly, TERMINAL.RAT has all of this stuff not commented out - but TERMINAL.FOR has it commented out...

Play time :)...

Dave
 

tradde

Veteran Member
Joined
Apr 30, 2003
Messages
2,137
Location
Katy, Tx
Maybe someone was trying to make this run on something else and commented those out? I can think of no other reason to comment those lines out if they were
doing this on a Vax.
 

daver2

10k Member
Joined
Jun 19, 2012
Messages
14,402
Location
UK - Worcester
The $TRNLOG call converts the logical name "SYS$INPUT" into a physical device name stored in buffer PNAM and returns the length in ILEN.

The $ASSIGN call converts the physical device name (as stored in PNAM) into an I/O channel (in ICHNL).

If this is not done, ICHNL will (at best) be invalid and at worst refer to some random device.

It is easy when you have worked it out...

Dave
 
Top