View Source Chip8.Interpreter.VRegisters (chip8 v1.0.0)

General purpose variable registers.

Registers are numbered from 0 to F and have a size of 8 bits. They are usually refered as V registers through the notation Vx, where x is a hexadecimal number.

Some instructions use VF as a flag register, setting it to either 0 or 1 depending of the operation, for this reason most programs tend to avoid relying on this register to store data.

Link to this section Summary

Link to this section Types

@type register() :: 0..15
@type t() :: %Chip8.Interpreter.VRegisters{data: %{required(register()) => byte()}}

Link to this section Functions

Link to this function

get(v_registers, register)

View Source
@spec get(t(), register()) :: non_neg_integer()
@spec new() :: t()
Link to this function

set(v_registers, register, value)

View Source
@spec set(t(), register(), non_neg_integer()) :: t()