Skip to main content

Storage directives

Hybrix relies on memory-mapped input/output (MMIO) for interacting with devices such as the keyboard, video display, and audio synthesizer. This means that the Chombit CPU does not provide any dedicated I/O port instructions. Instead, your program controls hardware devices by reading and writing to special memory locations. MMIO addresses are always located in the I/O segment, so their hexadecimal address will start with a $D. For example, $D0_0300 controls the background color of the screen, $D0_0011 enables the Jamdac system, and so forth.

You don't need to write Chombit assembly language code to access these addresses, however. The Hybrix language provides three storage directives that allow MMIO addresses to be accessed using ordinary program variables:

  • LOCATED AT assigns a specific memory address to a MODULE variable.
  • INSET eliminates pointers so that nesting objects get mapped to adjacent memory addresses.
  • Caret types prevent the garbage collector from inadvertently accessing addresses outside its heap.

Using these storage directives, the [IO] framework file defines the memory map for the Hybrix computer's hardware.