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
rom
namespace. -
labels for ZX Spectrum 16/48K memory layout in the
mem
namespace. -
labels for ZX Spectrum 128K memory layout in the
mem128
namespace. -
labels for TC2048/2068 (SCLD) screen memory layout in the
memT2k
namespace. -
labels for ZX Spectrum 16/48K basic and system variables in the
vars
namespace. -
labels for ZX Spectrum 128K system variables in the
vars128
namespace. -
labels for ZX Interface I variables in the
if1vars
namespace. -
labels for I/O ports of ULA, ZX Printer in the
io
namespace. -
labels for I/O ports of 128k MMU and AY-3-891x in the
io128
namespace. -
labels for I/O ports of TC2068, TS2068, TC2048 in the
ioT2k
namespace. -
labels for I/O ports of ULAplus in the
io_plus
namespace. -
labels for I/O ports of AY-3-891x in the
io_ay
namespace. -
labels for I/O ports of Kempston mouse and joystick in the
kempston_io
namespace. -
labels for I/O ports of the Fuller Box in the
fuller_io
namespace. -
Macros
for 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