galaxy-team/libsaturn — pull request #6 by MadMockers (2013-08-22 12:05:53+00:00)
Title: Fixed bug where certain operations following a 'skip' cause PC to be incremented too many times

Fixed bug where certain operations following a 'skip' (a false condition, such as IFE 0, 1) would cause PC to be incremented where it should not be.

For example:
```
SET A, 0
IFE 1, 0
HWN 0
SET A, 1
SET B, 1
```

Here, IFE 1, 0 will obviously cause HWN 0 to be skipped. However the bug will cause PC to be incremented twice, instead of just once (as HWN 0 assembles to a single word), which causes SET A, 1 to be skipped.
After running, the registers will be A: 0, B: 1, where it should be A: 1, B: 1

This is because the special opcode, HWN, is treated as an argument. Argument types 0x10-0x17 (and others, however they don't affect any special opcodes as they are undefined) cause an extra word to be read. HWN, HWQ, and HWI all fall within the range 0x10-0x17.