IF (pgmVersion # 0)
THEN {
beginReject[h, CrRPC.noSuchVersion];
CrRPC.PutCARDINAL[h, 0]; --low
CrRPC.PutCARDINAL[h, 0]; --high
RETURN
};
SELECT proc
FROM
4 => {
-- PokeSeqShort
address: CARD;
args: RapunzelP1620V0.SeqShort;
address ← CrRPC.GetCARD[h];
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
args ← NEW[RapunzelP1620V0.SeqShortObject[length1]];
FOR i0:
CARDINAL
IN [0..length1)
DO
args.body[i0] ← CrRPC.GetCARDINAL[h];
ENDLOOP;
};
[] ← PokeSeqShort[h, address, args];
beginReturn[h];
};
6 => {
-- PokeLong
address: CARD;
arg: CARD;
address ← CrRPC.GetCARD[h];
arg ← CrRPC.GetCARD[h];
[] ← PokeLong[h, address, arg];
beginReturn[h];
};
0 => {
-- DoCmds
cmds: RapunzelP1620V0.SeqCmd;
results: RapunzelP1620V0.SeqResult;
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
cmds ← NEW[RapunzelP1620V0.SeqCmdObject[length1]];
FOR i0:
CARDINAL
IN [0..length1)
DO
TRUSTED {
tag2: RapunzelP1620V0.OpCode ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2
FROM
peekShort => {
x3: RapunzelP1620V0.PeekShortCmd;
x3.address ← CrRPC.GetCARD[h];
cmds.body[i0] ← [peekShort[x3]];
};
pokeShort => {
x4: RapunzelP1620V0.PokeShortCmd;
x4.address ← CrRPC.GetCARD[h];
x4.value ← CrRPC.GetCARDINAL[h];
cmds.body[i0] ← [pokeShort[x4]];
};
ENDCASE;
};
ENDLOOP;
};
[results] ← DoCmds[h, cmds];
beginReturn[h];
CrRPC.PutCARDINAL[h, results.length];
FOR i0:
CARDINAL
IN [0..results.length)
DO
CrRPC.PutCARDINAL[h, ORD[results.body[i0].type]];
WITH results.body[i0]
SELECT
FROM
it: peekShort RapunzelP1620V0.Result => {
CrRPC.PutCARDINAL[h, it.peekShort.value];
};
it: pokeShort RapunzelP1620V0.Result => {
NULL; -- RECORD []
};
ENDCASE;
ENDLOOP;
};
5 => {
-- PeekLong
address: CARD;
result: CARD;
address ← CrRPC.GetCARD[h];
[result] ← PeekLong[h, address];
beginReturn[h];
CrRPC.PutCARD[h, result];
};
3 => {
-- PeekSeqShort
address: CARD;
count: CARDINAL;
results: RapunzelP1620V0.SeqShort;
address ← CrRPC.GetCARD[h];
count ← CrRPC.GetCARDINAL[h];
[results] ← PeekSeqShort[h, address, count];
beginReturn[h];
CrRPC.PutCARDINAL[h, results.length];
FOR i0:
CARDINAL
IN [0..results.length)
DO
CrRPC.PutCARDINAL[h, results.body[i0]];
ENDLOOP;
};
1 => {
-- PeekShort
address: CARD;
result: CARDINAL;
address ← CrRPC.GetCARD[h];
[result] ← PeekShort[h, address];
beginReturn[h];
CrRPC.PutCARDINAL[h, result];
};
2 => {
-- PokeShort
address: CARD;
arg: CARDINAL;
address ← CrRPC.GetCARD[h];
arg ← CrRPC.GetCARDINAL[h];
[] ← PokeShort[h, address, arg];
beginReturn[h];
};
ENDCASE => {
beginReject[h, CrRPC.noSuchProcedure];
};