- added switch/case processing. Right now it is just a sequence of test/jmp instructions. It may make sense to add a special opcode that can perform the comparisons natively but that's an option for later.
- added a TESTN instruction. This is like TEST but negates the operand. This was added to avoid flooding the constant table with too many case labels. With TEST and TESTN combined, all numbers between -65535 and 65535 can be kept entirely inside the instruction. Numbers outside this range still use a BEQ instruction.
This commit is contained in:
parent
6587828e32
commit
f9cd2c9af7
6 changed files with 304 additions and 2 deletions
|
|
@ -372,6 +372,13 @@ begin:
|
|||
pc++;
|
||||
}
|
||||
NEXTOP;
|
||||
OP(TESTN):
|
||||
ASSERTD(a);
|
||||
if (-reg.d[a] != BC)
|
||||
{
|
||||
pc++;
|
||||
}
|
||||
NEXTOP;
|
||||
OP(JMP):
|
||||
pc += JMPOFS(pc);
|
||||
NEXTOP;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue