class ZXLib::Sys
A module with Z80 macros for common ZX Spectrum system tasks.¶ ↑
Contains:
-
labels for some of ZX Spectrum 16/48K ROM routine addresses in the
romnamespace. -
labels for ZX Spectrum 16/48K memory layout in the
memnamespace. -
labels for ZX Spectrum 128K memory layout in the
mem128namespace. -
labels for TC2048/2068 (SCLD) screen memory layout in the
memT2knamespace. -
labels for ZX Spectrum 16/48K basic and system variables in the
varsnamespace. -
labels for ZX Spectrum 128K system variables in the
vars128namespace. -
labels for ZX Interface I variables in the
if1varsnamespace. -
labels for I/O ports of ULA, ZX Printer in the
ionamespace. -
labels for I/O ports of 128k MMU and AY-3-891x in the
io128namespace. -
labels for I/O ports of TC2068, TS2068, TC2048 in the
ioT2knamespace. -
labels for I/O ports of ULAplus in the
io_plusnamespace. -
labels for I/O ports of AY-3-891x in the
io_aynamespace. -
labels for I/O ports of Kempston mouse and joystick in the
kempston_ionamespace. -
labels for I/O ports of the Fuller Box in the
fuller_ionamespace. -
Macrosfor various tasks tied to the ZX Spectrum hardware or ZXBasic.
Example:
require 'zxlib/sys' class Program include Z80 macro_import MathInt import ZXLib::Sys, macros: true open_chan create_chan_and_open output: output_p, chan_name: 'X' ret output_p # ... do something with register A # use memory hardware layout labels ld de, mem.attrs ld bc, mem.attrlen # use IY register to address VARS table ld a, [iy + vars.bordcr - vars_iy] # use VARS table directly ld hl, [vars.seed] # call ROM routines call rom.break_key report_error_unless C, 'D BREAK - CONT repeats' end