~jakob/chip

fda114b48f16caac4362b7205ef7111db264d7cc — Jakob L. Kreuze 4 years ago 438e75b
Implement JP + V0 and RND
1 files changed, 9 insertions(+), 0 deletions(-)

M main.myr
M main.myr => main.myr +9 -0
@@ 178,6 178,15 @@ const main = {
            I = (opcode & 0x0f : uint16)
            I <<= 8
            I |= (arg : uint16)
        // JP + V0
        | 0xb:
            pc = (opcode & 0x0f : uint16)
            pc <<= 8
            pc |= (arg : uint16)
            pc += (reg[0] : uint16)
        // RND
        | 0xc:
            reg[opcode & 0x0f] = std.rand(0, 256) & arg
        | _ : std.die("unimplemented opcode\n")
        ;;
        pc += 2