DataMuseum.dk

Presents historical artifacts from the history of:

CR80 Hard and Floppy Disks

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CR80 Hard and Floppy Disks

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦3e6aa7b6c⟧ TextFile

    Length: 15968 (0x3e60)
    Types: TextFile
    Names: »URW.I«

Derivation

└─⟦e0c43619c⟧ Bits:30005797 CR80 Disc pack ( Vol:FNJ1 861029/EC CR80 S/W Package II+III+IV+V+VII )
    └─ ⟦this⟧ »CSP004_V0801.D!CSS193.D!URW.I« 

TextFile

"-----------------------------------------------------------------------
"
"  PROJECT:          -
"
"  MODULE NAME:      USER READ WRITE (URW) IMPORT DEFINITIONS
"  MODULE ID NMB:    CSS/193
"  MODULE VERSION:   0202
"  MODULE TYPE:      PREFIX
"  MODULE FILES:     URW.I
"  PREFIX FILES:     -  (UTH.I MUST BE INCLUDED IN SOURCE)
"
"  SPECIFICATIONS:   NONE
"  AUTHOR/DATE:      MJO/860116
"
"  DELIVERABLE:      YES
"  SOURCE LANGUAGE:  SWELL
"  COMPILE COMPUTER: CR80
"  TARGET COMPUTER:  CR80
"  OPER. SYSTEM:     AMOS/XAMOS/MXAMOS
"
"  SPECIAL INFO:     URW.COMP.I IS A COMPRESSED VERSION OF URW.I
"                               WITH ALL COMMENTS LEFT OUT.
"
"-----------------------------------------------------------------------
"
"  CHANGE RECORD
"
"  VERSION    AUTHOR/DATE    DESCRIPTION OF CHANGE
"  -------    -----------    ---------------------
"  0101       CSL/850304     INITIAL RELEASE
"  0102       CSL/850711     READUSERPARAMSEXT INTRODUCED
"  0103       CSL/850904     KEYWORDSIZE CHANGED TO TWO BYTES
"  0201       CSL/850916     FILE CREATION INTRODUCED
"  0202       MJO/860116     FIRST SCL-RELEASE
"
"-----------------------------------------------------------------------
%PAGE

" ERROR CODE DEFINITIONS "
" IMPORT " CONST
  INIT1TROUBLES= #F1;
  INIT2TROUBLES= #F2;
  URW_ERROR_IN_IDENTIFIER= #F3;
  URW_ERROR_IN_NUMBER= #F4;
  URW_OVERFLOW_IN_NUMBER= #F5;
  URW_UNDEFINED_FUNCTION= #FF;
  URW_ERR_IN_CRE_PRM= #F7;

" IMPORT " CONST           "BIT NUMBERS WHEN CREATE FILE"
  URW_READ_FILE_AT = 0;    "TRY TO READ FILE ATTR FROM STREAM"
  URW_DEF_FILE_AT  = 1;    "DEFAULT FILE ATTRIBUTES PROVIDED"
  URW_OUT_FILE_CRE = 2;    "WRITE ON CURRENT OUTPUT IF CREATED"

" IMPORT " TYPE
  INOUT=
    RECORD
      XFLAG      :BOOLEAN;
      XFILETYPE  :FILETYPE;
      OLDADDRESS :POINTER;
      PRIMARYADD :POINTER;
      MODE       :INTEGER;
      FLUSHING   :BOOLEAN;
    END;

" IMPORT " TYPE
WRITE_FUNCTION =         " R6 ALWAYS,  CALL:<LINK> EXIT:<COMPLETION_CODE>
                         "      R1 AT                      R2 AT
                         "  CALL             EXIT     CALL         EXIT
                         "
 (WRITE_CLOSE,           "    -              KEPT       -          KEPT
  WRITE_OPEN,            "  @<FILETYPE>      KEPT       -          KEPT
  WRITE_RESET,           "    -              KEPT       -          KEPT
  WRITE_GETPOS,          "  @<LONG-RESULT>   KEPT       -          KEPT
  WRITE_SETPOS,          "  @<LONG-VALUE>    KEPT       -          KEPT
  WRITE_GETINF,          "  <FILE-INF-TYPE> <INFO-LEAST> -      <INFO-MOST>
  WRITE_FLUSH,           "    -              KEPT       -          KEPT
  WRITE_NOFLUSH,         "    -              KEPT       -          KEPT
  WRITE_ONE_FLUSH,       "    -              KEPT       -          KEPT
  WRITE_SPARE1,          "    ?               ?         ?           ?
  WRITE_SPARE2,          "    ?               ?         ?           ?

  WRITE_LINE,            "  @<LINE>(MAX 80)  KEPT       -          KEPT
  WRITE_RECORD,          "  @<RECORD>        KEPT   <LENGH-IN BYTES> KEPT
  WRITE_DECIMAL,         "  <VALUE>          KEPT   <FIELD-WIDTH>  KEPT
  WRITE_DECIMAL_PAD,     "  <VALUE>          KEPT   <WIDTH,PADCHR> KEPT
  WRITE_LONG_DECIMAL,    "  @<VALUE>         KEPT   <FIELD-WIDTH>  KEPT
  WRITE_LONG_DECIMAL_PAD,"  @<VALUE>         KEPT   <WIDTH,PADCHR> KEPT
  WRITE_HEXA,            "  <VALUE>          KEPT       -          KEPT
  WRITE_HEXA_PAD,        "  <VALUE>          KEPT   <PAD-CHAR>     KEPT
  WRITE_LONG_HEXA,       "  @<VALUE>         KEPT       -          KEPT
  WRITE_LONG_HEXA_PAD,   "  @<VALUE>         KEPT   <CHR-M,CHR-L>  KEPT
  WRITE_NEWLINE,         "    -              KEPT       -          KEPT
  WRITE_NEWLINES,        "  <NO-OF-NEWLINES> KEPT       -          KEPT
  WRITE_SPACES,          "  <NO-OF-SPACES>   KEPT       -          KEPT
  WRITE_FORMFEED,        "    -              KEPT       -          KEPT
  WRITE_BYTE,            "  <BYTE-VALUE>     KEPT       -          KEPT
  WRITE_TEXT,            "  @<BASE-REL-TEXT> KEPT       -          KEPT
  WRITE_TEXT_P);         " @<PROG-REL-TEXT> or 0 KEPT   -          KEPT
                         " If R1=0 the string is expected to be defined
                         " just after the procedure in quotes


" IMPORT " TYPE
READ_FUNCTION =          " R6 ALWAYS,  CALL:<LINK> EXIT:<COMPLETION_CODE>
                         "      R1 AT                      R2 AT
                         "  CALL             EXIT     CALL         EXIT
                         "
 (READ_CLOSE,            "    -              KEPT       -          KEPT
  READ_OPEN,             "  @<FILETYPE>      KEPT       -          KEPT
  READ_RESET,            "    -              KEPT       -          KEPT
  READ_GETPOS,           "  @<LONG-RESULT>   KEPT       -          KEPT
  READ_SETPOS,           "  @<LONG-VALUE>    KEPT       -          KEPT
  READ_GETINF,           "  <FILE-INF-TYPE> <INFO-LEAST> -      <INFO-MOST>
  DUM_FL,                "    -              KEPT       -          KEPT
  DUM_NOFL,              "    -              KEPT       -          KEPT
  DUM_ONEFL,             "    -              KEPT       -          KEPT
  READ_SPARE1,           "    ?               ?         ?           ?
  READ_SPARE2,           "    ?               ?         ?           ?

  READ_LINE,             "  @<LINE>(MAX 80)  KEPT       -       <NO-OF-CHR>
  READ_RECORD,           "  @<RECORD>        KEPT   <NO-OF-BYTES> UPDATED
  READ_NUMBER,           "  @<RESULT>      <RESULT>     -          KEPT
  READ_LONG_NUMBER,      "  @<RESULT>        KEPT       -          KEPT
  READ_HEXA,             "  @<RESULT>      <RESULT>     -          KEPT
  READ_LONG_HEXA,        "  @<RESULT>        KEPT       -          KEPT
  READ_HEXINT,           "  @<RESULT>      <RESULT>     -          KEPT
  READ_LONG_HEXINT,      "  @<RESULT>        KEPT       -          KEPT
  READ_IDENTIFIER,       "  @<RESULT>        KEPT       -       <NO-OF-CHR>
  READ_CMD,              "  @<RECORD>        KEPT  <MAX-NO-OF-CHR> UPDATED
  READ_BACKSPACE,        "    -              KEPT       -          KEPT
  READ_DONOT_CARES,      "  <NO-OF-BYTES>    KEPT       -          KEPT
  READ_BYTE,             "
  READ_SKIP_BLANKS);     "    -              KEPT       -          KEPT

%PAGE

CONST   " SHORTFORM COMMANDS MAY BE USED WHEN CONVENIENT "

  " GENERAL COMMANDS FOR BOTH READ AND WRITE "
  RWCLOSE  =  WRITE_CLOSE;     " = READ_CLOSE   "
  RWOPEN   =  WRITE_OPEN;      " = READ_OPEN    "
  RWRESET  =  WRITE_RESET;     " = READ_RESET   "
  RWGETPOS =  WRITE_GETPOS;    " = READ_GETPOS  "
  RWSETPOS =  WRITE_SETPOS;    " = READ_SETPOS  "
  RWGETINF =  WRITE_GETINF;    " = READ_GETINF  "
  RWFL     =  WRITE_FLUSH;     " = DUM_FL       "
  RWNOFL   =  WRITE_NOFLUSH;   " = DUM_NOFL     "
  RW1FL    =  WRITE_ONE_FLUSH; " = DUM_ONEFL    "
  RWSPARE1 =  WRITE_SPARE1;    " = READ_SPARE1  "
  RWSPARE2 =  WRITE_SPARE2;    " = READ_SPARE2  "

  " COMMANDS FOR WRITE "
  WLINE    =  WRITE_LINE;
  WREC     =  WRITE_RECORD;
  WDEC     =  WRITE_DECIMAL;
  WDECP    =  WRITE_DECIMAL_PAD;
  WLDEC    =  WRITE_LONG_DECIMAL;
  WLDECP   =  WRITE_LONG_DECIMAL_PAD;
  WHEX     =  WRITE_HEXA;
  WHEXP    =  WRITE_HEXA_PAD;
  WLHEX    =  WRITE_LONG_HEXA;
  WLHEXP   =  WRITE_LONG_HEXA_PAD;
  WNL      =  WRITE_NEWLINE;
  WNLS     =  WRITE_NEWLINES;
  WSPS     =  WRITE_SPACES;
  WFF      =  WRITE_FORMFEED;
  WBYTE    =  WRITE_BYTE;
  WTEXT    =  WRITE_TEXT;
  WTEXTP   =  WRITE_TEXT_P;

  " COMMANDS FOR READ "
  RLINE    =  READ_LINE;
  RREC     =  READ_RECORD;
  RNUM     =  READ_NUMBER;      " LOGIC EQUIVALENT TO READ_HEXA "
  RLNUM    =  READ_LONG_NUMBER; " LOGIC EQUIVALENT TO READ_LONG_HEXA "
  RHEX     =  READ_HEXINT;
  RLHEX    =  READ_LONG_HEXINT;
  RIDENT   =  READ_IDENTIFIER;
  RCMD     =  READ_CMD;
  RBS      =  READ_BACKSPACE;
  RDNC     =  READ_DONOT_CARES;
  RBYTE    =  READ_BYTE;
  RSB      =  READ_SKIP_BLANKS;
%PAGE

IMPORT VAR
  INFILETYPE: FILETYPE;          "INPUT FILE DESCR
  OUTFILETYPE: FILETYPE;         "OUTPUT FILE DESCR
  URW_SAVE: REGISTERS;
  PROG_NAME: FILE_NAME;          "FILENAME FOR THIS PROGRAM
  URW_I_OPEN: BOOLEAN;           "FALSE <=> I = CIN
  URW_O_OPEN: BOOLEAN;           "FALSE <=> O = COUT

%PAGE


%PAGE
IMPORT PROCEDURE COMPAREBYTES
"==========================="
                      (R0;  " NO OF BYTES
                       R4;  " WORD ADDRESS OF FIRST REC.
                       R5;  "  -      -    -  SECOND REC.
                       R6); " LINK(AT CALL)
                            " IF STRINGS EQUAL THEN TRUE ELSE FALSE
                            " (AT RETURN).
"COMPARE TWO STRINGS OF BYTES
"A 'DEL' MATCHES ALL CHAR
%PAGE

IMPORT PROCEDURE GET_AND_CON_FILE
"==============================="
               (R1;  " ADDRESS FILETYPE FOR READ
                R2;  " ADDRESS FILETYPE NEW
                R3;  " RETURN IF ERROR BOOLEAN (FALSE => TERMINATE)
                R4;  " HOW TO CREATE INTEGER  (CALL)
                     " FILE CREATED BOOLEAN (TRUE = CREATED) (RETURN)
                R5;  " ADDRESS AREA/ALLOCATION SIZE (IF DEFAULT ALLOWED)
                R6); " LINK (CALL)
                     " RESULT (RETURN):
" READ A FILE_ID, (CREATE IT) AND OPEN IT.
" THE STREAM FOR READ IS EXPECTED TO BE POSITIONED
" JUST BEFORE A FILE_ID AND WILL BE LEFT EITHER AT THE FIRST
" CHAR AFTER THE FILEID OR AT THE FIRST BLANK AFTER THE FILE-ID
" DEPENDING ON THE 'HOW TO CREATE' PARAMETER.
"
" PARAMETER DESCRIPTION:
"
" RETURN IF ERROR:
"                      IF THE BOOLEAN IS TRUE EVENTUAL ERRORS
" ARE RETURNED WITH THE COMPLETIONCODE  IN R6, OTHERWISE THE
" PROGRAM WILL BE TERMINATED WITH AN APPROPRIATE ERRORMESSAGE.
"
" HOW TO CREATE: (ATT CALL)
"                      IF 0 = FALSE NO CREATION WILL BE TRIED
" IF THE BIT 'URW_READ_FILE_AT' IS SET THE STREAM WILL BE SCANNED
" FOR ATTRIBUTE PARAMETERS WITH FORMAT: <file-id>(<type>/<size>)
" (NO SPACES ALLOWED IN THE FORMAT), AND IF THE FILE IS NOT FOUND
" IT WILL BE CREATED WITH THE READ PARAMETERS.
"
" IF THE BIT 'URW_DEF_FILE_AT' IS SET THE UPPER BYTE IN
" 'HOW TO CREATE' IS SUPPOSED TO CONTAIN THE TYPE AS THE CHAR
" 'R', 'C' OR 'D' FOR RANDOM,CONTIGUOUS OR DIRECTORY AND THE
" PARAMETER AREA/ALLOCATION SIZE MUST BE A POINTER TO AN INTEGER
" OR LONG, (IF 'R' OR 'D' THE AREA SIZE (INTEGER), IF 'C' THE
" ALLOCATION SIZE (LONG) ).
" IF BOTH BITS ARE SET THE READ IS TRIED FIRST AND IF NO ATTEMPT
" HAS BEEN MADE TO DEFINE THE FILE THE DEFAULT IS USED
"
" IF THE BIT 'URW_OUT_FILE_CRE' IS SET A MESSAGE 'FILE <FILENAME>
" CREATED IS SENT TO CURRENT OUTPUT IF IT HAPPENS.
"
" HOW TO CREATE: (ATT RETURN)
"                      IF 1 (= TRUE) THEN A FILE IS CREATED.
%PAGE
IMPORT PROCEDURE READUSERPARAMS(R6); "ALL REGISTERS DESTROYED
"============================"
" READ USER SPECIFIED PARAMETERS: 'I' AND 'O'.
" THE FILES ARE OPENED. IS ONE OR BOTH PARAMETERS
" ABSENT, THE FILEDESCRIPTORS ARE ASSOCIATED WITH
" CIN AND COUT RESPECTIVELY.

%PAGE
IMPORT PROCEDURE READUSERPARAMSEXT
"--------------------------------"
          (EXTERNAL_KEY_PROCEDURE: POINTER; "POINTER TO KEYWORD PROCEDURE
           R6);                    "LINK     ALL REGISTERS DESTROYED
"READ THE PARAMETERS AS IN READUSERPARAMS WITH FOLLOWING EXTENSION
" IF AN UNKNOWN KEYWORD IS MET THE USER SPECIFIED PROCEDURE
" WITH PROGRAM RELATIVE ADDRESS IN EXTERNAL_KEY_PROCEDURE IS CALLED.
" PARAMETERS AT CALL ARE  R1: THE KEYWORD MET (2 BYTE SIGNIFICANCE)
"                         R4: STREAM FOR PARAMETERFILE (PFILETYPE.S)
"                         R6: LINK
" REGISTERCONTENTS EXPECTED AT EXIT R0-R5: INDIFFERENT
"                                   R6   : COMPLETION CODE
"                                   R7   : INDIFFERENT
" THE EXTERNAL PROCEDURE IS EXPECTED TO TREAT THE KEYWORD AND
" READ THE EVENTUAL CONTENTS TO THIS KEYWORD FROM THE PARAMETERSTREAM
" AND RETURN TO CALLER FOR FURTHER NORMAL TREAT WITH THE PARAMETERSTREAM
" POSITIONED AFTER THE LAST BYTE CONNECTED TO THIS KEYWORD (IT ISN'T
" NECESSARY TO BACKSPACE THE STREAM IF ONLY BLANK OR <EOF> IS SKIPPED).
" IF THE COMPLETION CODE ISN'T ZERO AT EXIT READUSERPARAMSEXT WILL
" EXECUTE THE TERMINATION 'PARAMETER FILE ERROR  ILLEGAL KEYWORD'
" WITH R6 AS COMPLETION CODE.
" P.S IF THE PROCEDURE IS CALLED WITH A ZERO AS POINTER IT WILL SUPPLY
" A DUMMY PROCEDURE TO MAKE IT POSSIBLE TO GET THE 'I' AND 'O'
" PARAMETERS AND AT A LATER STATE INTERPRET THE PARAMETER FILE
" WITH THE 'READ_PARM' PROCEDURE.
" EXAMPLE:
"         PROCEDURE TREATKEYWORD(R1,R6);  R1:KEYWORD R6:LINK, CC_CODE
"         VAR
"           LINK:INTEGER;
"         BEGIN
"           R6 => LINK;
"           <TREAT THE KEYWORD AND SET THE CC_CODE IN R6>
"           EXIT(LINK);
"         END;
" WHEN YOU CALL THE READUSERPARAMSEXT THE CALL WOULD BE:
"         READUSERPARAMSEXT(LOCATION(TREATKEYWORD),R6);

%PAGE

IMPORT PROCEDURE REALREADWRITE
"-----------------"
                        (R1;                "Address/Number.
                         R2;                "Evenualy second parameter
                         R5;                "Pointer to INOUT record.
                         R6);               "Call: Link
                    "THIS PROCEDURE WILL NEVER RETURN TO CALLER
                    "BUT WILL EXIT VIA THE GLOBAL SAVEAREA URW_SAVE[6]
                    "TO THE ORIGINAL CALLER IMMEDIATELY


"general current output stream WRITE routine. ( COUT:<file-name> )
" EXAMPLE:  WRITE(WRITE_TEXT, ADDRESS('THIS TEST.(:0:)') => R1, R2, R6);
" This will print the text: THIS TEST. on current output.

IMPORT PROCEDURE WRITE
"--------------------"
                     (function: INTEGER; "function code
                      r1;                "address/number.
                      r2;                "not used or length.
                      r6);               "call: LINK
                                         "return: CC.

"general output stream WRITE routine. ( O:<file-name> )
IMPORT PROCEDURE WRITE_OUT
"------------------------"
                         (function: INTEGER; "function code
                          r1;                "address/number.
                          r2;                "not used or length.
                          r6);               "call: LINK
                                             "return: CC.

"general current input stream READ routine. ( CIN:<file-name> )
IMPORT PROCEDURE READ
"--------------------"
                     (function: INTEGER; "function code
                      r1;                "address/number.
                      r2;                "not used or length.
                      r6);               "call: LINK
                                         "return: CC.

"general input stream READ routine. ( I:<file-name> )
IMPORT PROCEDURE READ_IN
"-----------------------"
                        (function: INTEGER; "function code
                         r1;                "address/number.
                         r2;                "not used or length.
                         r6);               "call: LINK
                                            "return: CC.

"general input stream READ routine. ( PARAMETER-FILE )
IMPORT PROCEDURE READ_PARM
"-------------------------"
                        (function: INTEGER; "function code
                         r1;                "address/number.
                         r2;                "not used or length.
                         r6);               "call: LINK
                                            "return: CC.

"general input stream READ routine. ( CURRENT-DIRECTORY-FILE )
IMPORT PROCEDURE READ_DIR
"------------------------"
                        (function: INTEGER; "function code
                         r1;                "address/number.
                         r2;                "not used or length.
                         r6);               "call: LINK
                                            "return: CC.

%PAGE
 «a5»