InstallNormalManger:
PROCEDURE [
address: BreakWorldArchitecture.Address,
manger: BreakWorldArchitecture.Address,
patchCode: BreakWorldArchitecture.Address]
RETURNS [] ~ {
errorCode: MIPSManger.ErrorCode ← MIPSManger.nullErrorCode;
errorMessage: MIPSManger.ErrorMessage ← MIPSManger.nullErrorMessage;
instructionAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: address];
nextAddress: BreakWorldArchitecture.Address ~ BreakWorldArchitecture.NextInstruction[pc: address];
nextInstructionAddress: MIPSArchitecture.MIPSAddress ~ MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: nextAddress];
continueAddress: BreakWorldArchitecture.Address ~ BreakWorldArchitecture.NextInstruction[pc: nextAddress];
continueInstructionAddress: MIPSArchitecture.MIPSAddress ~ MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: continueAddress];
mangerMIPSAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: manger];
normalManger: MIPSManger.NormalManger;
{
instruction: MIPSArchitecture.MIPSInstruction ~
MIPSBreakWorldUtilities.MIPSInstructionFromBreakWorldAddress[address: address];
sheep1Address: MIPSArchitecture.MIPSAddress ~
MIPSArchitecture.MIPSAddressFromDisplacement[
address: mangerMIPSAddress, displacement: Sheep1Offset[]];
relocated: MIPSArchitecture.MIPSInstruction ~ MIPSArchitecture.Relocate[
instruction: instruction,
from: instructionAddress,
to: sheep1Address
! MIPSArchitecture.CantRelocate => {
errorCode ← $CantRelocate;
errorMessage ← "Cannot relocate instruction at breakpoint address";
GO TO Cannot;
}];
Is this the only transformation of the instruction that's required
normalManger.sheep1 ← relocated;
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: Sheep1Offset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: normalManger.sheep1]];
EXITS
Cannot => {
ERROR CantInstall[code: errorCode, message: errorMessage];
};
};
{
instruction: MIPSArchitecture.MIPSInstruction ~
MIPSBreakWorldUtilities.MIPSInstructionFromBreakWorldAddress[address: nextAddress];
sheep2Address: MIPSArchitecture.MIPSAddress ~
MIPSArchitecture.MIPSAddressFromDisplacement[
address: mangerMIPSAddress, displacement: Sheep2Offset[]];
relocated: MIPSArchitecture.MIPSInstruction ~ MIPSArchitecture.Relocate[
instruction: instruction,
from: instructionAddress,
to: sheep2Address
! MIPSArchitecture.CantRelocate => {
errorCode ← $CantRelocate;
errorMessage ← "Cannot relocate instruction at breakpoint address";
GO TO Cannot;
}];
Is this the only transformation of the instruction that's required
normalManger.sheep2 ← relocated;
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: Sheep2Offset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: normalManger.sheep2]];
EXITS
Cannot => {
ERROR CantInstall[code: errorCode, message: errorMessage];
};
};
{
normalContinueAddress: MIPSArchitecture.MIPSAddress ~
MIPSArchitecture.MIPSAddressFromDisplacement[
address: mangerMIPSAddress, displacement: NormalContinueOffset[]];
normalManger.normalContinue ← MIPSArchitecture.J[
pc: normalContinueAddress, to: continueInstructionAddress];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: NormalContinueOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: normalManger.normalContinue]];
};
{
normalManger.normalNoop ← MIPSArchitecture.Noop[];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: NormalNoopOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: normalManger.normalNoop]];
};
{
normalManger.tag ← MIPSArchitecture.
LUI[
hi: ORD[MIPSManger.MangerVariant.normal],
dest: MIPSArchitecture.Register.r0];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: TagOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: normalManger.tag]];
};
{
BreakWorldArchitecture.PokeContents[
address: manger,
displacement: TagOffset[]+4,
contents: LOOPHOLE[instructionAddress]];
};
{
link the patch into the running code.
patchMIPSAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: patchCode];
instruction: MIPSArchitecture.MIPSInstruction ~ MIPSArchitecture.J[
pc: instructionAddress, to: patchMIPSAddress];
nextInstruction: MIPSArchitecture.MIPSInstruction ~ MIPSArchitecture.Noop[];
BreakWorldArchitecture.PokeInstruction[
pc: address,
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: instruction]];
BreakWorldArchitecture.PokeInstruction[
pc: nextAddress,
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: nextInstruction]];
};
};
InstallBranchManger:
PROCEDURE [
address: BreakWorldArchitecture.Address,
manger: BreakWorldArchitecture.Address,
patchCode: BreakWorldArchitecture.Address]
RETURNS [] ~ {
errorCode: MIPSManger.ErrorCode ← MIPSManger.nullErrorCode;
errorMessage: MIPSManger.ErrorMessage ← MIPSManger.nullErrorMessage;
instructionAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: address];
nextAddress: BreakWorldArchitecture.Address ~ BreakWorldArchitecture.NextInstruction[pc: address];
nextInstructionAddress: MIPSArchitecture.MIPSAddress ~ MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: nextAddress];
continueAddress: BreakWorldArchitecture.Address ~ BreakWorldArchitecture.NextInstruction[pc: nextAddress];
continueInstructionAddress: MIPSArchitecture.MIPSAddress ~ MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: continueAddress];
mangerMIPSAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: manger];
branchManger: MIPSManger.BranchManger;
branchDelayBreakWorldAddress: BreakWorldArchitecture.Address ~ BreakWorldArchitecture.NextInstruction[pc: address];
branchContinueBreakWorldAddress: BreakWorldArchitecture.Address ~
BreakWorldArchitecture.NextInstruction[pc: branchDelayBreakWorldAddress];
{
instruction: MIPSArchitecture.MIPSInstruction ~
MIPSBreakWorldUtilities.MIPSInstructionFromBreakWorldAddress[address: address];
branchBAddress: MIPSArchitecture.MIPSAddress ~
MIPSArchitecture.MIPSAddressFromDisplacement[
address: mangerMIPSAddress, displacement: BranchBOffset[]];
relocated: MIPSArchitecture.MIPSInstruction ~ MIPSArchitecture.Relocate[
instruction: instruction,
from: instructionAddress,
to: branchBAddress
! MIPSArchitecture.CantRelocate => {
errorCode ← $CantRelocate;
errorMessage ← "Cannot relocate instruction at breakpoint address";
GO TO Cannot;
}];
Is this the only transformation of the instruction that's required
branchManger.branchB ← relocated;
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: BranchBOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: branchManger.branchB]];
EXITS
Cannot => {
ERROR CantInstall[code: errorCode, message: errorMessage];
};
};
{
branchDelayInstructionAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[
address: branchDelayBreakWorldAddress];
branchDelayAddress: MIPSArchitecture.MIPSAddress ~
MIPSArchitecture.MIPSAddressFromDisplacement[
address: mangerMIPSAddress, displacement: BranchDelayOffset[]];
branchDelayInstruction: MIPSArchitecture.MIPSInstruction ~
MIPSBreakWorldUtilities.MIPSInstructionFromBreakWorldAddress[
address: branchDelayBreakWorldAddress];
relocatedBranchDelayInstruction: MIPSArchitecture.MIPSInstruction ~
MIPSArchitecture.Relocate[
instruction: branchDelayInstruction,
from: branchDelayInstructionAddress,
to: branchDelayAddress
! MIPSArchitecture.CantRelocate => {
errorCode ← $CantRelocate;
errorMessage ←
"Cannot relocate instruction in delay slot of breakpoint address";
GO TO Cannot;
}];
branchManger.branchDelay ← relocatedBranchDelayInstruction;
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: BranchDelayOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: branchManger.branchDelay]];
EXITS
Cannot => {
ERROR CantInstall[code: errorCode, message: errorMessage];
};
};
{
branchContinueInstructionAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[
address: branchContinueBreakWorldAddress];
branchContinueAddress: MIPSArchitecture.MIPSAddress ~
MIPSArchitecture.MIPSAddressFromDisplacement[
address: mangerMIPSAddress, displacement: BranchContinueOffset[]];
branchManger.branchContinue ← MIPSArchitecture.J[
pc: branchContinueAddress, to: branchContinueInstructionAddress];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: BranchContinueOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: branchManger.branchContinue]];
};
{
branchManger.branchNoop ← MIPSArchitecture.Noop[];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: BranchNoopOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: branchManger.branchNoop]];
};
{
branchManger.tag ← MIPSArchitecture.
LUI[
hi: ORD[MIPSManger.MangerVariant.branch],
dest: MIPSArchitecture.Register.r0];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: TagOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: branchManger.tag]];
};
{
BreakWorldArchitecture.PokeContents[
address: manger,
displacement: TagOffset[]+4,
contents: LOOPHOLE[instructionAddress]];
};
{
link the patch into the running code.
patchMIPSAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: patchCode];
instruction: MIPSArchitecture.MIPSInstruction ~ MIPSArchitecture.J[
pc: instructionAddress, to: patchMIPSAddress];
nextInstruction: MIPSArchitecture.MIPSInstruction ~ MIPSArchitecture.Noop[];
BreakWorldArchitecture.PokeInstruction[
pc: address,
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: instruction]];
BreakWorldArchitecture.PokeInstruction[
pc: nextAddress,
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: nextInstruction]];
};
};
InstallCallManger:
PROCEDURE [
address: BreakWorldArchitecture.Address,
manger: BreakWorldArchitecture.Address,
patchCode: BreakWorldArchitecture.Address]
RETURNS [] ~ {
callManger: MIPSManger.CallManger;
instruction: MIPSArchitecture.MIPSInstruction ~
MIPSBreakWorldUtilities.MIPSInstructionFromBreakWorldAddress[address: address];
instructionTargetAddress: TargetArchitecture.Address ~
BreakWorldArchitecture.TargetAddressFromBreakWorldAddress[address: address];
instructionAddress: MIPSArchitecture.MIPSAddress ~
MIPSArchitecture.MIPSAddressFromTargetAddress[address: instructionTargetAddress];
mangerMIPSAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: manger];
{
addressFormat: MIPSArchitecture.AddressFormat ~ [
high: MIPSArchitecture.GetHighOrderBits[instructionAddress],
target: MIPSArchitecture.GetDisp26[instruction],
tag: 0];
callTargetAddress: MIPSArchitecture.MIPSAddress ~ LOOPHOLE[addressFormat];
callManger.callJ ← MIPSArchitecture.J[
pc: mangerMIPSAddress, to: callTargetAddress];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: CallJOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: callManger.callJ]];
};
{
callManger.callNoop ← MIPSArchitecture.Noop[];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: CallNoopOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: callManger.callNoop]];
};
{
callManger.dummy1 ← MIPSArchitecture.Noop[];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: Dummy1Offset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: callManger.dummy1]];
};
{
callManger.dummy2 ← MIPSArchitecture.Noop[];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: Dummy2Offset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: callManger.dummy2]];
};
{
callManger.tag ← MIPSArchitecture.
LUI[
hi: ORD[MIPSManger.MangerVariant.call],
dest: MIPSArchitecture.Register.r0];
BreakWorldArchitecture.PokeInstruction[
pc: manger,
displacement: TagOffset[],
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: callManger.tag]];
};
{
BreakWorldArchitecture.PokeContents[
address: manger,
displacement: TagOffset[]+4,
contents: LOOPHOLE[instructionAddress]];
};
{
link the patch into the running code.
patchMIPSAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: patchCode];
instruction: MIPSArchitecture.MIPSInstruction ~ MIPSArchitecture.
JAL[
pc: instructionAddress, to: patchMIPSAddress];
BreakWorldArchitecture.PokeInstruction[
pc: address,
instruction: MIPSArchitecture.TargetInstructionFromMIPSInstruction[
instruction: instruction]];
};
};
InstallJumpManger:
PROCEDURE [
address: BreakWorldArchitecture.Address,
manger: BreakWorldArchitecture.Address,
patchCode: BreakWorldArchitecture.Address]
RETURNS [] ~ {
errorCode: MIPSManger.ErrorCode ← MIPSManger.nullErrorCode;
errorMessage: MIPSManger.ErrorMessage ← MIPSManger.nullErrorMessage;
instructionAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: address];
mangerMIPSAddress: MIPSArchitecture.MIPSAddress ~
MIPSBreakWorldUtilities.MIPSAddressFromBreakWorldAddress[address: manger];
jumpManger: MIPSManger.JumpManger;
jumpDelayBreakWorldAddress: BreakWorldArchitecture.Address ~ BreakWorldArchitecture.NextInstruction[pc: address];
Manger offsets:
Sheep1Offset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.NormalManger;
mangerAddress: LONG POINTER TO MIPSManger.NormalManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
sheep1Address:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.sheep1;
sheep1Card: CARD32 ~ LOOPHOLE[sheep1Address];
offset ← (sheep1Card - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
Sheep2Offset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.NormalManger;
mangerAddress: LONG POINTER TO MIPSManger.NormalManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
sheep2Address:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.sheep2;
sheep2Card: CARD32 ~ LOOPHOLE[sheep2Address];
offset ← (sheep2Card - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
NormalContinueOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.NormalManger;
mangerAddress: LONG POINTER TO MIPSManger.NormalManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
normalContinueAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.normalContinue;
normalContinueCard: CARD32 ~ LOOPHOLE[normalContinueAddress];
offset ← (normalContinueCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
NormalNoopOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.NormalManger;
mangerAddress: LONG POINTER TO MIPSManger.NormalManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
normalNoopAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.normalNoop;
normalNoopCard: CARD32 ~ LOOPHOLE[normalNoopAddress];
offset ← (normalNoopCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
TagOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.NormalManger;
mangerAddress: LONG POINTER TO MIPSManger.NormalManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
tagAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.tag;
tagCard: CARD32 ~ LOOPHOLE[tagAddress];
offset ← (tagCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
BranchBOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.BranchManger;
mangerAddress: LONG POINTER TO MIPSManger.BranchManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
branchBAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.branchB;
branchBCard: CARD32 ~ LOOPHOLE[branchBAddress];
offset ← (branchBCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
BranchDelayOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.BranchManger;
mangerAddress: LONG POINTER TO MIPSManger.BranchManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
branchDelayAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.branchDelay;
branchDelayCard: CARD32 ~ LOOPHOLE[branchDelayAddress];
offset ← (branchDelayCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
BranchContinueOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.BranchManger;
mangerAddress: LONG POINTER TO MIPSManger.BranchManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
branchContinueAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.branchContinue;
branchContinueCard: CARD32 ~ LOOPHOLE[branchContinueAddress];
offset ← (branchContinueCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
BranchNoopOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.BranchManger;
mangerAddress: LONG POINTER TO MIPSManger.BranchManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
branchNoopAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.branchNoop;
branchNoopCard: CARD32 ~ LOOPHOLE[branchNoopAddress];
offset ← (branchNoopCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
CallJOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.CallManger;
mangerAddress: LONG POINTER TO MIPSManger.CallManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
callJAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.callJ;
callJCard: CARD32 ~ LOOPHOLE[callJAddress];
offset ← (callJCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
CallNoopOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.CallManger;
mangerAddress: LONG POINTER TO MIPSManger.CallManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
callNoopAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.callNoop;
callNoopCard: CARD32 ~ LOOPHOLE[callNoopAddress];
offset ← (callNoopCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
JumpJOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.JumpManger;
mangerAddress: LONG POINTER TO MIPSManger.JumpManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
jumpJAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.jumpJ;
jumpJCard: CARD32 ~ LOOPHOLE[jumpJAddress];
offset ← (jumpJCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
JumpNoopOffset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.JumpManger;
mangerAddress: LONG POINTER TO MIPSManger.JumpManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
jumpNoopAddress:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.jumpNoop;
jumpNoopCard: CARD32 ~ LOOPHOLE[jumpNoopAddress];
offset ← (jumpNoopCard - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
Dummy1Offset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.JumpManger;
mangerAddress: LONG POINTER TO MIPSManger.JumpManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
dummy1Address:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.dummy1;
dummy1Card: CARD32 ~ LOOPHOLE[dummy1Address];
offset ← (dummy1Card - mangerCard) * BYTES[UNIT];
RETURN [offset];
};
Dummy2Offset:
PROCEDURE []
RETURNS [TargetArchitecture.Displacement] ~
TRUSTED {
offset: TargetArchitecture.Displacement ← TargetArchitecture.nullDisplacement;
manger: MIPSManger.JumpManger;
mangerAddress: LONG POINTER TO MIPSManger.JumpManger ~ @manger;
mangerCard: CARD32 ~ LOOPHOLE[mangerAddress];
dummy2Address:
LONG
POINTER
TO MIPSArchitecture.MIPSInstruction ~
@manger.dummy2;
dummy2Card: CARD32 ~ LOOPHOLE[dummy2Address];
offset ← (dummy2Card - mangerCard) * BYTES[UNIT];
RETURN [offset];
};