There are 2 other files named ocsp.mac in the archive. Click here to see a list.
SUBTTL OCSP - Start a SIMULA program
SUBTTL Lars Enderin /LE/ 11-Oct-1972
.OCSP (start program)
To set up the environment for a SIMULA program. Called by a SIMULA
main program at its entry point.
XCB = outermost program block address. X1 = 0 or address of area
where SIMDDT is (to be) loaded. According to the calling sequence:
JFCL runswitches address
the address of a file specification string is passed as an inline
parameter following a JSP.
If X1 = 0, load X1 from YOCDDT, which is non-zero if SIMDDT
was loaded at a previous program start or reenter after GET
or LOAD. If X1 was non-zero, save it in YOCDDT for future
use. To guard against any breakpoint UUO's being left
around from a possible call on SIMDDT in the previous
execution, call OCSPDR, which makes sure there are no
breakpoints left. Save all accumulators in dynamic core.
GETSEG SIMRTS, if it was not loaded together with the object
code from the SIMULA compilation. If .OCSP was loaded, but
not SIMRTS, .JBOPS left half will be non-zero as a result of
a direct assignment in the OCSP module. SIMRTS, which must
be loaded after .OCSP, sets .JBOPS to zero at load time. At
load time, define the reentry point (.JBREN) as the address
of the code used to load SIMDDT.
Clear the static area. Initialize lookup and GETSEG info for
SIMDDT and the high segments. Set X2 to the address of
.YXAC (first pseudo ac), X3 = address (.MAINL) of the main
program line number table. When the selected run time
system is safely in core, pass control to .OCIN in SIMRTS by
a JRST instruction. .OCIN will finish the initialization
needed to start a SIMULA program.
All registers are saved in YACSAV[0-17](XLOW) as they were
on entry to OCSP. X2 contains the address of the first
pseudo ac location. X3 = .MAINL, the address of the main
program line number table.
X4 = address of .OCGS. The saved X16 value gives the
return to object code after RTS initialization, and the
saved value of X1 indicates where SIMDDT is (to be) loaded,
if it was requested by REENTER or the DEBUG command. The
cell .JBOPS has the address of the low segment STATIC area,
which is to be addressed via the register XLOW designated by
the LOWADR and SETLOW macros. Exit from OCSP is via a
branch to OCIN, which will eventually branch to OCEI, that
returns to object code.
If GETSEG of the high segment fails, return to monitor level
with monitor message Cannot GET SIMR??. If CORE
is scarce, EXIT 1, after ZYQNEC message. If the core limits
can be increased, CONTINUE will cause the core request to be
SUBTTL .OCSP - Routine to get the SIMULA RTS high segment
ENTRY .OCSP ;Main entry from a SIMULA main program to initialize RTS
.OCSP: L X10,XFP ; Save return for OCIN
ST X1,YOCDDT ;Save SIMDDT base or zero
JSR OCSPDR ;Reset any breakpoints in code
LI .OCRE1 ;Change reentry point
SKIPE .JBREN ; If it was not set, leave it
ST .JBREN ; undefined
RESET ;Reset all software channels
;and set .JBFF = .JBSA<LH>
HRRZ X17,.JBFF ;Get first free lowseg location
HRRM X17,.JBOPS ;Save as a base for STATIC area
LI X17,YLOW ;Space at least for STATIC area
ADDB X17,.JBFF ;Update .JBFF
IF ;Additional core is needed
THEN ;try to get it
GOTO RESERR ;Hard luck, must quit
SETLOW ;Standard base reg XLOW
L XLOW,.JBOPS ;Get base of STATIC area and left flags
; - Clear STATIC area -
ST X1,YDSBA1(XLOW) ;
ST XCB,YOCXCB(XLOW) ;
;Initialize GETSEG-LOOKUP info
IF ; No hiseg or not correct initial hiseg
L [-2,,.GTPRG] ; Get hiseg name
GOTO TRUE ;No hiseg
JUMPE FALSE ;Hiseg from same file as lowseg
GOTO FALSE ;Correct hiseg already
HRROI X1,.GTPRG ;Lowseg name
CAMN X1 ;Load if not same as hiseg
THEN ;GETSEG initial hiseg
ST X10,YACSAV+X10(XLOW) ;
L X10,YACSAV+X10(XLOW) ;
ELSE ; May have to use SETUWP to avoid store traps
IF ;Main prog in hiseg
THEN ;Remove write protection
CAI ;Ignore error ret (take a chance)
HRRZS XLOW,.JBOPS ; Clear .JBOPS<LH> to show hiseg loaded
LI X2,.YXAC ;First pseudo ac location
LI X3,.MAINL ;Line number table for SIMDDT
BRANCH OCIN ;Do rest of initialization
?ZYQNCA No core available - can not proceed
GOTO .OCSP ;Try again if CONTINUE command given
SUBTTL OCGS - Get a high segment; [1C]
Purpose: To GETSEG a high segment initially or at segment swap
X1 = SIXBIT name of wanted hiseg. Standard XLOW loaded.
Call: By JSR .OCGS or JSR @YOCGS(XLOW)
Function: Prevent REENTER by changing .JBREN.
Clear any previously loaded hiseg by CORE.
Try to GETSEG the high segment from YOCDEV(XLOW) with ppn=0.
If that fails, try same device with ppn=YOCPPN(XLOW).
On failure, the monitor gives an error message because of
the HALT placed after the last GETSEG.
Exit: To saved return address with new high segment loaded.
Error exit: To monitor on final GETSEG failure.
SETLOW ;Use standard XLOW
Z ;Call by JSR
ST X1,YOCHNM(XLOW) ;Hiseg name
LI .OCRE1 ;Save and change .JBREN
MOVSI X1,1 ;Set flag to clear any previously loaded hiseg
NOP ;Ignore errors
SETZM YOCPPN(XLOW) ;Try own area or sys first
GETSEG X1, ;Get the high segment
GOTO L9 ;Found first time
L X1,YRTPPN(XLOW);Try standard ppn if not found on own area
HALT ;Give up, cannot find requested hiseg
L YOCREN(XLOW) ;Restore .JBREN