:Title[LJUMP.mc, November 5, 1982 9:21 AM, Masinter];

knowrbase[LTEMP0];
top level;
InsSet[LispInsSet, 1];

*--------------------------------------------------------------------
opJUMP:
* 1 or 2 byte jump
*--------------------------------------------------------------------
NextOpcode;

set[dx, 0];
repeat[20,
IFUjmp[add[200, dx], 1, ifuBR, 0, opJUMP, add[dx, 2]]
set[dx, add[dx,1]]];

IFUjmp[260, 2, ifuBR, 0, opJUMP, 1];
* signed long jump


*--------------------------------------------------------------------
opFJUMP:
* jump if NIL and pop
*--------------------------------------------------------------------
TSP← (fetch← TSP) - 1, flipMemBase;
T← Md, TSP← (fetch← TSP) - 1;
LEFT← (LEFT) + 1;
pd← T or Md;
branch[.+2, alu#0], T← Id - (PCX’) - 1;
NextOpcode;* take branch

PCF← T, branch[TL.NOP];

set[dx, 0];
repeat[20,
IFUjmp[add[220, dx], 1, StackM2BR, 0, opFJUMP, add[dx, 2]]
set[dx, add[dx,1]]];

IFUjmp[262, 2, StackM2BR, 0, opFJUMP, 1];

*--------------------------------------------------------------------
opTJUMP:
* jump if not NIL and pop
*--------------------------------------------------------------------
TSP← (fetch← TSP) - 1, flipMemBase;
T← Md, TSP← (fetch← TSP) - 1;
LEFT← (LEFT) + 1;
pd← T or Md;
branch[.+2, alu=0], T← Id - (PCX’) - 1;
NextOpcode;* take branch

PCF← T, branch[TL.NOP];

set[dx, 0];
repeat[20,
IFUjmp[add[240, dx], 1, StackM2BR, 0, opTJUMP, add[dx, 2]]
set[dx, add[dx,1]]];

IFUjmp[263, 2, StackM2BR, 0, opTJUMP, 1];

*--------------------------------------------------------------------
opNFJUMPX:
* jump if NIL, pop if no jump
*--------------------------------------------------------------------
T← (fetch← TSP) - 1, flipMemBase;
LTEMP0← Md, fetch← T;
LEFT← (LEFT) + 1;
pd← (LTEMP0) or Md;
branch[.+2, alu#0], T← Id - (PCX’) - 1;
LEFT← (LEFT) - 1, NextOpcode;* take branch

PCF← T;
TSP← (TSP) - (2c);
NextOpcode;

IFUjmp[264, 2, StackM2BR, 0, opNFJUMPX, 1];

*--------------------------------------------------------------------
opNTJUMPX:
* jump if not NIL and pop
*--------------------------------------------------------------------
T← (fetch← TSP) - 1, flipMemBase;
LTEMP0← Md, fetch← T;
LEFT← (LEFT) + 1;
pd← (LTEMP0) or Md;
branch[.+2, alu=0], T← Id - (PCX’) - 1;
LEFT← (LEFT) - 1, NextOpcode;* take branch

PCF← T, branch[TL.DECTSP2];

IFUjmp[265, 2, StackM2BR, 0, opNTJUMPX, 1];

*--------------------------------------------------------------------
opJUMPXX:
* Long jump, relative to byte 0
*--------------------------------------------------------------------
T← Id;
T← lsh [T, 10];
T← Id + T;
T← T - (PCX’) - 1;
PCF← T, branch[TL.NOP];

IFUpause[261, 3, ifuBR, 0, opJUMPXX, noNData, 0, 0];