mirror of
https://github.com/PDP-10/its.git
synced 2026-01-28 12:59:20 +00:00
TCTYP and CRTSTY source code.
This commit is contained in:
578
src/klh/macros.84
Executable file
578
src/klh/macros.84
Executable file
@@ -0,0 +1,578 @@
|
||||
IF2 .INEOF ; Never read on 2nd pass, nothing to re-define.
|
||||
IF1 IFDEF %%%MAC .INEOF ; This checks for file already .INSRT'd.
|
||||
%%%MAC==1 ; Aha, first! Prevent other .INSRT's from winning.
|
||||
;----------------------------------------------------------------------------
|
||||
|
||||
; Determine what OS to assemble for. To force a particular OS,
|
||||
; simply set OS%==SIXBIT/foo/ where foo is one of
|
||||
; ITS,CMU,SAIL,DEC,TENEX,TWENEX mutually exclusive.
|
||||
; T10 equivalent to DEC
|
||||
; T20,20X equivalent to TWENEX
|
||||
; 10X equivalent to TENEX
|
||||
; TNX indicates either 10X or 20X, macro determines which.
|
||||
; The following symbols are defined by this section:
|
||||
; Flag Set if assembling for:
|
||||
; OS%ITS ITS system (AI,ML,MC,DM)
|
||||
; OS%CMU CMU system
|
||||
; OS%SAI SAIL system
|
||||
; OS%T10 a vanilla Tops-10 system (neither SAIL nor CMU)
|
||||
; OS%DEC set for all of the above 3 Tops-10 based systems.
|
||||
; OS%10X BBN TENEX
|
||||
; OS%20X DEC Tops-20 (TWENEX)
|
||||
; OS%TNX set for both of the above 2 (10X or 20X).
|
||||
|
||||
ifndef os%,os%==.osmidas
|
||||
%%t==0
|
||||
irp pair,,[[ITS,its],[DEC,t10],[CMU,cmu],[SAIL,sail],[TENEX,10X],[TNX,tnx],[10X,10x],[20X,20x],[TWENEX,20x]]
|
||||
irp sys,flg,[pair]
|
||||
ife os%-sixbit/sys/, os%!flg==1
|
||||
.else ifndef os%!flg, os%!flg==0
|
||||
%%t==%%t+os%!flg
|
||||
.istop
|
||||
termin
|
||||
termin
|
||||
ife %%t,.err Can't determine OS to assemble for!
|
||||
expunge %%t
|
||||
|
||||
; Fixups...
|
||||
ifn os%tnx,[ ; If TNX of some kind, find exact variety.
|
||||
ife .osmidas-sixbit/tenex/, os%10x==1
|
||||
.else os%20x==1
|
||||
]
|
||||
os%tnx==os%10x+os%20x ; TNX on if either 10X or 20X.
|
||||
os%t20==os%20x ; T20 synonym for 20X.
|
||||
os%dec==os%t10\os%cmu\os%sai ; DEC means a T10-like sys.
|
||||
|
||||
;------------------------------------------------------------------
|
||||
; Note: the following stuff is not completely thought out. Mainly it
|
||||
; tries to ensure that a standard exists for specifying CPU type
|
||||
; and that all CPU-dependent symbols are properly defined.
|
||||
; This benefits various .insrt-able packages like NUUOS.
|
||||
|
||||
; Find what CPU to assemble for. To force a particular CPU,
|
||||
; set CPU%==SIXBIT/foo/ where foo is one of:
|
||||
; KA defaults to this. Standard vanilla PDP-10
|
||||
; KI very slightly hairier.
|
||||
; KL current zenith, standard for 20X.
|
||||
; K* means set flags to "good guess".
|
||||
; RUNTIM means use run-time determination.
|
||||
; The following symbols are defined by this section:
|
||||
; CPU%KA set if should assemble specifically for KA
|
||||
; CPU%KI " " " " " " KI
|
||||
; CPU%KL " " " " " " KL
|
||||
; CPU%X set if should use run-time determination.
|
||||
;
|
||||
; In general, code should be written to run on any processor. These
|
||||
; flags are intended to be used only for special circumstances where
|
||||
; the differences can be significant and binary portability is not
|
||||
; as important. (For runtime determination of OS and CPU, see
|
||||
; forthcoming .insrt-able routines, which should set variable flags
|
||||
; of the form OS.TNX, CPU.KA, etc. )
|
||||
|
||||
ifndef cpu%, cpu%==sixbit/KA/ ; Always force to KA unless overridden
|
||||
irp pair,,[[KA,ka],[KI,ki],[KL,kl],[RUNTIM,x]]
|
||||
irp m,s,[pair]
|
||||
ife cpu%-sixbit/m/, cpu%!m==1
|
||||
.else cpu%!m==0
|
||||
termin
|
||||
termin
|
||||
ife cpu%-sixbit/K*/,{ ; Make good guess
|
||||
ifn os%20x, cpu%kl==1
|
||||
.else cpu%ka==1
|
||||
}
|
||||
ife cpu%ka\cpu%ki\cpu%kl\cpu%x, .err Can't determine CPU to assemble for!
|
||||
|
||||
;------------------------------------------------------------------
|
||||
|
||||
DEFINE INFORM A,B,C,D,E,F,G
|
||||
PRINTX \A!B!C!D!E!F!G
|
||||
\
|
||||
TERMIN
|
||||
|
||||
; DEFAULT no-op'ing of purification macros if they're
|
||||
; not already defined to do something.
|
||||
IFNDEF BVAR,[
|
||||
DEFINE BVAR ; Make BVAR, EVAR, and LVAR all do nothing.
|
||||
TERMIN
|
||||
EQUALS EVAR,BVAR
|
||||
EQUALS LVAR,BVAR
|
||||
DEFINE VARCHK ; VARCHK always has this side effect.
|
||||
VARIABLES
|
||||
TERMIN ]
|
||||
|
||||
; Defs for ITS .CALL system call.
|
||||
IFN OS%ITS,[
|
||||
CIMM==1000,,0 ; Immediate arg (also seen as MOVEI)
|
||||
CRET==2000,,0 ; Value returned (also seen as MOVEM)
|
||||
CERR==3000,,0 ; Error code returned
|
||||
CTL== 4000,,0 ; Control bits at loc
|
||||
CTLI==5000,,0 ; Control bits, immediate
|
||||
|
||||
DEFINE SYSCAL A,B
|
||||
.CALL [SETZ ? SIXBIT/A/ ? B ((SETZ))]
|
||||
TERMIN
|
||||
]
|
||||
|
||||
%SIGN==SETZ ; Define full-word Sign bit.
|
||||
%HSIGN==400000 ; and Halfword sign bit.
|
||||
|
||||
; Common byte-pointer LH's
|
||||
IFNDEF $OPCOD,$OPCOD==331100 ; Instruction op-code
|
||||
IFNDEF $ACFLD,$ACFLD==270400 ; Instruction AC field
|
||||
IFNDEF $IFLD,$IFLD==220400 ; Instruction (I) field (maybe shd be $XFLD)
|
||||
IFNDEF $ATFLD,$ATFLD==260100 ; Instruction @ field (maybe shd be $IFLD)
|
||||
IFNDEF $ERRCD,$ERRCD==220600 ; Error code from .STATUS wd (ITS only)
|
||||
IFNDEF $PFLD,$PFLD==360600 ; P field of byte pointer
|
||||
IFNDEF $SFLD,$SFLD==300600 ; S field of byte pointer
|
||||
|
||||
; Macro to decrement 7-bit byte ptr in ac (no checking)
|
||||
DEFINE MDBP7 AC,FOO
|
||||
ADD AC,[70000,,0] ; Increase P
|
||||
CAIG AC,0 ; Skip,
|
||||
SUB AC,[430000,,1] ; unless went off edge, in which case reset.
|
||||
TERMIN
|
||||
EQUALS MD7BPT,MDBP7 ; Remain compatible with old names
|
||||
EQUALS MDBPT, MDBP7
|
||||
|
||||
; Page-size parameters, OS dependent
|
||||
IFNDEF PG$BTS,{ IFN OS%TNX, PG$BTS==9. ; # bits of address in a page.
|
||||
IFN OS%ITS, PG$BTS==10.
|
||||
}
|
||||
PG$SIZ==1_PG$BTS ; Page size in # words.
|
||||
PG$MSK==PG$SIZ-1 ; Mask for page address bits.
|
||||
|
||||
|
||||
; Define some "instructions".
|
||||
IFNDEF P,P=:17 ? .ERR P undefined, using P=17.
|
||||
IFNDEF CALL,CALL==:<PUSHJ P,> ; More efficient than macro.
|
||||
IFNDEF RETURN,RETURN==:<POPJ P,>
|
||||
IFNDEF RET,RET==:<POPJ P,>
|
||||
IFNDEF CALRET,CALRET==:JRST ; Better name for PJRST.
|
||||
IFNDEF PJRST,PJRST==:JRST ; JRST to a popj'ing routine
|
||||
IFNDEF NOP,NOP=:<IFN CPU%KL,{TRN}.ELSE {JFCL}> ; What the hell.
|
||||
|
||||
DEFINE PUSHAE AC,LIST
|
||||
IRP LOC,,[LIST]
|
||||
PUSH AC,LOC
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFINE POPAE AC,LIST
|
||||
IRP LOC,,[LIST]
|
||||
POP AC,LOC
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
; TMPLOC <loc>,<parenthesized arg> - puts argument at given LOC
|
||||
; without changing location counter outside macro call.
|
||||
DEFINE TMPLOC VAL,?ARG
|
||||
%%%TLC==.
|
||||
LOC VAL
|
||||
ARG
|
||||
LOC %%%TLC
|
||||
TERMIN
|
||||
|
||||
IFNDEF %%%ASC,%%%ASC==0 ; Default is old mode, i.e. ASCNT [str]
|
||||
IFE %%%ASC,[
|
||||
; ASCNT [string] - produces word of <char cnt>,,<addr to string>
|
||||
DEFINE ASCNT STR
|
||||
.LENGTH STR,,[ASCIZ STR]!TERMIN
|
||||
|
||||
DEFINE LITSTR STRING
|
||||
[ASCNT [STRING]]TERMIN
|
||||
|
||||
; ASCSTR [string] - produces 2 words of constant string descriptor,
|
||||
; <char cnt> ? <BP to string>
|
||||
DEFINE ASCSTR STR
|
||||
.LENGTH STR
|
||||
440700,,[ASCIZ STR]!TERMIN
|
||||
|
||||
] ; end IFE %%%ASC
|
||||
|
||||
IFE %%%ASC-1,[ ; New style, i.e. ASCNT /str/
|
||||
|
||||
DEFINE ASCNT &STR&
|
||||
.LENGTH STR,,[ASCIZ STR]!TERMIN
|
||||
|
||||
DEFINE LITSTR &STR&
|
||||
[ASCNT STR]!TERMIN
|
||||
|
||||
DEFINE ASCSTR &STR&
|
||||
.LENGTH STR
|
||||
440700,,[ASCIZ STR]!TERMIN
|
||||
|
||||
] ; IFE %%%ASC-1
|
||||
|
||||
; NETHANG - macro interface to use NETBLK call. Hangs until specified
|
||||
; net channel changes state, or call times out.
|
||||
; MOVEI AC,<channel>
|
||||
; NETHANG <timeout in 30th's>,AC,<hang state>,[<winning states>]
|
||||
; failure return (timed out or non-winning new state)
|
||||
; win return (changed to winning state)
|
||||
; Always returns new state in AC.
|
||||
|
||||
IFN OS%ITS,[ ; Only for ITS (in theory could hack for TNX)
|
||||
DEFINE NETHANG TIMOUT,AC,HANGST,NEWSTL
|
||||
JRST [ MOVEM AC,TMSTOR'
|
||||
MOVE AC,[TIMOUT]
|
||||
EXCH AC,TMSTOR
|
||||
SYSCAL NETBLK,[AC ? [HANGST] ? TMSTOR ? CRET AC]
|
||||
JRST .+1
|
||||
IRP CODE,,[NEWSTL]
|
||||
CAIN AC,CODE
|
||||
JRST .+2
|
||||
TERMIN
|
||||
JRST .+1]
|
||||
TERMIN
|
||||
] ; IFN OS%ITS
|
||||
|
||||
; BLKINI, BLKADD - couple of hairy macros that take a given <blockname>
|
||||
; and turn it into repository of text, initialized by BLKINI <name>
|
||||
; added to by BLKADD <name>,[<text to add>].
|
||||
; To dump text, simply stick <name> someplace after all has been added.
|
||||
|
||||
DEFINE BLKINI BLKNAM ; Initialize specified blockname.
|
||||
DEFINE BLKNAM ARG
|
||||
ARG
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFINE BLKADD BLKNAM,NEW ; Add stuff to specified blockname.
|
||||
BLKNAM [DEFINE BLKNAM ARG
|
||||
ARG]NEW
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
|
||||
IFN OS%ITS,[ ; Clock stuff really not used by anything much.
|
||||
|
||||
; Macro to clear clock and set frame time for interrupts
|
||||
DEFINE CLKSET (TMOLOC)
|
||||
PUSH P,A
|
||||
MOVE A,[600000,,TMOLOC]
|
||||
.REALT A,
|
||||
JFCL
|
||||
POP P,A
|
||||
TERMIN
|
||||
|
||||
;to enable clock interrupts
|
||||
DEFINE CLKON
|
||||
.SUSET [.SAPIRQC,,[%PIRLT]] ;turn off any pending realt
|
||||
.SUSET [.SIMASK,,[%PIRLT]] ;enable it
|
||||
TERMIN
|
||||
|
||||
;to disable
|
||||
DEFINE CLKOFF
|
||||
.SUSET [.SAMASK,,[%PIRLT]]
|
||||
TERMIN
|
||||
|
||||
] ; IFN OS%ITS
|
||||
|
||||
;-------------------------------------------------------------
|
||||
; Old Super duper macro to make output a breeze. Requires UUOS.
|
||||
; This stuff is obsoleted by an even more super-duper macro
|
||||
; contained in the OUT output package, but can still be used for
|
||||
; the sake of compatibility.
|
||||
IFNDEF $$OUUO,$$OUUO==0 ; Default is not to use old output UUOs.
|
||||
|
||||
DEFINE FWRITE CH,LIST
|
||||
IFE $$OUUO, MOVEI OC,CH
|
||||
%F==0
|
||||
IRP ITM,REM,[LIST]
|
||||
IFN %F,[%F==0 ? .STOP]
|
||||
IFNSQ [ITM] .GO O
|
||||
IFNDEF %%.!ITM, .GO O
|
||||
IRP ARG,,[REM] ? %%.!ITM CH,[ARG] ? .ISTOP ? TERMIN
|
||||
%F==1 ? .STOP
|
||||
.TAG O
|
||||
%%.TC CH,[[.LENGTH ITM,,[ASCII ITM]]]
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFINE MAKSTR LOC,LIST ; For making string in one fell swoop.
|
||||
BCONC
|
||||
FWRITE STRC,[LIST]
|
||||
ECONC LOC
|
||||
TERMIN
|
||||
|
||||
DEFINE CONC LOC,LIST ; For concatenating stuff to existing string.
|
||||
BCONC LOC
|
||||
FWRITE STRC,[LIST]
|
||||
ECONC LOC
|
||||
TERMIN
|
||||
|
||||
DEFINE DEFWR ITM,INSTR,INTNAM ; Make easy to define simple items.
|
||||
IFN $$OUUO,{ ; Use old output UUOs
|
||||
DEFINE %%.!ITM C,ARG
|
||||
OU!ITM C,ARG
|
||||
TERMIN .STOP }
|
||||
|
||||
IFB [INSTR]{IFB [INTNAM] DEFX2 %%.!ITM,MOVE U3,OX!ITM
|
||||
.ELSE DEFX2 %%.!ITM,MOVE U3,INTNAM
|
||||
.STOP }
|
||||
IFB [INTNAM] DEFX2 %%.!ITM,INSTR,OX!ITM
|
||||
.ELSE DEFX2 %%.!ITM,INSTR,INTNAM
|
||||
TERMIN
|
||||
|
||||
DEFINE DEFX2 WITM,INSTR,RTN
|
||||
DEFINE WITM C,ARG
|
||||
INSTR,ARG
|
||||
CALL OUT"RTN
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
;------------------- FWRITE item routines ------------------
|
||||
; item is in form "%%.<item-name> <channel>,<argument>"
|
||||
; Note that if item takes no argument and it is the last thing in FWRITE,
|
||||
; a space should follow the comma, as in FWRITE CH,[[foo],WAI, ]
|
||||
; Otherwise MIDAS botches it with no err message.
|
||||
|
||||
DEFWR TLS,,OXLS ; "TLS" - Text, List String.
|
||||
DEFWR TA,MOVEI U1,OXAR ; "TA" - Text, Area. outputs whole area.
|
||||
DEFWR TS,MOVEI U3,OXS ; "TS" - Text, String. outputs string var.
|
||||
DEFWR N10,,OXN10. ; "N10" - Number, base 10 ; signed decimal value,
|
||||
DEFWR N9,,OXN10 ; "N9" - N10 without decimal point. Kludge.
|
||||
DEFWR N8,,OXN8 ; "N8" - Number, base 8. Signed octal value.
|
||||
EQUALS %%.OCT,%%.N8 ; "OCT" - N8
|
||||
EQUALS %%.DEC,%%.N10 ; "DEC" - N9
|
||||
DEFWR NFL,,OXNFL ; "NFL" - Number, FLoating. From MACLISP.
|
||||
DEFWR TI,MOVEI U1,OXC ; "TI" - Text Immediate. Outputs arg as char
|
||||
DEFWR TZ,MOVEI U3,OXZA ; "TZ" - Text ASCIZ. Outputs asciz string
|
||||
DEFWR TC,,OXTC ; "TC" - Text, Count. Outputs ASCNT string at arg
|
||||
DEFWR TPZ,,OXZ ; "TPZ" - Text, BP ASCIZ. c(ARG) is BP to asciz string
|
||||
DEFWR TPC,,OXPC ; "TPC" - Text, BP Count. c(ARG) is #,,[bp]
|
||||
DEFWR 6F ; "6F" - outputs c(arg) as sixbit without trailing bls
|
||||
DEFWR 6W ; "6W" - outputs all of c(arg) as sixbit
|
||||
DEFWR 6Q ; "6Q" - like 6F but puts ^Q in front of punct. chars
|
||||
|
||||
; Weird cookies
|
||||
|
||||
IFN $$OUUO,[
|
||||
DEFINE DEFWRN ITM,INSTR,UUO
|
||||
DEFINE %%.!ITM C,ARG
|
||||
INSTR U4,ARG
|
||||
UUO C,U4
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFWRN RH,MOVE,OUNRH ; "RH" - outputs RH of c(ARG) in octal (6 chars)
|
||||
DEFWRN LH,HLRZ,OUNRH ; "LH" - outputs LH of c(ARG) in octal (6 chars)
|
||||
DEFWRN RHV,HRRZ,OUN8 ; "RHV" - rh(arg) as octal number, not bit pattern
|
||||
DEFWRN LHV,HLRZ,OUN8 ; "LHV" - lh(arg) as octal number
|
||||
DEFWRN RHS,HRRE,OUN8 ; "RHS" - rh(arg) as signed octal number
|
||||
DEFWRN LHS,HLRE,OUN8 ; "LHS" - lh(arg) as signed octal number
|
||||
|
||||
DEFINE DEFWH ITM
|
||||
DEFINE %%.!ITM C,ARG
|
||||
%%.L!ITM C,ARG
|
||||
%%.TZ C,[[ASCIZ /,,/]]
|
||||
%%.R!ITM C,ARG
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFWH H ; "H" - outputs c(ARG) in halfwd format (LH,,RH)
|
||||
DEFWH HV ; "HV" - lhv,,rhv
|
||||
DEFWH HS ; "HS" - lhs,,rhs
|
||||
|
||||
DEFINE %%.TZ$ C,ARG ; "TZ$" - Text ASCIZ crock. RH(c(arg)) is addr of asciz
|
||||
MOVE U4,ARG ; (like OUTZ C,@ARG but avoids more indirection)
|
||||
OUTZ C,(U4)
|
||||
TERMIN
|
||||
] ; IFN $$OUUO
|
||||
|
||||
IFE $$OUUO,[
|
||||
DEFWR RH,HRRZ U3 ; RH(aval) - Right halfword, full.
|
||||
DEFWR LH,HLRZ U3,OXRH ; LH(aval) - Left halfword, full.
|
||||
DEFWR RHV,HRRZ U3,OXN8 ; RHV(aval) - RH as octal num, not bit pattern.
|
||||
DEFWR LHV,HLRZ U3,OXN8 ; LHV(aval) - LH as octal num, not bit pattern.
|
||||
DEFWR RHS,HRRE U3,OXN8 ; RHS(aval) - RH as signed octal num
|
||||
DEFWR LHS,HLRE U3,OXN8 ; LHS(aval) - LH as signed octal num
|
||||
DEFWR H,,OXHWD ; H(aval) - Halfword (123,,456)
|
||||
DEFWR HV ; HV(aval) - LHV,,RHV
|
||||
DEFWR HS ; HS(aval) - LHS,,RHS
|
||||
DEFWR TZ$,HRRZ U3,OXZA ; TZ$(a-[a-asciz]) like TZ(@A) but avoids
|
||||
] ;IFE $$OUUO
|
||||
|
||||
DEFINE %%.ERR C,ARG ; "ERR" - System error message. If arg is blank,
|
||||
IFN $$OUUO,MOVEI OC,C
|
||||
IFB [ARG] CALL OUT"OXERRL ; use last err, otherwise arg is error code
|
||||
.ELSE MOVE U3,ARG ? CALL OUT"OXERR
|
||||
TERMIN
|
||||
|
||||
DEFINE DEFWRT ITM,RTN,OUTRTN
|
||||
DEFINE %%.!ITM!I C,ARG ; Def the "immediate" version.
|
||||
%%.!ITM C
|
||||
TERMIN
|
||||
IFN $$OUUO,{
|
||||
DEFINE %%.!ITM C,ARG
|
||||
PUSH P,A
|
||||
IFNB [ARG] MOVE A,ARG
|
||||
.ELSE CALL TIMGET
|
||||
CALL RTN
|
||||
%%.TC C,A
|
||||
POP P,A
|
||||
TERMIN
|
||||
.STOP } ; IFN $$OUUO
|
||||
|
||||
DEFINE %%.!ITM C,ARG
|
||||
IFB [ARG]{ ; If no arg, use current time.
|
||||
IFN OS%ITS, CALL OUT"UTMGTS
|
||||
IFN OS%TNX, SETO U3,
|
||||
} .ELSE MOVE U3,ARG
|
||||
MOVEI U1,OUT"OUTRTN
|
||||
CALL OUT"OXTXS
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFWRT WA,TIMDTM,OXTMDT ; "WA" - When, type A. "mm/dd/yy hh:mm:ss"
|
||||
DEFWRT WB,TIMEXP,OXTME ; "WB" - When, type B. "dd mmm yy hhmm zon"
|
||||
DEFWRT WC,TIMTIM,OXTMTS ; "WC" - When, type C. "hh:mm:ss"
|
||||
DEFWRT WD,LTMEXP,OXTMX ; "WD" - When, type D. "dd month yyyy hh:mm zon"
|
||||
|
||||
; "HN" - takes host # from arg and outputs number, performing
|
||||
; simplifications where appropriate. Intended for use with new (HOSTS3)
|
||||
; host table.
|
||||
; Note that the $$OUUO==1 version is obsolete, and should be flushed asap.
|
||||
|
||||
IFN $$OUUO,[
|
||||
|
||||
DEFINE DEFWRH ITM,RTN
|
||||
DEFINE %%.!ITM C,ARG
|
||||
MOVE U4,ARG
|
||||
LDB U3,[NETWRK"NW$BYT,,U4] ; If no string exists, check number.
|
||||
CAIN U3,12 ; Arpanet?
|
||||
PUSHJ P,[
|
||||
IFDEF $$HST3,IFN $$HST3,.ERR You are going to lose. Flush the $$OUUO==1 !!
|
||||
TDNE U4,[777,,77700774] ; Are any extended bits set?
|
||||
POPJ P, ; If so, just print number (hack "/" fmt later)
|
||||
DPB U4,[170200,,U4] ; Move host # ahead of imp #
|
||||
LSH U4,-9.
|
||||
ANDI U4,377
|
||||
POPJ P,] ; finally output old-form number
|
||||
RTN C,U4 ; not arpanet?? just print.
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFWRH HN,OUN8 ; Output host number in octal
|
||||
DEFWRH HND,OUN9 ; Ditto in decimal
|
||||
|
||||
; "HST" - takes host # from arg and outputs name or #
|
||||
; This version works with new host table file
|
||||
DEFINE %%.HST C,ARG ; "HST" - takes host # from arg and outputs name or #
|
||||
PUSHAE P,[A,B,D] ;clobbered by HSTSRC routine
|
||||
SKIPN B,ARG
|
||||
MOVE B,OWNHST
|
||||
PUSHJ P,NETWRK"HSTSRC ;make A point to asciz name
|
||||
PUSHJ P,[
|
||||
%%.HN C,B ; Output number.
|
||||
JRST POPJ1]
|
||||
OUTZ C,(A)
|
||||
POPAE P,[D,B,A]
|
||||
TERMIN
|
||||
] ;IFN $$OUUO
|
||||
|
||||
IFE $$OUUO,[
|
||||
IRP ITM,,[HN,HND,HST]
|
||||
DEFINE %%.!ITM C,ARG
|
||||
MOVE U3,ARG
|
||||
CALL OUT"OX!ITM
|
||||
TERMIN
|
||||
TERMIN
|
||||
] ;IFE $$OUUO
|
||||
|
||||
; Character Table Macros
|
||||
|
||||
; These macros facilitate use of 200-word arrays indexed by
|
||||
; an ASCII character. A standard table definition is furnished which
|
||||
; can be inserted where desired, and each insertion may be altered
|
||||
; as necessary.
|
||||
|
||||
|
||||
; Character class flag definitions - all in LH
|
||||
|
||||
ch%msk==377000 ; Note sign bit not included; user can set.
|
||||
|
||||
ch%ul== 200000 ; Uppercase Letter (A-Z)
|
||||
ch%ll== 100000 ; Lowercase Letter (a-z)
|
||||
ch%d== 40000 ; Digit (0-9)
|
||||
ch%pt== 20000 ; Printing (41-176; all but CTLs, SP, DEL)
|
||||
ch%wsp== 10000 ; Whitespace (SP, TAB)
|
||||
ch%fmt== 4000 ; ForMaT effector (^H, ^I, ^J, ^K, ^L, ^M)
|
||||
ch%lbr== 2000 ; Left BRacket (<[{
|
||||
ch%rbr== 1000 ; Right BRacket }]>)
|
||||
|
||||
; Some useful combinations
|
||||
ch%l==ch%ul+ch%ll ; Letter (upper or lower case)
|
||||
ch%ld==ch%l+ch%d ; Letter or Digit
|
||||
ch%uld==ch%ul+ch%d ; Uppercase Letter or Digit
|
||||
ch%lld==ch%ll+ch%d ; Lowercase Letter or Digit
|
||||
ch%br==ch%lbr+ch%rbr ; Brackets
|
||||
|
||||
; CHTMAC - macro defining a character table with standard flags.
|
||||
; Can be used as-is just by putting "chtmac" someplace, but
|
||||
; also serves as a model for defining non-standard tables.
|
||||
|
||||
define CHTMAC
|
||||
chrtab==. ; Addr of latest table.
|
||||
repeat 200,c.set \.rpcnt,0 ; Reserve 200 locs and set values to char only.
|
||||
chrgrp addl,.ascvl/A,.ascvl/Z,,ch%ul ; Add flag ch%ul to chars "A-"Z incl
|
||||
chrgrp addl,.ascvl/a,.ascvl/z,,ch%ll ; Add flag ch%ll to chars "a-"z
|
||||
chrgrp addl,.ascvl/0,.ascvl/9,,ch%d ; Add flag ch%d to chars "0-"9
|
||||
chrgrp addl,41,176,,ch%pt ; Add flag ch%pt to chars 041-176 inclusive
|
||||
chrgrp addl,^I,," ",ch%wsp ; Add flag ch%wsp to chars ^I and 40
|
||||
chrgrp addl,^H,^M,,ch%fmt ; Add flag ch%fmt to chars ^H-^M inclusive
|
||||
chrgrp addl,133,,"(<{",ch%lbr ; Add flag ch%lbr to 133 = [ and (,<,{.
|
||||
chrgrp addl,135,,"}>)",ch%rbr ; Add flag ch%rbr to 133 = ] and },>,).
|
||||
termin
|
||||
|
||||
; CHRGRP - Macro for easily setting ranges of chars in a table.
|
||||
; Syntax is:
|
||||
; chrgrp <mode>,<beg>,<end>,<string>,<value>
|
||||
; Applies <value> to specified chars according to <mode>.
|
||||
; The range of chars to set can be specified in two ways; either
|
||||
; or both can be used.
|
||||
; * All chars from <beg> to <end> INCLUSIVE.
|
||||
; If <end> is null, use only <beg>.
|
||||
; If <beg> is null, use nothing.
|
||||
; <beg> and <end> must be expressions, not chars.
|
||||
; * All chars in <string>, which has "strung" syntax.
|
||||
; If <string> is null, use nothing.
|
||||
; Applicable modes are:
|
||||
; SET - like MOVE
|
||||
; SETR - like HRR
|
||||
; ADD - like TDO
|
||||
; ADDL - like TLO
|
||||
|
||||
define chrgrp mode,ch1,ch2,*str*,?val
|
||||
if1 .stop
|
||||
ifsn [ch1][]{
|
||||
ifsn [ch2][] %%%nc==1+<ch2>-<ch1>
|
||||
.else %%%nc==1
|
||||
%%%tlc==.
|
||||
loc chrtab+<ch1>
|
||||
repeat %%%nc,c.!mode \<<ch1>+.rpcnt>,val
|
||||
loc %%%tlc
|
||||
}
|
||||
ifse [str][] .stop
|
||||
%%%tlc==.
|
||||
irpc c,,[str]
|
||||
loc chrtab+<.ascvl /c>
|
||||
c.!mode \<.ascvl /c>,val
|
||||
termin
|
||||
loc %%%tlc
|
||||
termin
|
||||
|
||||
; Define the <mode>s for CHRGRP.
|
||||
define c.set #chr#,?val
|
||||
<ch%!chr==val>
|
||||
termin
|
||||
define c.add #chr#,?val
|
||||
<ch%!chr==ch%!chr\val>
|
||||
termin
|
||||
define c.addl #chr#,?val
|
||||
<ch%!chr==ch%!chr\<val,,>>
|
||||
termin
|
||||
define c.setr #chr#,?val
|
||||
<ch%!chr==<-1,,>&ch%!chr\val>
|
||||
termin
|
||||
|
||||
298
src/rms/macros.18
Executable file
298
src/rms/macros.18
Executable file
@@ -0,0 +1,298 @@
|
||||
|
||||
IF2 [ .MLLIT=1
|
||||
$PURE==0
|
||||
IFN PURESW,[
|
||||
$PURLC==$PURBG ;RESET BOTH LOCATION COUNTERS.
|
||||
$VARLC==$VARBG
|
||||
]]
|
||||
IF2 .INEOF
|
||||
|
||||
.MLLIT=1 ;MULTI-LINE MODE.
|
||||
IFN 0,[
|
||||
.AUXIL ;DON'T CREF THIS FILE'S SYMBOLS UNLESS THEY'RE ACTUALLY USED ELSEWHERE.
|
||||
]
|
||||
IFNDEF %TOOVR,.INSRT SYSTEM;TTYDEF >
|
||||
IFNDEF %PIMPV,.INSRT SYSTEM;BITS >
|
||||
|
||||
;AC DEFS.
|
||||
F==0 ;FLAGS.
|
||||
A=1 ;THESE USED FOR ARGS.
|
||||
B=2
|
||||
C=3
|
||||
D=4
|
||||
E=5
|
||||
G=6 ;RARELY SAVED IF USED.
|
||||
H=7
|
||||
I=10 ;CHARACTER IO THRU HERE.
|
||||
J=11 ;-> FILE BLOCK.
|
||||
K=12
|
||||
M=13 ;OUTPUT PATH.
|
||||
N=14 ;INPUT PATH.
|
||||
R=15
|
||||
S=16
|
||||
P=17 ;PDL POINTER.
|
||||
|
||||
SAVE=PUSH P,
|
||||
REST=POP P,
|
||||
CALL=PUSHJ P,
|
||||
RET=POPJ P,
|
||||
|
||||
SIGN=400000 ;IT SAVES A LITTLE TYPING
|
||||
JRSTF=JRST 2,
|
||||
JOV=JFCL 10,
|
||||
JCRY0=JFCL 4,
|
||||
JCRY1=JFCL 2,
|
||||
JFOV=JFCL 1,
|
||||
.FORMAT 30,2704_24. ;MAKE A, FORMAT TREAT A LIKE AC
|
||||
.FORMAT 34,00222704_12. ;CHANGE A,B FORMAT TO TREAT A LIKE AC
|
||||
.AOP .OPER@ 0,.RDATIM ;GET DATE AND TIME OF ASSEMBLY
|
||||
ASTIME=.AVAL1 ;TIME (SIXBIT /HHMMSS/) OF ASSEMBLY
|
||||
ASDATE=.AVAL2 ;DATE (SIXBIT /YYMMDD/) OF ASSEMBLY
|
||||
|
||||
|
||||
;SWDEF NAME=EXPR ;SET "NAME" TO "EXPR" IFF "NAME" NOT DEFINED
|
||||
|
||||
DEFINE SWDEF ASSGT/
|
||||
IRPS DUMMY,,[ASSGT]
|
||||
IFNDEF DUMMY,ASSGT
|
||||
.ISTOP
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
;FOLLOWING MACROS TAKE ADVANTAGE
|
||||
;OF ARGUMENT EVALUATION AT EXPANSION TIME
|
||||
|
||||
DEFINE CONCAT A,B
|
||||
A!B!TERMIN
|
||||
|
||||
DEFINE DEF A,B,C,D,E,F,G,H,I,J,K
|
||||
DEFINE A!B!C!D!E!F!G!H!I!J!K!TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFINE PRINTA A,B,C,D,E,F
|
||||
IF1,[PRINTC Á!B!C!D!E!F
|
||||
Ý
|
||||
TERMIN
|
||||
|
||||
|
||||
DEFINE PRINTB A,B,C,D,E,F
|
||||
PRINTC Á!B!C!D!E!F
|
||||
Š
|
||||
TERMIN
|
||||
|
||||
;(RIGHT) BYTE POINTER, POS ARG IS # BITS TO RIGHT OF BYTE
|
||||
|
||||
DEFINE POINTR POS,SIZ
|
||||
<POS>_12.+<SIZ>_6,,TERMIN
|
||||
|
||||
;(LEFT) BYTE POINTER, 1STBIT ARG IS # BITS TO LEFT OF BYTE
|
||||
|
||||
DEFINE POINTL 1STBIT,SIZ
|
||||
<36.-<SIZ>-<1STBIT>>_12.+<SIZ>_6,,TERMIN
|
||||
|
||||
;BYTE POINTER TO BYTE BEFORE FIRST IN WORD
|
||||
|
||||
DEFINE POINTZ SIZ
|
||||
36.-<36./<SIZ>*<SIZ>>_12.+<SIZ>_6,,-1 TERMIN
|
||||
|
||||
;BYTE POINTER TO THE WORD BUT OFF THE LEFT END (EG 440700,,)
|
||||
DEFINE POINTW SIZ
|
||||
36._12.+<SIZ>_6,,TERMIN
|
||||
|
||||
;(PLURAL) BYTE POINTER ARRAY TO LDB FROM INDEXED
|
||||
|
||||
DEFINE POINTS SIZ
|
||||
REPEAT 36./<SIZ>,<36.-<SIZ>*<.RPCNT+1>>_12.+<SIZ>_6,,TERMIN
|
||||
|
||||
;(ILDB) BYTE POINTER ARRAY TO ILDB FROM
|
||||
|
||||
DEFINE POINTI SIZ
|
||||
REPEAT 36./<SIZ>,<36.-<SIZ>*.RPCNT>_12.+<SIZ>_6,,TERMIN
|
||||
|
||||
;ASSEMBLE INTO A CERTAIN LOCATION
|
||||
|
||||
DEFINE TMPLOC LCTN,CRUFT/
|
||||
.ZZ==.
|
||||
LOC LCTN
|
||||
CRUFT
|
||||
.=.ZZ
|
||||
TERMIN
|
||||
|
||||
;DECREMENT A 7 BIT BYTE POINTER
|
||||
|
||||
DEFINE DBP7 AC
|
||||
ADD AC,[070000,,0]
|
||||
TLNE AC,400000
|
||||
SUB AC,[430000,,1]
|
||||
TERMIN
|
||||
|
||||
;DECREMENT 7 BIT BYTE POINTER AND JUMP
|
||||
|
||||
DEFINE DBP7J AC,ADR
|
||||
ADD AC,[70000,,0]
|
||||
JUMPGE AC,ADR
|
||||
SUB AC,[430000,,1]
|
||||
JRST ADR
|
||||
TERMIN
|
||||
|
||||
;IFNEED FOOSW,FOO,[FOO:BAR]
|
||||
;ASSEMBLES IF FOO NEEDED OR FOOSW NONZERO.
|
||||
|
||||
DEFINE IFNEED A,B
|
||||
SWDEF A==0
|
||||
IF1 [IRPS X,,[B]
|
||||
IFE 3-.TYPE X ,A==1
|
||||
TERMIN ]
|
||||
IFN A,TERMIN
|
||||
|
||||
|
||||
;REPEAT AN INSTRUCTION WITH VARIOUS ADDRESSES
|
||||
|
||||
DEFINE INSIRP A,B
|
||||
IRPS %%ADR,,[B]
|
||||
A,%%ADR
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
;TAKE ACTION WHEN A BUG IS DETECTED.
|
||||
;(MIGHT BE REDEFINED AFTER THIS FILE)
|
||||
DEFINE BUG A/
|
||||
.VALUE
|
||||
TERMIN
|
||||
|
||||
;PAUSE IF IN DEBUG MODE. SHOULD HAPPEN BEFORE THE PROGRAM
|
||||
;FINALIZES ITS MAIN ACTION OR KILLS ITSELF.
|
||||
DEFINE DPAUSE
|
||||
SKIPE DEBUG
|
||||
.VALUE
|
||||
TERMIN
|
||||
|
||||
;1ST ARG NAME OF SYSTEM CALL,
|
||||
;2ND LIKE A LITERAL HAS ARGS TO CALL.
|
||||
DEFINE SYSCAL A,B
|
||||
.CALL [SETZ ? SIXBIT/A/ ? B ((SETZ))]
|
||||
TERMIN
|
||||
|
||||
DEFINE INSERT LINE/
|
||||
IRPS %NAME,,[LINE]
|
||||
DEFINE %NAME DEFALT/
|
||||
.INSRT DSK:DEFALT LINE
|
||||
TERMIN
|
||||
.ISTOP
|
||||
TERMIN
|
||||
TERMIN
|
||||
|
||||
DEFINE INSERT DEFALT/GENSYM
|
||||
IRPS %NAME,,[DEFALT]
|
||||
IFNDEF %NAME,[
|
||||
DEFINE %NAME
|
||||
.INSRT DSK:!TERMIN
|
||||
]
|
||||
DEFINE GENSYM
|
||||
EXPUNG GENSYM
|
||||
%NAME!!TERMIN
|
||||
.ISTOP
|
||||
TERMIN
|
||||
GENSYM DEFALTîTERMIN
|
||||
SWDEF PURESW==0
|
||||
IFE PURESW,[
|
||||
DEFINE VBLK
|
||||
IFE $PURE, .ERR CONSEC. VBLK'S
|
||||
$PURE==0
|
||||
TERMIN
|
||||
|
||||
DEFINE PBLK
|
||||
IFN $PURE, .ERR CONSEC. PBLK'S
|
||||
$PURE==1
|
||||
TERMIN
|
||||
|
||||
DEFINE $PUREND ;SETS $PURMX, $VARMX IF PURESW.
|
||||
TERMIN
|
||||
]
|
||||
|
||||
IFN PURESW,[
|
||||
DEFINE VBLK ;START IMPURE CODING.
|
||||
IFE $PURE, .ERR CONSEC. VBLK'S
|
||||
IFN $PURE, $PURLC==. ? .=$VARLC
|
||||
$PURE==0
|
||||
TERMIN
|
||||
|
||||
DEFINE PBLK ;START PURE CODING.
|
||||
IFN $PURE, .ERR CONSEC. PBLK'S.
|
||||
IFE $PURE, $VARLC==. ? .=$PURLC
|
||||
$PURE==1
|
||||
TERMIN
|
||||
|
||||
SWDEF $VARBG==. ;DEFINE STARTS OF SEGMENTS.
|
||||
SWDEF $PURBG==20*2000
|
||||
$PURLC==$PURBG ;INITIALIZE LOC. CNTRS.
|
||||
$VARLC==$VARBG
|
||||
|
||||
DEFINE $PUREND ;PUT THIS AFTER END OF BOTH SEGS.
|
||||
IFN $PURE, VBLK ;FORCE BOTH $PURLC AND $VARLC TO BE RIGHT.
|
||||
PBLK
|
||||
$PURMX==$PURLC
|
||||
$VARMX==$VARLC
|
||||
TERMIN
|
||||
] ;END IFN PURESW,
|
||||
|
||||
$PURE==0
|
||||
|
||||
DEFINE VARS X
|
||||
VBLK
|
||||
X
|
||||
PBLK
|
||||
TERMIN
|
||||
|
||||
;UUO DEFINITION MACROS:
|
||||
|
||||
F"UUONUM==0 ;USED TO ASSIGN VALUES TO UUOS.
|
||||
|
||||
;DEFINE UUO NAMED A, DISPATCH ENTRY B.
|
||||
DEFINE UUODEF A,B
|
||||
F"UUONUM==F"UUONUM+1
|
||||
A=F"UUONUM_33
|
||||
TMPLOC UUOTAB+A_-33, B
|
||||
TERMIN
|
||||
|
||||
;DEFINE AN OUTPUT UUO, TO CALL AT CURRENT LOCATION.
|
||||
DEFINE OUTUUO A
|
||||
UUODEF .M"A,\.,,F"OUTUOH
|
||||
TERMIN
|
||||
|
||||
;ARRANGE FOR SOME THINGS TO BE DONE AT END OF ASSAMBLY.
|
||||
EQUALS $END,END
|
||||
|
||||
DEFINE END ADDR
|
||||
F"UUOMAX==F"UUONUM ;LARGEST UUO NUM. USED.
|
||||
F"CHNMAX==F"CHNNUM ;LARGEST ASSIGNED CHANNEL NUM.
|
||||
IFN F"UUOMAX,[IFNDEF UUOTAB,[ VBLK
|
||||
UUOTAB: BLOCK F"UUOMAX ]]
|
||||
IFN PURESW, IFNDEF $PURMX, $PUREND ;(UNLESS ALREADY DONE)
|
||||
$END ADDR
|
||||
TERMIN
|
||||
;ASSEMBLE A FILE BLOCK AND NAME THE WORDS IN IT.
|
||||
|
||||
DEFINE FILDEF NAM,CHNL,SIZ
|
||||
NAM!CHN: CHNL
|
||||
NAM!DEV: 0
|
||||
NAM!FN1: 0
|
||||
NAM!FN2: 0
|
||||
NAM!SNM: 0
|
||||
NAM!BPT: 0+IFN NAM!BSZ,POINTZ SIZ,NAM!BUF
|
||||
NAM!PNT: 0
|
||||
NAM!CNT: -1 ;BUFFER NOT INITTED.
|
||||
NAM!EPT: 0
|
||||
NAM!BSB: 36./SIZ
|
||||
NAM!LEN: NAM!BSZ
|
||||
NAM!MOD: 0
|
||||
IFN NAM!BSZ,NAM!BUF: BLOCK NAM!BSZ+1
|
||||
TERMIN
|
||||
|
||||
;NUMBER OF NEXT UNASSIGNED IO CHANNEL.
|
||||
DEFINE FRECHN
|
||||
F"CHNNUM+1
|
||||
F"CHNNUM==F"CHNNUM+1
|
||||
TERMIN
|
||||
|
||||
F"CHNNUM==0
|
||||
58
src/syseng/$call.macro
Executable file
58
src/syseng/$call.macro
Executable file
@@ -0,0 +1,58 @@
|
||||
;;; System-Call Macro.
|
||||
|
||||
DEFINE $CALL PROC,IN,OUT,CTLB
|
||||
;COUNT ARGUMENTS
|
||||
.CLST.==0
|
||||
.CLCT. IN
|
||||
.CLCT. OUT
|
||||
.CLCT. CTLB
|
||||
|
||||
043000,,[SETZ
|
||||
.1STWD SIXBIT/PROC/
|
||||
.CLAG. 4000,CTLB
|
||||
.CLAG. 0,IN
|
||||
.CLAG. 2000,OUT
|
||||
IFN .CLST.,INFORM BAD FORMAT SYSTEM CALL - PROC
|
||||
]
|
||||
TERMIN
|
||||
|
||||
DEFINE .CLCT. ?A,B,C,D,E,F,G,H ;CROCK DUE TO IRP LOSS
|
||||
IFNB [A] .CLST.==.CLST.+1
|
||||
IFNB [B] .CLST.==.CLST.+1
|
||||
IFNB [C] .CLST.==.CLST.+1
|
||||
IFNB [D] .CLST.==.CLST.+1
|
||||
IFNB [E] .CLST.==.CLST.+1
|
||||
IFNB [F] .CLST.==.CLST.+1
|
||||
IFNB [G] .CLST.==.CLST.+1
|
||||
IFNB [H] .CLST.==.CLST.+1
|
||||
TERMIN
|
||||
|
||||
;;; ARGUMENT POINTER GENERATOR FOR ABOVE
|
||||
;;; A # INDICATES AN IMMEDIATE ARGUMENT
|
||||
|
||||
DEFINE .CLAG. BITS?A,B,C,D,E,F,G,H
|
||||
IFNB [A] .CLG1. BITS,A
|
||||
IFNB [B] .CLG1. BITS,B
|
||||
IFNB [C] .CLG1. BITS,C
|
||||
IFNB [D] .CLG1. BITS,D
|
||||
IFNB [E] .CLG1. BITS,E
|
||||
IFNB [F] .CLG1. BITS,F
|
||||
IFNB [G] .CLG1. BITS,G
|
||||
IFNB [H] .CLG1. BITS,H
|
||||
TERMIN
|
||||
|
||||
DEFINE .CLG1. BITS?ARG
|
||||
.CLST.==.CLST.-1 ;COUNT ARGS
|
||||
.CLG2.==0
|
||||
IRPNC 0,1,-1,CH,REST,[ARG]
|
||||
IFE "CH-"#,[ <IFE .CLST.,[400000]+BITS+1000>,,0*"CH+REST
|
||||
.CLG2.==1 ;the 0 times is per order rms
|
||||
] ;Immediate
|
||||
IFE "CH-"?,[ <IFE .CLST.,[400000]+3000>,,0*"CH+REST
|
||||
.CLG2.==1
|
||||
] ;Error-code argument
|
||||
IFN "CH-40, .ISTOP ;STOP ON FIRST NON BLANK
|
||||
TERMIN
|
||||
IFE .CLG2., <IFE .CLST.,[400000]+BITS>,,ARG
|
||||
TERMIN
|
||||
|
||||
18212
src/syseng/crtsty.1377
Executable file
18212
src/syseng/crtsty.1377
Executable file
File diff suppressed because it is too large
Load Diff
151
src/syseng/system.14
Executable file
151
src/syseng/system.14
Executable file
@@ -0,0 +1,151 @@
|
||||
; -*-MIDAS-*-
|
||||
|
||||
comment |
|
||||
This macro package is for use in programs which can assemble for more
|
||||
than one operating system. An assembly parameter exists for each possible
|
||||
operating system; if it is nonzero then the assembly is for that operating
|
||||
system. Thus if "FOO" is the name of the parameter for an operating system,
|
||||
then "IFN FOO" is a conditional which assembles iff the output is for that
|
||||
system. Corresponding parameters are defined to specify on which operating
|
||||
system the assembly is taking place. The currently defined parameter names
|
||||
are "ITS" for the ITS, "10X" for Tenex, and "20X" for Tops-20. In addition
|
||||
"TNX" is defined to be 10X\20X since Tenex and Tops-20 are very much alike.
|
||||
To use this package set to 1 the operating system parameters for which
|
||||
the program is willing to assemble and then .INSRT this package. Do this
|
||||
on pass 1 only. For example,
|
||||
if1 [
|
||||
its==1 ; can assemble for either ITS or Tops-20
|
||||
20x==1 ; (but not Tenex)
|
||||
.insrt system
|
||||
]
|
||||
All undefined operating system switches will be set to zero (thus the
|
||||
program need not know about all the systems defined in this package).
|
||||
If more than one switch is nonzero then the user will be asked at assembly
|
||||
time "System? ". Entering a blank line will default to the system on
|
||||
which the assembly is taking place. Entering "?" will list the valid
|
||||
responses. Finally entering an operating systme name will select that
|
||||
system. Once the system is determined all the other operating system
|
||||
switches will be set to zero.
|
||||
Finally the output format is selected on the basis of the target
|
||||
system and the $$REL switch (which defaults to zero, i.e. non-relocatable).
|
||||
If the target system is not the same as the assembly system then the
|
||||
symbol definitions for the target system are .INSRT'd.
|
||||
|
|
||||
|
||||
; Determine which system we're assembling on.
|
||||
.its==:ife .osmidas-sixbit/its/,[1] .else [0]
|
||||
.10x==:ife .osmidas-sixbit/tenex/,[1] .else [0]
|
||||
.20x==:ife .osmidas-sixbit/twenex/,[1] .else [0]
|
||||
.dec==:ife .osmidas-sixbit/dec/,[1] .else [0]
|
||||
.tnx==.10x\.20x
|
||||
|
||||
|
||||
ifdef tnx, ifn tnx, 10x==1 ? 20x==1 ; TNX==1 is like 10X==1 and 20X==1
|
||||
|
||||
; Program doesn't run on a system unless it explicitly says so.
|
||||
ifndef its, its==0 ; ITS
|
||||
ifndef 10x, 10x==0 ; Tenex
|
||||
ifndef 20x, 20x==0 ; Tops-20
|
||||
ifndef dec, dec==0 ; Tops-10
|
||||
ife its\10x\20x\dec, .fatal No operating system(s) specified
|
||||
|
||||
ifndef $$ask,$$ask==1 ; Default is to ask question if necessary.
|
||||
ife $$ask,[ ; Don't ask, just use system we're assembling on.
|
||||
ifn its&.its, 10x==0 ? 20x==0 ? dec==0
|
||||
.else [ ifn 10x&.10x, its==0 ? 20x==0 ? dec==0
|
||||
.else [ ifn 20x&.20x, its==0 ? 10x==0 ? dec==0
|
||||
.else [ ifn dec&.dec, its==0 ? 10x==0 ? 20x==0
|
||||
.else [ $$ask==1
|
||||
]]]]
|
||||
]
|
||||
ifn $$ask*<its+10x+20x+dec-1>,[
|
||||
define system ; need macro to use .TAG and .GO
|
||||
.tag retry
|
||||
printx "System? "
|
||||
.ttymac -response
|
||||
ifn its, ifse [response][ITS] 10x==0 ? 20x==0 ? dec==0 ? .stop
|
||||
ifn 10x, ifse [response][Tenex] its==0 ? 20x==0 ? dec==0 ? .stop
|
||||
ifn 20x, ifse [response][Tops-20] its==0 ? 10x==0 ? dec==0 ? .stop
|
||||
ifn 20x, ifse [response][Twenex] its==0 ? 10x==0 ? dec==0 ? .stop
|
||||
ifn dec, ifse [response][Tops-10] its==0 ? 10x==0 ? 20x==0 ? .stop
|
||||
ifn dec, ifse [response][Bots-10] its==0 ? 10x==0 ? 20x==0 ? .stop
|
||||
ifse [response][?]{
|
||||
printx "One of the following:
|
||||
"
|
||||
ifn its, printx " ITS "
|
||||
ifn 10x, printx " Tenex "
|
||||
ifn 20x, printx " Twenex "
|
||||
ifn dec, printx " Tops-10 "
|
||||
printx "
|
||||
"
|
||||
.go retry
|
||||
}
|
||||
ifb [response]{
|
||||
ifn its&.its, 10x==0 ? 20x==0 ? dec==0 ? .stop
|
||||
ifn 10x&.10x, its==0 ? 20x==0 ? dec==0 ? .stop
|
||||
ifn 20x&.20x, its==0 ? 10x==0 ? dec==0 ? .stop
|
||||
ifn dec&.dec, its==0 ? 10x==0 ? 20x==0 ? .stop
|
||||
}
|
||||
printx |"response" is not valid. Type "?" for list.
|
||||
|
|
||||
.go retry
|
||||
termin
|
||||
termin
|
||||
system ; ask which system to assemble for
|
||||
expunge system ; macro is no longer needed
|
||||
]
|
||||
|
||||
tnx==10x\20x ; TNX iff either 10X or 20X
|
||||
|
||||
|
||||
; Now that the operating system is determined, pick an output format.
|
||||
ifndef $$rel, $$rel==:0 ; default is not to use crufty linkers
|
||||
ife $$rel,[
|
||||
ifn its, ife .its, sblk
|
||||
ife its, .decsav
|
||||
]
|
||||
ifn $$rel,[
|
||||
ifn its, relocatable
|
||||
ife its, .decrel
|
||||
]
|
||||
|
||||
; Remove the multitude of output format pseudos now that we've picked one.
|
||||
expunge .decsav,.decrel,.dectwo,.sldr,1pass,relocatable,rim,rim10,sblk
|
||||
|
||||
|
||||
ifn its, ife .its, .insrt itsdfs
|
||||
ifn tnx,[
|
||||
ife .tnx,[
|
||||
ifn .its,[
|
||||
.insrt sys;tnxdfs
|
||||
.tnxjs
|
||||
.insrt sys;twxbts
|
||||
]
|
||||
ife .its,[
|
||||
.insrt tnxdfs
|
||||
.tnxjs
|
||||
.insrt twxbts
|
||||
]
|
||||
]
|
||||
]
|
||||
ifn dec,[
|
||||
ife .dec, [
|
||||
ifn .its,[
|
||||
.insrt sys;decdfs
|
||||
.insrt sys;decbts
|
||||
]
|
||||
ife .its,[
|
||||
.insrt decdfs
|
||||
.insrt decbts
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
; Page size definitions
|
||||
ifn its, pg$log==:10.
|
||||
ifn tnx, pg$log==:9.
|
||||
ifn its\tnx,[
|
||||
pg$siz==:1_pg$log
|
||||
pg$msk==:pg$siz-1
|
||||
]
|
||||
BIN
src/syseng/tctyp.153
Executable file
BIN
src/syseng/tctyp.153
Executable file
Binary file not shown.
Reference in New Issue
Block a user