Though not a real register, the operand "(hl)" fits in
better with the 8-bit registers than it does with the
sixteen bit ones. As such, move its definition.
Also, define useful values for the 8-bit operands rather
than arbitrary ones.
When getting the register index, an incorrect shift was being
used. Fix the test case by correcting this.
Signed-off-by: Max Regan <mgregan2@gmail.com>
Since we have direct access to registers via name by "cpu->a" and the
like. Use that notation in a few more places since it is far more concise.
Signed-off-by: Max Regan <mgregan2@gmail.com>
The HL dereference operations cause problems indexing into the
registers array, because it causes a hole in the array that only
exists in the 8-bit register space.
Instead of accessing the registers directly by the same indices used
in in the assembly instructions, create a lookup table to map between
them.
Signed-off-by: Max Regan <mgregan2@gmail.com>
It makes them more amenable to using their names as the
names of the lcov output reports, which complains about
the dashes.
Signed-Off-By: Max Regan <mgregan2@gmail.com>