DIRECTORY DragOpsCross USING [FieldDescriptor, ProcessorRegister, Word], HandCoding, HandCodingSupport USING [Area], IO USING [STREAM], Rope USING [ROPE], SymTab USING [Ref]; HandCodingPseudos: CEDAR DEFINITIONS = BEGIN OPEN DragOpsCross, HandCoding; Label: TYPE = REF LabelRep; LabelRep: TYPE = RECORD [ area: HandCodingSupport.Area, -- area for definition of label (NIL if undefined) name: Rope.ROPE, -- the global name (if any) for this label offset: INT, -- offset for definition of label uses: REF -- uses of label that need fixing (internal) ]; SetLabel: PROC [label: Label]; GenLabel: PROC RETURNS [label: Label]; GenLabelHere: PROC RETURNS [label: Label]; UseLabel8A: PROC [label: Label] RETURNS [Lit8]; UseLabel8B: PROC [label: Label] RETURNS [Lit8]; UseLabel16: PROC [label: Label] RETURNS [Lit16]; UseLabel32: PROC [label: Label] RETURNS [Word]; MakeLabelGlobal: PROC [name: Rope.ROPE, label: Label]; GetGlobalLabel: PROC [name: Rope.ROPE] RETURNS [Label]; GetGlobalLabelTable: PROC [area: HandCodingSupport.Area _ NIL] RETURNS [SymTab.Ref]; ShowGlobalLabelTable: PROC [st: IO.STREAM, sortNames: BOOL _ TRUE, area: HandCodingSupport.Area _ NIL]; LReg: PROC [reg: RegSpec]; PReg: PROC [reg: RegSpec]; SReg: PROC [reg: RegSpec]; AddReg: PROC [reg: RegSpec, const: ConstSpec]; SubReg: PROC [reg: RegSpec, const: ConstSpec]; SetRegConst: PROC [reg: RegSpec, const: ConstSpec]; MoveReg: PROC [dst,src: RegSpec]; MoveRegI: PROC [dst,src: RegSpec, const: ConstSpec]; LRegI: PROC [reg: RegSpec, const: ConstSpec]; IndexedJump: PROC [dest: Label, long: BOOL _ FALSE, back: BOOL _ FALSE]; ProcedureEntry: PROC [label: Label, args: [0..15], dontChangeRL: BOOL _ FALSE]; ProcedureExit: PROC [rets: [0..15], dontChangeSP: BOOL _ FALSE, enableTraps: BOOL _ FALSE]; SetupField: PROC [fd: DragOpsCross.FieldDescriptor]; ExtractField: PROC [first: [0..31], bits: [0..31]]; ShiftLeft: PROC [bits: [0..31]]; LoadProcessorReg: PROC [which: DragOpsCross.ProcessorRegister]; StoreProcessorReg: PROC [which: DragOpsCross.ProcessorRegister]; EnableTraps: PROC; DisableTraps: PROC; CauseReschedule: PROC; CauseReset: PROC; GetSPLimit: PROC; SetSPLimit: PROC; GetL: PROC; SetL: PROC; GetYoungestPC: PROC; GetYoungestL: PROC; GetEldestPC: PROC; GetEldestL: PROC; SetYoungestPC: PROC; SetYoungestL: PROC; SetEldestPC: PROC; SetEldestL: PROC; Pause: PROC; Halt: PROC [code: CARDINAL]; END. dHandCodingPseudos.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Russ Atkinson (RRA) July 16, 1985 1:17:58 am PDT Pseudo-Op Declarations Labelling Use a label in the Alpha byte Use a label in the Beta byte shows the global label table for the given area to the given stream. If sortNames, then the labels come out sorted by name, otherwise sorted by address. Macros Uses the top of stack as a jump offset from the given label, and jumps there (popping the stack, of course). If long, then the label given can be more than 127 bytes away (32K bytes, actually). If back, then the dest label must occur before the jump, else it must occur after. Notes procedure entry. NOT dontChangeRL => generate procedure entry instruction generates the procedure return instruction dontChangeSP => RETN enableTraps => RETT ELSE => RET generates shifter control from the given field descriptor pieces generates the appropriate instruction to extract the specified bits from [S] generates the appropriate instruction to shift [S] left by bits IFU primitives (mostly translate to LIFUR, LEUR, SIFUR, SEUR) Loads the specified processor register onto the stack. Pops the stack into the specified processor register. ... enables reschedule interrupts and stack overflow. ... disables reschedule interrupts and stack overflow. ... causes a reschedule interrupt when interrupts are next enabled (possibly immediately). The state of traps enabled/disabled is not changed. ... causes a reset trap. ... enables/disables stack overflow trapping. ... enables/disables stack overflow trapping. The following pseudos are for convenience only. The IFU forces us to spend mucho cycles and bytes to determine these simple things (sigh). ... returns the current value of L. ... sets the current value of L. ... pushes the youngest PC entry in the IFU stack (into [S]). ... pushes the L part of the youngest IFU stack entry. ... pushes the eldest PC in the IFU stack and removes the eldest entry from the IFU stack. The results are undefined if there was no PC to get. ... pushes the L part of the eldest IFU stack entry. ... sets the youngest PC entry in the IFU stack (from [S]). S_S-1. ... sets the youngest L entry in the IFU stack (from [S]). S_S-1. ... causes a new eldest IFU stack entry to be created and sets the PC part of that entry (from [S]). S_S-1. ... sets the L part of the eldest IFU stack entry (from [S]). Interaction with the interpreter ... Instructs the interpreter to pause. This emits the X0 operation. ... Instructs the interpreter to halt. The code will be evident in the instruction trace. This emits the X377 operation. Κ°˜codešœ™Kšœ Οmœ7™BK™0K˜—šΟk ˜ Kšœ žœ,˜>Kšœ ˜ Kšœžœ˜Kšžœžœžœ˜Kšœžœžœ˜Kšœžœ˜—K˜Kš œžœž œžœžœ˜KK˜šœ™K˜™ K˜Kšœžœžœ ˜–40 sp tabStopsšœ žœžœ˜K–40 sp tabStopsšœΟc2˜PK–40 sp tabStopsšœ žœŸ*˜;K–40 sp tabStopsšœžœŸ!˜.K–40 sp tabStopsšœžœŸ,˜6K–40 sp tabStopsšœ˜—KšΟnœžœ˜Kš œžœžœ˜&Kš  œžœžœ˜*š  œžœžœ˜/Kšœ™—š  œžœžœ˜/Kšœ™—Kš  œžœžœ ˜0Kš  œžœžœ˜/K˜Kš œžœ žœ˜6Kš œžœ žœžœ ˜7Kš œžœ!žœžœ˜TK˜š œžœžœžœ žœžœ!žœ˜gKšœ™™™—K˜—™K˜Kš œžœ˜Kš œžœ˜Kš œžœ˜Kš œžœ"˜.Kš œžœ"˜.Kš  œžœ"˜3Kš œžœ˜!Kš œžœ&˜4Kš œžœ"˜-K˜š   œžœžœžœžœžœ˜HKšœ–™–—K˜š œžœ-žœžœ˜Ošœ™Kšœ8™8—K˜—š   œžœžœžœžœžœ˜[šœ*™*Kšœ™Kšœ™Kšœ ™ —K˜—š  œžœ$˜4K™@K˜—š  œžœ!˜3K™LK˜—š  œžœ˜ K™?K˜——š œ$Οfœ‘œ‘œ‘œ™=K˜š œžœ)˜?Kšœ6™6—š œžœ)˜@Kšœ5™5K˜—š  œžœ˜Kšœ5™5—š  œžœ˜Kšœ6™6—š œžœ˜Kšœ™—š  œžœ˜Kšœ™—K˜š  œžœ˜Kšœ-™-—š  œžœ˜Kšœ-™-—K˜šœ‹™‹š œžœ˜ Kšœ#™#—š œžœ˜ Kšœ ™ ——K˜š  œžœ˜Kšœ=™=—š  œžœ˜Kšœ8™8—š  œžœ˜Kšœ™—š  œžœ˜Kšœ6™6—š  œžœ˜KšœC™C—š  œžœ˜KšœB™B—š  œžœ˜Kšœl™l—š  œžœ˜Kšœ=™=—K˜—™ K˜š œžœ˜ KšœE™E—K˜š œžœžœ˜Kšœz™z—K˜—Kšžœ˜K˜—K˜—…— `t