Here are my disorganised thoughts about porting Crowther & Woods Adventure from the PDP-10  to the ICL 1900.
  1. The source code format is a bit screwy, it includes FF characters, TAB to seperate the linenumber from the code, the continuation markers are in the wrong column.

    It's pretty easy to fix this on Unix, on George I guess I'll have write a program to read the file from a TR in NORMAL mode and mess around with it.

    A real ICL hardcore programmer would do this in PLAN.   Since I've always been an HLL weenie I'd probably do it in Fortran.  (Or maybe Algol68-R :-)).

  2. In Fortran strings are held in simple variables or arrays in an An format.  "A1" means one character left justfied in the variable or array element followed by enough spaces to fill the variable or element.  "A5" means five characters...

  3. The PDP 10 has 36 bit words, which can hold 5 x 7 bit characters in an INTEGER.

    The ICL1900 has 24 bit words that can hold 4 x 6 bit characters. Normally ICL FORTAN uses two words to hold an INTEGER (to make sure that INTEGER and REAL are the same size) so an INTEGER can hold 8 chars. (FORTRAN can also be compiled in COMPRESS INTEGER AND LOGICAL mode in which case INTEGER only takes one word, 4 chars. )

    Adventure manipulates text input from the user in A5 format. We can read A5 format into an INTEGER (which will contain the 5 characters followed by three spaces).

    (If we compile Adventure in "CIL" either we have to store strings in REAL or we have to use arrays where the existing code uses simple variables.  Adventure does use many integer arrays, so it may be useful to use CIL mode later on.)

  4. Adventure does simple character comparisons like this:
     IF(WD1.EQ.'ENTER'.AND.(WD2.EQ.'STREA'.OR.WD2.EQ.'WATER')
    1       GOTO 2010
        
    Unfortunately when integer values are compared ICL FORTRAN only compares the first word. We can work around this problem by using the standard COMP subroutine or ICOMP function. (Also ICL FORTRAN only allows character constants in DATA statements and as arguments to functions and subroutines).

  5. The routine A5TOI1 converts some words in A5 format to a string in A1 format. We can use the standard COPY subroutine to move things around.

  6. The IFILE routine seems to open the adventure data file on unit 1.  On George we can just assign it before starting the setup run.

  7. The program does some initialisations then does a PAUSE. When users run it it is supposed to restart from the PAUSE. This can be done in exactly the same way on George.

    If the user wants to pause the game he is allowed to save it, this is done in function CIAO, which does a STOP, this should be a PAUSE.

  8. G with no width is used for free format input, ICL FORTRAN uses G0.

    0008           1     FORMAT (G,A5)
    ERROR   182     FIELD WIDTH OMITTED AT ABOUT COLUMN 14, LINE 0008
  9. Output is done by the "TYPE" verb which is trivialy converted to a write:

            TYPE 2,(LINES(I),I=K,L)
    2   FORMAT(' ',14A5)

  10. Input is done in the routine GETIN:
          SUBROUTINE GETIN(WORD1,WORD1X,WORD2,WORD2X)
    C  GET A COMMAND FROM THE ADVENTURER.  SNARF OUT THE FIRST WORD, PAD IT WITH
    C  BLANKS, AND RETURN IT IN WORD1.  CHARS 6 THRU 10 ARE RETURNED IN WORD1X, IN
    C  CASE WE NEED TO PRINT OUT THE WHOLE WORD IN AN ERROR MESSAGE.  ANY NUMBER OF
    C  BLANKS MAY FOLLOW THE WORD.  IF A SECOND WORD APPEARS, IT IS RETURNED IN
    C  WORD2 (CHARS 6 THRU 10 IN WORD2X), ELSE WORD2 IS SET TO ZERO.
    
        
    The code looks pretty specific to 7 bit chars in 36 bit words.  We'll probably have to write our own, which can be simpler as we have the ICOMP function and COPY subroutine to do the nasty parts.

    The DEC code uses ACCEPT to read the keyboard.    We can just use READ.

  11. The DEC routines DATE and TIME are used to get the current date and time in the subroutine DATIME(D,T).
    INTEGER D, T
    CALL DATIME (D, T)
        
    D = number of days since 01-JAN-77, T = Minutes past midnight.

    It looks like we'll need some PLAN to do this, using the GIVE/0 extracode (get time in days since 31 December 1899) and GIVE/11 (get time in seconds since midnight).

  12. The code uses logical operators on INTEGER values, including .XOR. we may need some PLAN to do this. It also uses '"' to introduce octal constants, which we will have to replace by decimals.