DIRECTORY Basics USING [BYTE], ConvertUnsafe USING [EqualSubStrings, SubString, SubStringToRope], MopcodeNames USING [], OpTableDefs USING [], PrincOpsUtils USING [CodeBase, GlobalFrame], Rope USING [Flatten, Length, ROPE]; OpNames: PROGRAM IMPORTS ConvertUnsafe, MopcodeNames, PrincOpsUtils, Rope EXPORTS OpTableDefs = BEGIN CompStringDesc: TYPE = RECORD [offset, length: CARDINAL]; Names: LONG POINTER TO RECORD [ base: CARDINAL, mnemonic: ARRAY Basics.BYTE OF CompStringDesc]; base: LONG STRING; InstName: PUBLIC PROCEDURE [op: Basics.BYTE] RETURNS [Rope.ROPE] = BEGIN ss: ConvertUnsafe.SubString; ss.base _ base; [ss.offset, ss.length] _ Names.mnemonic[op]; RETURN[ConvertUnsafe.SubStringToRope[ss]] END; UnknownInstruction: PUBLIC SIGNAL [name: Rope.ROPE] = CODE; InstCode: PUBLIC PROCEDURE [name: Rope.ROPE] RETURNS [i: Basics.BYTE] = BEGIN sname, ss: ConvertUnsafe.SubString; ss.base _ base; sname.offset _ 0; sname.length _ name.Length[]; sname.base _ LOOPHOLE[Rope.Flatten[name]]; FOR i IN Basics.BYTE DO [ss.offset, ss.length] _ Names.mnemonic[i]; IF ConvertUnsafe.EqualSubStrings[ss, sname, FALSE] THEN EXIT; REPEAT FINISHED => BEGIN i _ 0; SIGNAL UnknownInstruction[name] END; ENDLOOP; RETURN; END; Init: PROC = { Names _ PrincOpsUtils.CodeBase[LOOPHOLE[PrincOpsUtils.GlobalFrame[MopcodeNames]]]; base _ Names.base + LOOPHOLE[Names, LONG STRING]}; Init[]; END. pfile: OpNames.mesa, edited by Bruce, 20-Jun-81 16:55:14 Last Edited by: Maxwell, August 12, 1983 8:37 am Ê2˜Jšœ7™7J™0J™šÏk ˜ Jšœœœ˜Jšœœ/˜BJšœ œ˜Jšœ œ˜Jšœœ˜,Jšœœœ˜#J˜—šœ ˜Jšœ2œ˜NJš˜J˜Jšœœœœ˜9J˜š œœœœœ˜Jš œœ œœœ˜?J˜—Jšœœœ˜J˜š Ïnœœ œ œœœ˜BJš˜J˜J˜J˜,Jšœ#˜)Jšœ˜J˜—Jš œœœ œœ˜;J˜š žœœ œ œœ œ˜GJš˜J˜#J˜J˜J˜Jšœ œ˜*šœœœ˜J˜+Jšœ*œœœ˜=Jš œœœœœ˜DJšœ˜—Jšœ˜Jšœ˜J˜—šžœœ˜Jšœœ+˜RJšœœœœ˜2J˜—J˜J˜Jšœ˜——…—h