Text preview for : MiniNub.mesa_Oct77.pdf part of xerox MiniNub.mesa Oct77 xerox mesa 3.0_1977 listing MiniNub.mesa_Oct77.pdf
Back to : MiniNub.mesa_Oct77.pdf | Home
m1ninUB.mESA 24-0CT-77 18:38:25 Pago 1
-- MiniNub.Mesa
-- Edited by Sandman on October 6, 1977 4:02 PM
DIRECTORY
AltoFileDefs: FROM "altof11edefs",
ControlDefs: FROM "controldefs",
CoreSwapDefs: FROM "coreswapdefs",
FrameDefs: FROM "framedefs",
ImageDefs: FROM "imagedefs",
IODefs: FROM "iodefs",
LoaderDe's: FROM "loaderdefs",
SegmentDefs: FROM "segmentdefs",
StreamDefs: FROM "streamdefs",
Str1ngDefs: FROM "stringdefs";
MiniNub: PROGRAM
IMPORTS CoreSwapDefs, LoaderDefs, SegmentDefs, StreamDefs, StringOefs =
BEGIN
Program: TYPE = PROGRAM;
CallOebugger: PROCEDURE =
BEGIN -- user's entry point to debugger
state: ControIDefs.StateVector;
state.stkptr ~ 0;
state.X ~ defaultframe;
CoreSwapDefs.CoreSwap[explicitcall, @state];
RETURN
END;
BadFile: SIGNAL [name: STRING] = CODE;
_ LoadNew: PROCEDURE [name: STRING] RETURNS [Program] =
BEGIN
g: ControlDefs.GlobaIFrameHandle;
9 ~ FrameDefs.New[name f BadFile, LoaderDefs.VersionMismatch, UNWIND => NULL; A~Y => ERROq BadFile[na
Ume]] ;
IF 9 # ControlDe's.NULLFrame THEN defaultframe ~ g;
RETURN[LOOPHOLE[g]]
END;
defaultframe: ControlDefs.GlobalFrameHandle ~ REGISTER[ControIDefs.Greg];
comcmRequest: short ImageDefs.FileRequest ~ [
body: short[fill:, name: "Com.Cm."],
file: NIL,
access: SegmentDefs.Read.
link: ];
Done: SIGNAL = CODE;
debug, start: BOOLEAN;
ProcessSwitches: PROCEDURE [s: STRING] =
BEGIN
i: CARDINAL:
inverse: BOOLEAN ~ FALSE;
FOR i TN [0 .. s.length) DO
SELECT sCi] FROM
'd, '0 =) inverse ~ -(debug ~ TRUE);
's, 'S => IF inverse THEN inverse ~ start ~ FALSE ELSE stan .. TRUE;
'- => inverse .. TRUE;
ENOCASE =) inverse .. FALSE;
fNDLOOP;
rNO;
TnitSwitches: PROcrOURE = BEGTN debug" fALSE; start .. TRUE; [NO;
GelToken: PROCrOUR[ [com: StreamDers.Streamllandle, token, ext. switches: STRING]
BEG TN
s: STRING;
c: CIIARACTER;
token.length .. ext.length .. switches.length ~ 0;
s .. token;
WIIIlE -com.ondor[com] 00
mininUB.mESA 24-0CT-77 18:38:25 Page 2.
SELECT (c ~ com.get[com]) FROM
IODefs.SP, IODefs.CR =)
IF token.length # 0 OR ext. length # 0 OR switches. length # 0 THEN RETURN:
I. =) s ~ ext;
'I =) s ~ switches;
ENDCASE =) StringDefs.AppendChar[s, c];
ENDLOOP;
RETURN
END;
LoadSystems: PROCEDURE =
BEGIN
user: PROGRAM:
fa: AltoFileDefs.FA;
IF comcmRequest.file = NIL THEN RETURN;
SegmentDefs.LockFile[comcmRequest.file];
InitSwitches[] ;
SkipImage[@fa]:
IF debug THEN CallDebugger[]:
DO
InitSwitches[]:
user ~ LoadUser[@fa I Done =) EXIT]:
IF debug THEN CallDebugger[];
IF start AND user # LOOPHOLE[ControlDefs.NULLFrame] THEN START user:
ENDLOOP;
SegmentDefs.UnlockFile[comcmRequest.file];
SegmentDefs.ReleaseFile[comcmRequest.file];
END;
LoadUser: PROCEDURE [fa: POINTER TO AltoFileDefs.FA] RETURNS [user: Program]
BEGIN OPEN IODefs, StreamDefs;
com: StreamHandle;
name: STRING ~ [40];
ext: STRING ~ [10]:
switches: STRING ~ [5];
com ~ CreateByteStream[comcmRequest.file, Read];
BEGIN
StreamDefs.JumpToFA[com, fa I ANY =) GO TO finished]:
GetToken[com, name, ext, switches];
IF name. length = 0 THEN GO TO finished;
IF ext.length