HandCodingComforts.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Peter Kessler, February 20, 1986 3:33:16 pm PST
Russ Atkinson (RRA) September 10, 1986 11:11:40 pm PDT
DIRECTORY
DragOpsCross USING [Word],
HandCoding USING [const0, const1, constN1, ConstSpec, Lit8, RegSpec, ShortRegSpec],
HandCodingPseudos USING [Label],
Rope USING [ROPE];
HandCodingComforts: CEDAR DEFINITIONS = {
OPEN HandCoding, HandCodingPseudos;
Proc: TYPE = PROC [] RETURNS [];
all the code generating procedures are of this type.
Prologue: PROC [name: Rope.ROPE, label: Label, args: INT];
associates the name with the label, defines the label and makes it global
Instructions that use labels
iDFC: PROC [dest: Label];
iJB: PROC [dest: Label];
iJEQj: PROC [AlphaZ: Lit8, dest: Label];
iJNEj: PROC [AlphaZ: Lit8, dest: Label];
iLFC: PROC [dest: Label];
iRJGTj: PROC [a: ShortRegSpec, b: RegSpec, dest: Label];
iRJGEj: PROC [a: ShortRegSpec, b: RegSpec, dest: Label];
iRJEQj: PROC [a: ShortRegSpec, b: RegSpec, dest: Label];
iRJNEj: PROC [a: ShortRegSpec, b: RegSpec, dest: Label];
iRJLEj: PROC [a: ShortRegSpec, b: RegSpec, dest: Label];
iRJLTj: PROC [a: ShortRegSpec, b: RegSpec, dest: Label];
Miscellaneous other instructions
iWRI: PROC [BetaR: RegSpec, AlphaZ: Lit8, BetaL: RegSpec];
``Macro''s
LoadConstant: PROC [value: INT ← 0];
pushes an arbitrary constant onto the stack, using LC's where possible.
Specifiers
constants
Constant0: ConstSpec = const0;
Short0: ShortRegSpec = const0;
Constant1: ConstSpec = const1;
Short1: ShortRegSpec = const1;
ConstantMinus1: ConstSpec = constN1;
NIL
NILValue: INT = 0;
NILByte: Lit8 = 0;
ShortNIL: ShortRegSpec = const0;
ConstantNIL: ConstSpec = const0;
Booleans (BOOL: TYPE = {FALSE, TRUE};)
FALSEValue: INT = 0;
FALSEByte: Lit8 = 0;
ShortFALSE: ShortRegSpec = const0;
ConstantFALSE: ConstSpec = const0;
TRUEValue: INT = 1;
TRUEByte: Lit8 = 1;
ShortTRUE: ShortRegSpec = const1;
ConstantTRUE: ConstSpec = const1;
Short register specifiers
ShorttopSrc: ShortRegSpec = topSrc;
ShortpopSrc: ShortRegSpec = popSrc;
Other stuff
DataLabel: TYPE = DragOpsCross.Word;
Sizes are in addressing units.
SizeOfLongPointer: INT = 1;
SizeOfINT: INT = 1;
}.