Trailing-Edge
-
PDP-10 Archives
-
de-10-omona-v-mc9
-
rsxttl.mac
There are 5 other files named rsxttl.mac in the archive. Click here to see a list.
;<2BELANGER>RSXTTL.MAC.3, 10-Nov-76 12:09:46, EDIT BY BELANGER
SUBTTL 15-NOVEMBER-1976, T. C. PORCHER/TCP/RAB
;COPYRIGHT (C) 1976, DIGITAL EQUIPMENT CORP., MAYNARD MASS. 01754 ***
;
; TOPS==10 ; ASSEMBLE FOR TOPS-10
;
IFNDEF TOPS, <TOPS==20> ; DEFAULT IS TOPS-20
;
VWHO==0
VMAJOR==3 ; MAJOR VERSION
VMINOR==0 ; MINOR VERSION
VEDIT==36 ; EDIT NUMBER
;
DEFINE TTLMAC (A,B,C)<
TITLE RSXT'A -- TOPS-A FILE CONVERSION PROGRAM V. B(C)>
;
TTLMAC \TOPS,\VMAJOR,\VEDIT
;
DEFINE VERSION (A,B,C,D)<
BYTE (3)A (9)B (6)C (18)D>
;
SYN IFE,IF
SEARCH MACSYM
;
IF TOPS-20, <
.REQUIRE SYS:MACREL
SEARCH MONSYM
> ; END CONDITIONAL ON TOPS-20
IF TOPS-10, <
SEARCH UUOSYM
> ; END CONDITIONAL ON TOPS-10
;
SALL
ifdef .psect,<
.direct flblst>
ifndef .psect,<
.direct .xtabm>
SUBTTL DEFINITIONS
F= 0 ;FLAGS:
F.IBCR==1B0 ;MODE IS IMBEDDED <CR><LF>
F.IPCR==1B1 ; . . IMPLIED <CR><LF>
F.TIBC==1B2 ;THIS FILE IS IMBEDDED <CR><LF> *** CANNOT BE 1B0 ***
F.ADDR==1B3 ;ADDRESS WORDS EXIST
F.NO== 1B4 ;"NO" WAS TYPED BEFORE COMMAND
F.TEMP==1B5 ;TEMPORARY OUTPUT FILES
F.RSCN==1B6 ;RESCAN COMMAND IN PROGRESS
F.EXIT==1B7 ;EXIT WHEN DONE WITH COMMAND (RESCAN)
F.IGNR==1B8 ;IGNORE FILE FORMAT ERRORS
F.LFSS==1B9 ;CONVERT LF TO SINGE SPACE
F.TLFS==1B10 ;TEMP SAME *** CANNOT BE 1B0 ***
F.CRMA==1B11 ; PROCESSING CRAM ADDRESS FLAG
F.TTEM==1B12 ;TEMPORARY TEMPORARY OUTPUT FILES
F.CMND==1B18 ; TOPS-10 "TAKE" PROCESS
F.PPN==1B19 ; LOOKING FOR A PPN
F.IBHM==1B20 ; INPUT BYTE HEADER MODIFIED
F.OBHM==1B21 ; OUTPUT BYTE HEADER MODIFIED
;
T1= 1 ;TEMP REGISTERS
T2= 2 ; . .
T3= 3 ; . .
T4= 4 ; . .
;
P1= 5 ;GENERAL STORAGE REGISTERS
P2= 6 ; . .
P3= 7 ; . .
P4= 10 ; . .
;
C= 11 ;RANDOM CHARACTERS
IC= 12 ;TEMP INPUT CHARACTER BUFFER FOR 8-BIT BYTES
OC= 13 ; . . OUTPUT . .
;
IM= 14 ;INPUT FILE MODE (CONVERT)
OM= 15 ;OUTPUT . .
;
P= 17 ;PDL POINTER
;
IF TOPS-10, <
;
; DEFINE THE I/O CHANNELS FOR TOPS-10
;
TTYCH==0 ; TELETYPE CHANNEL
CMDCH==1 ; COMMAND FILE CHANNEL
INCH==2 ; INPUT FILE CHANNEL
OUTCH==3 ; OUTPUT FILE CHANNEL
;
LE.NAM==0 ; OFFSET FOR FILENAME
LE.ERR==1 ; OFFSET FOR RETURNED ERROR CODE
LE.EXT==1 ; OFFSET FOR EXTENSION
LE.DAT==2 ; OFFSET FOR RETURNED DATE
LE.PPN==3 ; OFFSET FOR PPN
LE.PPS==4 ; OFFSET FOR SAVED PPN
> ; END CONDITIONAL ON TOPS-10
SUBTTL MACRO DEFINITIONS AND OPDEFS
DEFINE ERR (MSG),<
JRST [ HRROI P1,TXTPTR<MSG>
JRST CMDERR]
>
;
DEFINE ERRJ (MSG),<
IFNB <MSG>,<
JRST [ HRROI T2,<TXTPTR (<MSG>)>
JRST CMDERJ]
>
IFB <MSG>,<
JRST CMDJSE
>
>
DEFINE ERRI(MSG,GOTO),<
JRST [ HRROI P1,TXTPTR<MSG>
CALL CMDERI
JRST GOTO]
>
;
DEFINE TB(DATA,TEXT),<XWD [ASCIZ\TEXT\],DATA>
DEFINE TXTPTR(TEXT),<XWD -1,[ASCIZ\TEXT\]>
;
OPDEF CALL [PUSHJ P,]
OPDEF CALLR [JRST]
OPDEF RETURN [POPJ P,]
DEFINE RETSKP,<JRST CRET1>
DEFINE CALLRX (WHERE),<IF2,<IFN <.-WHERE>,<PRINTX ? CALLRX WHERE NOT VALID>>>
SUBTTL IMPURE DATA
;
IF TOPS-10, <
.JBVER==137 ; TOPS-10 VERSION
LOC .JBVER
VERSION VWHO,VMAJOR,VMINOR,VEDIT
RELOC
> ; END CONDITIONAL ON TOPS-10
CLRBEG==.
;
PDL: BLOCK <PDLEN==^D50>
;
IF TOPS-20, <
INJFN: BLOCK 1 ;JFN OF INPUT FILE
OUTJFN: BLOCK 1 ;JFN OF OUTPUT FILE
MFOJFN: BLOCK 1 ;MULTI-FILE OUTPUT JFN
CMDJFN: BLOCK 1 ;LH: JFN TO GET COMMANDS FROM, RH: LOG JFN
CHN1PC: BLOCK 1 ;PC OF CHANNEL 1 INTERRUPTS
> ; END CONDITIONAL ON TOPS-20
IF TOPS-10, <
CMDPTR: BLOCK 1 ; COMMAND BUFFER POINTER
OURPPN: BLOCK 1 ; SPACE FOR OUR PPN
TTOCCT: BLOCK 1 ; OUTPUT CHARACTER COUNT
> ; END CONDITIONAL ON TOPS-10
RCDSIZ: BLOCK 1 ;RECORD SIZE FOR NON-FORMATTED IMAGE RECORDS
MODE: BLOCK 1 ;LH: INPUT MODE, RH: OUTPUT MODE
INADR: BLOCK 1 ;CURRENT INPUT IMAGE-BINARY INPUT ADDRESS
OUTADR: BLOCK 1 ;CURRENT OUTPUT ADDRESS
INCHK: BLOCK 1 ;INPUT CHECKSUM
OUTCHK: BLOCK 1 ;OUTPUT CHECKSUM
INPTR: BLOCK 1 ;POINTER TO INPUT DATA IN SCRBUF
;
;
; COMND DATA
;
CMDBUF: BLOCK <CMDSIZ==^D200/5> ;COMMAND BUFFER
IF TOPS-20, <
ATMBUF: BLOCK <ATMSIZ==^D200/5> ;ATOM BUFFER
;
CMDBLK: BLOCK .CMGJB+1 ;COMND JSYS CONTROL BLOCK
CMDBKE==.-1
GJFBLK: BLOCK .GJBFP+1 ;GTJFN JSYS CONTROL BLOCK
GJFBKE==.-1
> ; END CONDITIONAL ON TOPS-20
;
CLREND==.-1
;
PAT: BLOCK 20
;
; SCRATCH BUFFER FOR ALL TO USE
;
IF TOPS-20, <
LOC 100K
> ; END CONDITIONAL ON TOPS-20
SCRBUF:
IF TOPS-10, <
BLOCK 2K
> ; END CONDITIONAL ON TOPS-10
IF TOPS-20, <
RELOC
> ; END CONDITIONAL ON TOPS-20
SUBTTL PURE DATA
;
; ENTRY VECTORS
;
ENTVEC:
JRST RSXFMT
IF TOPS-20, <
JRST CMDRST
VERSION VWHO,VMAJOR,VMINOR,VEDIT
> ; END CONDITIONAL ON TOPS-20
;
; COMMAND TABLE
;
DEFINE CMD(A),<TB $'A,<A>>
CMDTAB:
XWD CMDNUM,CMDNUM
CMD ADDRESS
CMD CONVERT
CMD CRLF
CMD EXIT
CMD HELP
CMD IGNORE
CMD INFORMATION
CMD MODE
CMD NO
SIZE==0
CMD RECORD-SIZE
CMD TAKE
IF TOPS-20, <
CMD TCONVERT
CMD TEMPORARY
> ; END CONDITIONAL ON TOPS-20
CMDNUM==.-CMDTAB-1
;
; DISPATCH TABLE FOR "NO" COMMANDS
;
NOCTAB:
XWD NOCNUM,NOCNUM
CMD ADDRESS
CMD IGNORE
CMD NO
IF TOPS-20, <
CMD TEMPORARY
> ; END CONDITIONAL ON TOPS-20
NOCNUM==.-NOCTAB-1
;
; FORMAT TYPE TABLES
;
; NEMONIC,KEYWORD,INPUT BYTE-SIZE,DEFAULT OUTPUT MODE
;
DEFINE FORMAT,<
X DSA,7-BIT-ASCII,7,RSA
X DEF,DEFAULT,0,DEF
X DSB,DOS-BINARY,18,RSB
X IMB,IMAGE-BINARY,18,DSB
X RAM,MICROCODE,7,RSB
X RSA,RSX-ASCII,18,DSA
X RSB,RSX-BINARY,18,DSB
X SAV,SAVE,36,RSB
>
;
DEFINE X(A,B,C,D,E),<
M$'A==.-MSGTAB
TB <M$'D>,<B>
>
FMTTAB:
XWD FMTSIZ,FMTSIZ
MSGTAB:
FORMAT
FMTSIZ==.-FMTTAB-1
;
; RESPONSES FOR "CRLF" COMMAND
;
ASCTAB:
XWD ASCSIZ,ASCSIZ
TB <F.LFSS_-^D18>,<CARRIAGE-RETURN-SINGLE-SPACE>
TB 0,<DEFAULT>
TB <F.IBCR_-^D18>,<IMBEDDED>
TB <F.IPCR_-^D18>,<IMPLIED>
ASCSIZ==.-ASCTAB-1
;
; RESPONSES FOR "INFORMATION" COMMAND
;
INFTAB:
XWD INFSIZ,INFSIZ
TB INFADR,<ADDRESS>
TB INFALL,<ALL>
TB INFCR,<CRLF>
TB INFIGN,<IGNORE>
TB INFMOD,<MODE>
TB INFRCD,<RECORD-SIZE>
IF TOPS-20,<
TB INFTMP,<TEMPORARY>
> ; END CONDITIONAL ON TOPS-20
INFSIZ==.-INFTAB-1
;
DEFINE X(AAA,BBB,C,DDD,E),<EXP ^D<C>B5>
BSZTAB:
FORMAT
;
; GRC=GET RECORD BYTE COUNT
; PRC=PUT RECORD BYTE COUNT
; GBY=GET BYTE
; PBY=PUT BYTE
; EIR=END INPUT RECORD
; EOR=END OUTPUT RECORD
;
DEFINE DSP(NAME),< IRP NAME,<
DEFINE X(A,B,C,D,E),<Z A''NAME>
NAME'TAB:
FORMAT
>>
DSP <GRC,PRC,GBY,PBY,EIR,EOR>
;
; TABLE OF DEFAULT FILE TYPES
;
EXTTAB:
XWD EXTSIZ,EXTSIZ
IF TOPS-20, <
TB M$RSB,BIN
TB <<1B0!F.TIBC>_-^D18>,DIR
TB M$SAV,EXE
TB <<1B0!F.TLFS>_-^D18>,LST
TB <<1B0!F.TIBC>_-^D18>,MAP
TB M$RSB,OBJ
TB M$RSB,OLB
TB M$RAM,RAM
TB M$SAV,SAV
TB M$RSB,STB
> ; END CONDITIONAL ON TOPS-20
;
IF TOPS-10, <
DEFINE XX (A,B)<XWD [SIXBIT /B/],A>
XX M$RSB,BIN
XX <<1B0!F.TIBC>_-^D18>,DIR
XX M$SAV,EXE
XX <<1B0!F.TLFS>_-^D18>,LST
XX <<1B0!F.TIBC>_-^D18>,MAP
XX M$RSB,OBJ
XX M$RSB,OLB
XX M$RAM,RAM
XX M$SAV,SAV
XX M$RSB,STB
> ; END CONDITIONAL ON TOPS-10
EXTSIZ==.-EXTTAB-1
IF TOPS-20, <
;
; PSI TABLES
;
LEVTAB:
EXP CHN1PC
;
CHNTAB==.-^D10
XWD 1,EOFTRP
> ; END CONDITIONAL ON TOPS-20
SUBTTL TOPS-10 I/O AREAS
; TELETYPE DEVICE BLOCK AND BUFFER HEADERS
IF TOPS-10, <
TTYOPN:
EXP .IOASC ; ASCII MODE
SIXBIT /TTY/
XWD TTOBLK,TTIBLK ; HEADER POINTERS
TTOBLK:
BLOCK 3 ; OUTPUT HEADER
TTIBLK:
BLOCK 3 ; INPUT HEADER
; COMMAND DEVICE BLOCK, LOOKUP BLOCK AND BUFFER HEADERS
CMDLEB:
BLOCK 5 ; COMMAND LOOKUP BLOCK
CMDOPN:
EXP .IOASL ; FILE MODE IS ASCII LINE
SIXBIT /DSK/ ; DEFAULT IS "DSK:"
EXP CMDBLK ; INPUT ONLY
CMDBLK:
BLOCK 3 ; COMMAND BUFFER HEADER
; INPUT DEVICE BLOCK, LOOKUP BLOCK AND BUFFER HEADERS
INPLEB:
BLOCK 5 ; INPUT LOOKUP BLOCK
INOPN:
EXP 0 ; FILE MODE GOES HERE
SIXBIT /DSK/ ; DEFAULT IS "DSK:"
EXP INPBLK ; INPUT ONLY
INPBLK:
BLOCK 3 ; INPUT BUFFER HEADER
; OUTPUT DEVICE BLOCK, ENTER BLOCK AND BUFFER HEADERS
OUTLEB:
BLOCK 5 ; OUTPUT ENTER BLOCK
OUTOPN:
EXP 0 ; FILE MODE GOES HERE
SIXBIT /DSK/ ; DEFAULT IS "DSK:"
XWD OUTBLK,0 ; OUTPUT ONLY
OUTBLK:
BLOCK 3 ; OUTPUT BUFFER HEADER
> ; END CONDITIONAL ON TOPS-10