Fx75

Fx75 - Store registers to flag storage #

Assembly Syntax #

Octo: saveflags v<x>
Chipper: LD R,V<x>

Fx751111xxxx01110101

Available #

CHIP-8, CHIP-48, SUPER-CHIP, MEGA-CHIP, XO-CHIP

Description #

Stores the values of registers V0 through Vx (x <= 7) in memory, starting at the address stored in I.

It is directly related to 64 bits persistent flag storage on a HP-48SX calculator, that programs could write to or read from. These 64 bits on the calculator are global (so all programs see the same) and you can only fit 8 bytes in it, thus the limit to registers V0-V7.

NOTE:
Generic emulators are rather free to choose what “persistent flag storage” means. Typical options are:

  • static array that keeps the state independend of the emulation been reset or different programs loaded
  • shared file, that is fetched later on restart
  • per-ROM file that allows different programs to store their own state

If you choose a file, think about some kind of caching to not read from or write to the file on every opcode execution, as this would slow down the emulation but could also be executed in a tight loop. Use some cache and flush it on exit and optionally a periodic update on change at a limited rate.

Variant Specific Notes: #

XO-CHIP #

Not limited by the constraints of the calculator SUPER-CHIP was written for, XO-CHIP allows all registers to be stored and loaded, so x <= 15.


Built with ⎋ Hugo · Theme: ⎋ Hugo Book · chip8kb source ⎋ on GitHub