FANDOM


Overview

Chip8 is a programming language originally designed for small hobbyist computers.

The language is programmed as a set of two byte coded instruction.

Each instruction can reference one or more variables or a 12 bit address.

It has 16 variables named v0 to vf which each can hold a single byte.

Vf can be used as a variable as normal but is also altered when addition, subtraction or a shift left or right result in an overflow or an underflow of a resulting byte value occurs.

The vf variable is also used to signify that one or more on bits of a Draw operation has overlapped existing on bits in screen memory.

These values are stored within the RAM of the microcomputer it is running on.

The 12 bit address or 3 hex digits can allow manipulation of data or point to an image made of a series of bytes.

Instructions can set variables, add, subtract values, apply bit operations and be used to place images on a bitmapped area of memory.

This memory is then displayed through the microcomputer's video output which is usually a TV tuned to a VHF or UHF channel.

Microcomputers are generally emulated and present their screens as windows in a modern operating system.

Machine Implementations

ETI 660

In machines like the ETI 660, variables are stored in locations $0470 to $047F.

The image pointer is held in the 1802 CPU register RA.

Due to how this machines ROM interpreter sets up internal registers to hold parts of the instruction opcode, the Image register or RA can actually be set up as 7A00 even if the address 0A00 is specified.

This can cause issues if an emulator is running 1802 code which assumes that the RA register has this $7n type of value.

The screen memory stats at $0480 and runs to $05FF.

The programming memory available is usually from $0600 to $0FFF for a fully expanded machine.

Sound beeps are available with the added ability to be able to specific a pitch from 0 to $FF for the sound.

Sound can generated using the Pitch and Sound Timer instructions.

Sound can also be set from within 1802 machine code programs by an OUT output instruction and setting the 1802 Q output line to on.

ELF

Variables are stored from $0EF0 to $0EFF (?).

Sound is restricted to a single fixed pitch.

The sound length can be varied using the Sound instruction.

Screen memory is from $0F00 to $0FFF (?).

Dream 6800

See Also

  • Read about the next version of Chip8, SuperChip.