LarkWorkCommandsD.mesa
L. Stewart, December 22, 1983 2:51 pm
DIRECTORY
Convert USING [CardFromRope, Error],
LarkWork USING [LarkWorkProc, RegisterLarkWorkProc],
LarkPrograms USING [AddOrReplaceProgram, Program, ReadProgramFromMBFile],
Rope USING [ROPE],
TeleLoad USING [CoreAddress];
LarkWorkCommandsD: CEDAR PROGRAM
IMPORTS Convert, LarkPrograms, LarkWork =
BEGIN
BadArgsRope: Rope.ROPE = "Bad Arguments\n";
ParseMBProgram: LarkWork.LarkWorkProc = {
ENABLE {
Convert.Error => GOTO BadArgs;
};
program: LarkPrograms.Program;
baseAddress: TeleLoad.CoreAddress;
IF argv.argc < 2 THEN RETURN;
IF argv.argc = 3 THEN baseAddress ← Convert.CardFromRope[argv[2], 16]
ELSE baseAddress ← 0E000H;
program ← LarkPrograms.ReadProgramFromMBFile[mbFileName: argv[1], baseAddress: baseAddress, log: lark.h.log, addressSpace: IF capital THEN slave ELSE main];
IF program # NIL THEN LarkPrograms.AddOrReplaceProgram[program];
EXITS
BadArgs => RETURN[BadArgsRope];
};
Register all the commands
LarkWork.RegisterLarkWorkProc[proc: ParseMBProgram, key: "MBParse", caseMatters: FALSE, doc: "Read a program from disk", usage: "[m/M]BParse programName {base}, m => main CPU, M => slave CPU"];
END.
August 26, 1983 1:34 pm, LCS, created
December 22, 1983 2:51 pm, LCS, Cedar 5