HandCodingComfortsImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Peter Kessler, February 20, 1986 3:36:59 pm PST
DIRECTORY
HandCodingComforts,
HandCoding, HandCodingPseudos, DragOpsCross, DragOpsCrossUtils,
Rope USING [ROPE];
HandCodingComfortsImpl: CEDAR PROGRAM
IMPORTS HandCoding, HandCodingPseudos, DragOpsCrossUtils
EXPORTS HandCodingComforts = {
Prologue: PUBLIC PROCEDURE [name: Rope.ROPE, label: HandCodingPseudos.Label, args: INT] = {
associates the name with the label, defines the label and makes it global
HandCodingPseudos.ProcedureEntry[label, args];
HandCodingPseudos.MakeLabelGlobal[name, label];
};
Instructions that use labels
iDFC: PUBLIC PROC [dest: HandCodingPseudos.Label] = {
HandCoding.drDFC[HandCodingPseudos.UseLabel32[dest]];
};
iLFC: PUBLIC PROC [dest: HandCodingPseudos.Label] = {
HandCoding.drLFC[HandCodingPseudos.UseLabel16[dest]];
};
iJB: PUBLIC PROC [dest: HandCodingPseudos.Label] = {
HandCoding.drJB[HandCodingPseudos.UseLabel8A[dest]];
};
iJEQj: PUBLIC PROC [AlphaZ: HandCoding.Lit8, dest: HandCodingPseudos.Label] = {
HandCoding.drJEBBJ[AlphaZ, HandCodingPseudos.UseLabel8B[dest]];
};
iJNEj: PUBLIC PROC [AlphaZ: HandCoding.Lit8, dest: HandCodingPseudos.Label] = {
HandCoding.drJNEBBJ[AlphaZ, HandCodingPseudos.UseLabel8B[dest]];
};
iRJGTj: PUBLIC PROC [a: HandCoding.ShortRegSpec, b: HandCoding.RegSpec, dest: HandCodingPseudos.Label] = {
HandCoding.drRJGBJ[a, b, HandCodingPseudos.UseLabel8B[dest]];
};
iRJGEj: PUBLIC PROC [a: HandCoding.ShortRegSpec, b: HandCoding.RegSpec, dest: HandCodingPseudos.Label] = {
HandCoding.drRJGEBJ[a, b, HandCodingPseudos.UseLabel8B[dest]];
};
iRJEQj: PUBLIC PROC [a: HandCoding.ShortRegSpec, b: HandCoding.RegSpec, dest: HandCodingPseudos.Label] = {
HandCoding.drRJEBJ[a, b, HandCodingPseudos.UseLabel8B[dest]];
};
iRJNEj: PUBLIC PROC [a: HandCoding.ShortRegSpec, b: HandCoding.RegSpec, dest: HandCodingPseudos.Label] = {
HandCoding.drRJNEBJ[a, b, HandCodingPseudos.UseLabel8B[dest]];
};
iRJLEj: PUBLIC PROC [a: HandCoding.ShortRegSpec, b: HandCoding.RegSpec, dest: HandCodingPseudos.Label] = {
HandCoding.drRJLEBJ[a, b, HandCodingPseudos.UseLabel8B[dest]];
};
iRJLTj: PUBLIC PROC [a: HandCoding.ShortRegSpec, b: HandCoding.RegSpec, dest: HandCodingPseudos.Label] = {
HandCoding.drRJLBJ[a, b, HandCodingPseudos.UseLabel8B[dest]];
};
Miscellaneous other instructions
iWRI: PUBLIC PROC [BetaR: HandCoding.RegSpec, AlphaZ: HandCoding.Lit8, BetaL: HandCoding.RegSpec] = {
This just shuffles the operands around to make them appear in a reasonable order.
HandCoding.drWRI[BetaL, BetaR, AlphaZ];
};
``Macro''s
LoadConstant: PUBLIC PROC [value: INT ← 0] = {
with lookup by value
SELECT value FROM
0 => HandCoding.drLC0[];
1 => HandCoding.drLC1[];
2 => HandCoding.drLC2[];
3 => HandCoding.drLC3[];
4 => HandCoding.drLC4[];
-2 => HandCoding.drLC5[];
-1 => HandCoding.drLC6[];
? => HandCoding.drLC7[];
ENDCASE =>
SELECT value FROM
IN [0..255] => HandCoding.drLIB[value];
IN [256..65535] => HandCoding.drLIDB[value];
ENDCASE => HandCoding.drLIQB[DragOpsCrossUtils.IntToWord[value]];
};
}.