#zx-spectrum #basic #8-bit #floating-point #zx81

zxnumber

Converter for the floating point number format used by the Sinclair home computers ZX Spectrum and ZX-81

1 unstable release

0.1.0 Jun 1, 2023

#252 in Emulators


Used in zxbasic

MIT/Apache

5KB
91 lines

zxnumber

Rust code for converting a floating point number into the format used by the ZX81 and ZX Spectrum computers (5 bytes floating point, with a special case for integers).


lib.rs:

Handles the number format used by the ZX81 and ZX Spectrum.

A number is stored as 5 bytes in one of two formats: A "small integer" which is an integer between -65535 and 65535, or a floating point with a sign bit, a 7 bit exponent and 32 bit mantissa.

No runtime deps