Вы находитесь на странице: 1из 18

DOCUMENTATION – WORK in PROGRESS!!

* Realvideo
Enabling realvideo:
-On Spectrum: rainbow effects on display & border, inves effects, snow effect, video out to file,
interlaced mode. Display drawn every scanline
-On ZX80/81: hi-resolution and non standard modes, loading/saving stripes, interlaced mode.
Display drawn every scanline

Without realvideo:
-On Spectrum: no rainbow, no inves effects, no snow effect, no video out, no interlaced. Display
drawn once per frame, supports simulated ZX80/81 Screen
-On ZX80/81: no hi-res, no loading/savig stripes, no interlaced. Display drawn once per frame, only
standard text mode

Rainbow Hi-res Inves Snow Video out Interlaced Load Stripes Simulated
ZX80/81
screen
Realvideo Y - Y Y Y Y - N
Spectrum
No realvideo N - N N N N - Y
Spectrum
Realvideo - Y - - Y Y Y -
ZX80/81
No real - N - - N N N -
ZX80/81

-Y: Supported
-N: Not supported
- - : Not aplicable

Realvideo supported on video drivers:


-Xwindows
-caca
-aa
-curses and stdout only for ZX80/81. No realvideo on spectrum for these drivers

xwindows caca aa curses stdout null


Spectrum Y Y Y N N N
ZX80/81 Y Y Y Y Y N

* Utilities:

1
SMPATAP Program to convert sound from a spectrum tape to .TAP files
TAPABIN Program to convert data from .TAP files to .BIN files
SP_Z80 Program to convert between SP and Z80 formats (only 48k)
LEEZX81 Program to convert sound from a zx81 tape to .P files

* Programs, made by me:

ARTILLER.TAP My first (very old) game made for ZX Spectrum


CANCIONE.TAP Program in BASIC with songs in PLAY format
CONVERSO.TAP Converter of source code between formats GENS, TED and SPED. It
also includes the source code
CURSORDR.TAP Painting program. It also includes the source code
MEMOEDIT.TZX Program to manipulate RAM. Includes the source code in GENS
format
REALDEBU.TAP Disassemblers for 48k and 128k, with source code
SPED52.TAP Assembler/disassembler for 128k. It also includes the source code in
his own format (SPED)
THELINER67.TZX Vectorial painting program. Made in Basic
THEPAINTER58.TZX Painting program. Made in Basic

Others:

ZX81:
MAZOGS.P Mazogs Game for the ZX81, by Don Priestley
3DMONSTERMAZE.P 3-D Monster Maze for the ZX81, by J. K. Greye Software
SOUND.P Program that makes some different sound tones through the cassette
port
ZX80:
QS Defenda (Quicksilva 1981) Reconstruction.o: Defender from Quicksilva. Uses QS Sound
chip. You may try it with the real video option; it uses a 32 row display

Snapshot Files

The first versions of my previous emulator (ZXSpectr) worked only with SP files, from the
SPECTRUM emulator by Pedro Gimeno. Then, I created my own file format, called ZX, which is
derived from SP format but with more extra data (ZX header is like SP but with 256 bytes more). I
know there's an emulator which uses files with extension ZX, but they aren't related with my ZX
files.
The description of SP format is the following (I have copied it from SPECTRUM.DOC without
changing anything):

Offset Longitud Descripción


0 2 bytes "SP" (53h, 50h) Signatura
2 1 palabra Longitud del programa en bytes (el emulador

2
Offset Longitud Descripción
actualmente sólo genera programas de 49152
bytes)
4 1 palabra Posición inicial del programa (el emulador
actualmente sólo genera programas que comiencen
en la pos. 16384)
6 1 palabra Registro BC del Z80
8 1 palabra Registro DE del Z80
10 1 palabra Registro HL del Z80
12 1 palabra Registro AF del Z80
14 1 palabra Registro IX del Z80
16 1 palabra Registro IY del Z80
18 1 palabra Registro BC' del Z80
20 1 palabra Registro DE' del Z80
22 1 palabra Registro HL' del Z80
24 1 palabra Registro AF' del Z80
26 1 byte Registro R (de refresco) del Z80
27 1 byte Registro I (de interrupciones) del Z80
28 1 palabra Registro SP del Z80
30 1 palabra Registro PC del Z80
32 1 palabra Reservada para uso futuro, siempre 0
34 1 byte Color del borde al comenzar
35 1 byte Reservado para uso futuro, siempre 0
36 1 palabra Palabra de estado codificada por bits.
Formato:
Bit Descripción
15-8 Reservados para uso futuro
7-6 Reservados para uso interno, siempre 0
5 Estado del Flash:
0 - tinta INK, papel PAPER
1 - tinta PAPER, papel INK
4 Interrupción pendiente de ejecutarse
3 Reservado para uso futuro
2 Biestable IFF2 (uso interno)
1 Modo de interrupción: 0=IM1; 1=IM2
0 Biestable IFF1 (estado de interrupción):
0 - Interrupciones desactivadas (DI)
1 - Interrupciones activadas (EI)

3
ZX format has 6 versions, version 1 is the first one and version 6 is the one used now. Values
used on a version an higher are indicated with (v. [version]+), for example (v. 2+) for values used
on version 2 and higher, except from values used since version 1, which has not (v. [version]+)
indication.
Version 1, 2 and 3 works on ZEsarUX and ZXSpectr emulators. Version 4 and higher only works
on ZEsarUX.
Version 1 only allows saving Spectrum 48k snapshots.
Version 2 allows saving Spectrum 48k and Spectrum +2A Spanish.
Version 3 only have one more value, the Machine emulated, and two bits used in zx80/81 vsync.
Values not used in a version are normally saved as 255, for example, snapshot_day used on
version 4, on previous versions this value will be saved as 255.

The description for ZX files is:

Offset Field Description


0 signatura "ZX"
2 long_prog WORD=49152
4 pos_inicial WORD=16384
6 reg_c BYTE
7 reg_b BYTE
8 reg_e BYTE
9 reg_d BYTE
10 reg_l BYTE
11 reg_h BYTE
12 reg_f BYTE
13 reg_a BYTE
14 reg_ixl BYTE
15 reg_ixh BYTE
16 reg_iyl BYTE
17 reg_iyh BYTE
Registers '
18 reg_c_ BYTE
19 reg_b_ BYTE
20 reg_e_ BYTE
21 reg_d_ BYTE
22 reg_l_ BYTE

4
Offset Field Description
23 reg_h_ BYTE
24 reg_f_ BYTE
25 reg_a_ BYTE
26 reg_r BYTE
27 reg_i BYTE
28 reg_sp WORD
30 reg_pc WORD
32 reservado1 WORD=0
34 border BYTE
35 reservado2 BYTE=0 In version 1 of header, it was a WORD an
reservado20 didn't exist.
36 bits_estado Bit Description
7-6 Reserved for internal use, always 0
5 Flash state: 0 - ink INK, paper PAPER. 1 - ink
PAPER, paper INK
4 Interruption pending
3 Reserved for internal use
2 Flip-flop IFF2 (internal use)
1 Interrupt mode: 0=IM1, 1=IM2
0 Flip-flop IFF1 (interrupt state):
0 – Interrupts disabled (DI)
1 – Interrupts enabled (EI)
The emulator only uses bit 5 (flash state), bit 1
(mode IM0/IM1 or IM2) and bit 0 (DI or EI)

37 reservado20 BYTE=0 (v. 2+)


Next bytes are the extended header of ZX files
38 version BYTE=1, 2, 3,4,5 or 6: ZX Header version
Version 1,2,3: Supported on ZXSpectr and ZEsarUX
Version 4: Since September 2014, ZEsarUX version
1.3
Version 5: Since January 2015, ZEsarUX version 2.0
Version 6: Since March 2016, ZEsarUX version 4.0
39 cabecera_velocidad WORD Not used since ZXSpectr V2.0
41 cabecera_dirs_pant WORD=64 Not used. Used in the CGA version and
screen updating. Do not use in next versions
43 cabecera_frecuencia BYTE=1 Not used. Used in the CGA version and
screen updating. Do not use in next versions
44 control_brillo BYTE Brightness value. Not used on ZEsarUX
45 disparador_defecto BYTE Autofire frequency. Calculated by frecuencia =
50/disparador_defecto. Not used on version 3. If

5
Offset Field Description
disabled autofire, this field can be any value except 0
46 sonido BYTE 1 if sound is enabled (port 254)
47 bits_estado0 BYTE The meaning is the following:
Bit Description
7 Keyboard issue. Not used on ZEsarUX
6 1 if auto-fire enabled. Not used on version 3
5 0 if Flash refresh is enabled. Obsolete
4 1 if snapshot is 128k (version 2+)
3 To 1 if border changing is not possible using OUT 211,
value (version 2+)
2 Not used
1 1 if screen saver is enabled
0 CGA Palette (v. 2 only)
0=Black,Green,Red,Yellow
1=Cyan,Magenta,White

48 puerto_32765 BYTE Value of last OUT to port 32765 (v. 2+)


49 puerto_8189 BYTE Value of last OUT to port 8189 (v. 2+)
50 paginas_actuales 4 BYTES Contains for each memory segment
(0000h-3fffh, 4000h-7fffh, 8000h-bfffh, c000h-ffffh)
the page (ROM o RAM) assigned, meaning from 0 to
3 ROMS, and from 4 to 11 RAMS (v. 2+). If the
machine emulated is a 128k (but not a +2A), ROM1 is
identified as ROM3. Note: this is only used on
ZXSpectr emulator
54 puerto_65533 BYTE Value of last OUT to port 65533 (v. 2+)
55 ay_3_8912_registros 16 BYTES Values of AY sound chip registers (v. 2+).
It is used since an advanced version 2. If it's read in an
earlier version, we will see 255, because it was
reserved.
71 ordenador_emulado BYTE Machine emulated: (v. 3+)
0=Sinclair 16k
1=Sinclair 48k
2=Inves Spectrum+
3=Sinclair 128k
4=Amstrad +2
5=Amstrad +2 - French
6=Amstrad +2 - Spanish
7=Amstrad +2A (ROM v4.0)
8=Amstrad +2A (ROM v4.1)
9=Amstrad +2A - Spanish
10=Sinclair 128k Spanish
Note: Machines 11 and higher are not recognized
on ZXSpectr (although it can handle version 3

6
Offset Field Description
snapshots)
11=TK90X
12=TK90XS
13=TK95
14=ZX80
15=ZX81
16=Z88 (v.5+)
17=Jupiter Ace (v. 6+)
18=Amstrad CPC 464 (v. 6+)
19=Timex TS 2068 (v. 6+)
20=ZX-Uno (v.6+)
21=Chloe 140SE (v.6+)
22=Chloe 280SE (v.6+)
23=Prism (v.6+)
24=Spectrum 48k (Spanish) (v.6+)
72 bits_estado2 BYTE The meaning is the following:
Bit Description
7 1 if AY Chip enabled (v. 4+)
6 1 if 16k RAM block in C000H (for zx80, zx81) (v. 4+)
5 1 if 16k RAM block in 8000H (for zx80, zx81) (v. 4+)
4 1 if 8k RAM block in 2000H (for zx80, zx81) (v. 4+)
3 1 if wrx enabled (for zx80, zx81) (v. 4+)
2 1 if real video enabled (v. 4+)
1 1 if hsync generator is active (for zx80, zx81) (v. 3+)
0 1 if nmi generator is active (for zx80, zx81) (v. 3+)

Next values are used on version 4 and higher


73 bits_estado3 Bit Description
7 0 if Z88/CPC default keymap. 1 for Spanish
6 1 if kempston mouse emulation
5 1 if add 32 to second trap char routine on stdout driver
4 1 if automatic screen redraw on stdout/simpletext driver
3 1 if trap RST10H on stdout/simpletext driver
2 1 if VSYNC sound enabled (for zx80, zx81)
1 1 if LNCTR video adjust (for zx80, zx81)
0 1 if horizontal stabilization (for zx80, zx81)

74 t_states_offset BYTE Video t_states offset value on zx80/81. Value


with sign (-128 ... +127). Unused on ZEsarUX 1.4 and
higher
75 snapshot_day BYTE Day when the snapshot was saved
76 snapshot_month BYTE Month when the snapshot was saved
77 snapshot_year WORD Year when the snapshot was saved

7
Offset Field Description
79 snapshot_hour BYTE Hour when the snapshot was saved
80 snapshot_minute BYTE Minute when the snapshot was saved
81 zx8081ram BYTE Ram assigned to ZX80/81 (1..16), not counting
ram packs on 2000H, 8000H or C000H
82 invesrompoke BYTE Last value set as Inves low RAM Poke from
menu. 255 by default
83 invesuladelay Do NOT use. It was : BYTE Inves ULA delay factor. It
is not used since ZEsarUX 3.1 and must never be used
84 secondtrapaddress WORD Stdout second trap char address. Set to 0 if not
used
86 thirdtrapaddress WORD Stdout third trap char address. Set to 0 if not
used
88 stdout_simpletext_line BYTE Stdout/simpletext line width
width
89 stdoutcharfilter BYTE Stdout char filter (0=none, 1=Generic, 2=AD
adventures 42 char, 3=PAWS Spanish accents,
4=Hobbit)
90 joystick_type BYTE Joystick type emulation: (0=none, 1=kempston,
2=sinclair1, 3=sinclair2, 4=cursor, 5=cursor&shift,
6=opqa_space, 7=fuller, 8=zebra, 9=mikrogen,
10=zxpand) (10 on ZEsarUX 3.1 and higher)
91 lightgun_type BYTE Lightgun type emulation: (0=none, 1=sinclair1,
2=sinclair2, 3=kempston, 4=aychip)
Next values are used on version 5 and higher
92 z88_internal_rom_size BYTE. Z88 Internal ROM size (divided by 16384)
93 z88_internal_ram_size BYTE. Z88 Internal RAM size (divided by 16384)
94 z88_slots_type BYTE. Z88. Indicates which types of slots are
inserted. If some slot doesn't have card, type has no
sense. Value is codificated as:
Bit Description
6-7 Unused
4-5 Slot 3 Memory type
2-3 Slot 2 Memory type
0-1 Slot 1 Memory type
Type can be:
0: RAM
1: Hybrid RAM+EPROM (was used as ROM type on
ZEsarUX 2.0)
2: EPROM
3: FLASH
Note: EPROM, Hybrid EPROM+RAM or FLASH on

8
Offset Field Description
slot 3 are not saved on zx snapshots, but are indicated
here to warn user that it must be inserted manually an
eprom or flash
95 z88_slot1_size BYTE. Z88 Slot 1 size (divided by 16384)
96 z88_slot2_size BYTE. Z88 Slot 2 size (divided by 16384)
97 z88_slot3_size BYTE. Z88 Slot 3 size (divided by 16384)
98 z88_pb0 WORD. Z88 Blink register PB0
100 z88_pb1 WORD. Z88 Blink register PB1
102 z88_pb2 WORD. Z88 Blink register PB2
104 z88_pb3 WORD. Z88 Blink register PB3
106 z88_sbr WORD. Z88 Blink register SBR
108 z88_com BYTE. Z88 Blink register COM
109 z88_int BYTE. Z88 Blink register INT
110 z88_sta BYTE. Z88 Blink register STA
111 z88_epr BYTE. Z88 Blink register EPR
112 z88_tmk BYTE. Z88 Blink register TMK
113 z88_tsta BYTE. Z88 Blink register TSTA
114 z88_mapped_seg0 BYTE. Z88 Bank mapped to memory segment 0
115 z88_mapped_seg1 BYTE. Z88 Bank mapped to memory segment 1
116 z88_mapped_seg2 BYTE. Z88 Bank mapped to memory segment 2
117 z88_mapped_seg3 BYTE. Z88 Bank mapped to memory segment 3
118 z88_tim0 BYTE. Z88 Blink register TIM0
119 z88_tim1 BYTE. Z88 Blink register TIM1
120 z88_tim2 BYTE. Z88 Blink register TIM2
121 z88_tim3 BYTE. Z88 Blink register TIM3
122 z88_tim4 BYTE. Z88 Blink register TIM4
123 z88_rxd BYTE. Z88 Blink register RXD
124 z88_rxe BYTE. Z88 Blink register RXE
125 z88_rxc BYTE. Z88 Blink register RXC
126 z88_txd BYTE. Z88 Blink register TXD
127 z88_txc BYTE. Z88 Blink register TXC
128 z88_umk BYTE. Z88 Blink register UMK
129 z88_uit BYTE. Z88 Blink register UIT
Next values are used on version 6 and higher
130 ace_ram BYTE. KB of Jupiter Ace Ram. 3, 19 or 35

9
Offset Field Description
131 timex_port_f4 BYTE. Last out to port F4H
132 timex_port_ff BYTE. Last out to port FFH
133 bits_estado4 Bit Description
7 Not used
6 Not used
5 Not used
4 Not used
3 Not used
2 1 if Timex video support present
1 1 if ULAPlus mode active
0 1 if ULAPlus support present

134 ULAplus_BF3B BYTE. Last out to ULAplus port BF3B


135 ULAplus_FF3B BYTE. Last out to ULAplus port FF3B
136 ULAplus_mode BYTE. ULAplus current mode: 0, 1, 3, 5, 7 or 9
137 ULAplus_palette 64 BYTES. ULAplus palette table
201 reservado4 93 BYTES=255 Reserved for future use
294 DATOS X BYTES

Note: WORD values are saved LSB, I mean, low 8 bits first.
From “DATOS” memory bytes are saved, in a compressed way, explained later. If the saved
machine is an Spectrum 16kb, 48kb (with all variants), ZX80, ZX81 then data is saved from address
16384 until 65535. The exception here is ZX80/81 with 8KB RAM block enabled on 2000H. Then,
data is saved from address 8192 until 65536. On Jupiter Ace, data is saved from 8192 until 65535.
If it's 128k (Spectrum 128k,+2 and +2A machines), data are saved from RAM 0 until RAM 7.
The emulator generates a 48k file if it runs in /48k mode, or if it's in 48 BASIC mode, else 128k are
saved.
If it's Z88, data is saved the following way:
• Internal ROM
• Internal RAM
• Memory Slot 1 (if present)
• Memory Slot 2 (if present)
• Memory Slot 3 (if present)

Memory slots are saved only if they are present. Note that EPROM or FLASH cards on slot 3
are not saved, so they need to point to an eprom or flash file. EPROM or FLASH cards on slot 1 or
2 are saved. RAM cards are always saved.
Data on Z88 is saved on 16kb blocks, every block has a header with the following information:
• BYTE Bank number
• WORD Size of the following. So the 16kb block is compressed, it is needed to indicate the
size of the block
Data is normally saved in this order:
• Internal ROM: Bank 0, Bank 1, Bank 2... up to all the used internal ROM size. For example
if the internal ROM is 128kb size, we only save 8 blocks

10
• Internal RAM: Bank 20H, Bank 21H... up to all the used internal RAM size
• Memory Slot 1: Bank 40H, Bank 41H... up to all the used memory slot 1 size
• Memory Slot 2: Bank 80H, Bank 81H... up to all the used memory slot 2 size
• Memory Slot 3: Bank C0H, Bank C1H... up to all the used memory slot 3 size

Although the data is saved in this order, it can be saved in a different way, starting by internal
RAM and then the internal ROM for example

Since Version 6, when comes data, there are also additional parameters and headers depending on
the machine emulated:

If machine is CPC, data saved is:


z80_byte cpc_gate_registers[4];
z80_byte cpc_palette_table[16];
z80_byte cpc_ppi_ports[4];

z80_byte cpc_crtc_registers[32];

z80_byte cpc_border_color;

z80_byte cpc_last_selected_register;
4 blocks of 16 kb each compressed. Numbering blocks 0,1,2,3

If machine is Timex TS 2068:


3 blocks of 16 kb each compressed. Numbering blocks 0,1,2

If machine is Chloe 140SE:


8 blocks of 16 kb each compressed. Numbering blocks 0,1,2,3,4,5,6,7

If machine is Chloe 280SE:


4 blocks of 16 kb each compressed. For Ex RAM. Numbering blocks 0,2,4,6
4 blocks of 16 kb each compressed. For Dock RAM. Numbering blocks 8,10,12,14
8 blocks of 16 kb each compressed. For Home RAM. Numbering block from 16

If machine is ZX-Uno
z80_byte last_port_FC3B=0;

//Primer registro, masterconf, bit 0 a 1 (modo bootm)


z80_byte zxuno_ports[256]={1};

z80_byte zxuno_spi_bus[8];
z80_byte zxuno_spi_bus_index=0;

z80_byte next_spi_read_byte;
z80_byte zxuno_spi_status_register;

11
int last_spi_write_address; (24 bit)
int last_spi_read_address; (24 bit)
32 blocks of 16 kb each compressed. Numbering blocks 0-31

If machine is Prism
z80_byte prism_rom_page;
prism_ula2_border_colour
prism_ula2_palette_control_colour
prism_ula2_palette_control_index
prism_ula2_palette_control_rgb[3]
prism_ula2_registers[16]
z80_int prism_palette_two[256];
32 blocks of 16 kb each compressed. For RAM. Numbering blocks 0,2,4,6,...
2 blocks of 16 kb each compressed. For VRAM. Numbering blocks 240,242

Then, the data:

Compressed data:
All data saved is compressed (except, logically, the ZX header), in the following way:
● If a byte is repeated more than 4 times, it is saved like:
221,221,byte to repeat,times repeated
● If there's a 221 byte just before the repetition, it is saved as:
221 before repetition,byte to repeat,221,221,byte to repeat,times repeated-1

Note: A 0 value on the repetition byte means 256.


When 128k snapshots are saved (Spectrum 128k,+2 and +2A machines), it is made in two blocks
of 64k, the first block from RAM 0 until RAM 3, and the second one from RAM 4 until RAM 7,
and bytes repeated which last from RAM 3 to RAM 4 are not detected, for example:

If we have the following:


RAM3
16377=10
16378=20
16379=20
16380=20
16381=20
16382=20
16383=20
RAM4
0 =20
1 =20
2 =20
3 =20
4 =20
5 =20
6 =20
7 =4

12
The data saved is:
10, 221,221,20,6, 221,221,20,7, 4

13
Included utilities
In this chapter we use the SMP and the RWA audio files format.
SMP format was used in the audio edition program Fast Tracker, which it was the one I started to
do some tape conversion tests. This format is raw, mono, 8 bits unsigned, and at 11111Hz.
RWA is like the SMP format, but at 15600 Hz
Using audio conversion utilities you can convert wav files to smp and vice versa. For example,
in Linux, with the sox program, you can convert from .wav to .smp with the command:
sox file.wav -t .raw -r 11111 -b 8 -e unsigned -c 1 file.smp

SMPATAP

This program is used to read data from a SMP file and save it as a TAP file.

When we run the program, SMP file and TAP file must be written (both with extension). When it
loads a block, you must press any key except the N to save the block.

LEEZX81_UNIX

This program is used to read data from a SMP file and save it as a .P file.

When we run the program, SMP file and .P file must be written (both with extension).

TAPABIN

This program is used to extract data blocks from a TAP file and save them with BIN format.
When the program starts, you must specify the TAP and BIN files to use (both with extension).
When it reads a block, you must press any key except the N to save it. The file saved is the data get
from a block without flag and checksum; for example: if we want to save a Spectrum screen in BIN
format, we must save the block shown as: "Flag:255 Longitud:6912" and not the block:
"Bytes:Screen Longitud:6912 Inicio:16384", if not, we would save the header, I mean, 17 bytes.

SP_Z80

This program is used to convert files between SP and Z80 formats. You must specify the source
file and the target file (both with extension, always .SP or .Z80). It can only convert 48k files.

FILE_TO_EPROM

This program is used to write a file on a new Z88 eprom card. It creates a new eprom card with
the file you indicate in it.

14
15
Utilities in TAP format

SPED52.TAP

This tape includes an assembler/disassembler for ZX Spectrum 128k, with its source code. This
assembler (SPED) uses the whole 128k of memory. The SPED uses RAM1, and the object code
uses RAM 4; source code uses RAM "48" (5,2,0) and RAMs 6 and 7, having a maximum source
code of 74549 bytes (41781+16384+16384).
Sentences ORG and ENT are a bit different from other assemblers. ORG always indicates to
which address the object code is generated; normally, we assemble at 49152, which corresponds to
RAM 4. ENT indicates to which address labels are referred (in a relocatable program, ENT is often
0).
Operator $ always indicates to which address is referred the line where it is situated (indicated
with ENT). Operator !, that I have invented, shows where the object code is being generated
(indicated with ORG).
To see the listing while assembling, you must write in the source code the LST+ operator, and to
make it disappear, LST- .

The assembler can generate a debug info, that consists in a table with each memory address of
object code with its corresponding line of source code. This table uses RAM 7; we may see if 3rd
block of source code is used, debug info can't be used. The maximum size of the table is 16k (4096
lines). To tell the assembler create debug info, use the operator DPR+ in the source code (and to
disable it, DPR-).
When we go to the disassembler, if there's debug info, the original line of the source code will be
shown.
Label table uses RAM 3, having a maximum of 16k for labels (it means 1260 labels).
The editor also uses RAM 3, for copying text in a buffer to make the typical actions of
Copy/Paste/Move; the maximum is 16k of text.

I don't want to explain all the options, because it has some help screens (sorry, in Spanish) (in the
main environment and in the disassembler, key H; in the editor, Extended Mode and H). Also, you
have the source code to see the whole program.

Only one more thing, the SPED format. The assembler only recognizes source code with headers
of SPED format, which have a size of 34 bytes but they can be read from BASIC. The description
of the header is:

Offset Length Description


0 1 Byte is 3. Indicates BYTES block
1 10 File Name
11 2 Word which indicates the length of the first text
block
13 4 4 Bytes not used

16
Offset Length Description
17 1 Checksum byte. It is used to cheat to BASIC and
tell the header is 17 bytes length; the header can
be read in a real Spectrum and in the emulator
18 1 Recording day of source code
19 1 Recording month of source code
20 1 Recording (Year-1980) of source code. It is
ready to year 2000!
22 2 Word which indicates the length of the second
text block. If there's not, is 0
24 2 Word which indicates the length of the third text
block. It there's not, is 0
26 9 9 Bytes to 255, used in future versions

After the header comes the text, formed by 1, 2 or 3 blocks with flag 255.

Text blocks are saved in ASCII format, setting bit 7 of a character to make a tabulator, and code
13 for line end. Of all the assemblers that I have for the Spectrum (SPED, GENS, TED), this
assembler uses the shortest text format.

CONVERSO.TAP

This program is a source code converter of formats GENS, TED and SPED. Possible
conversions are: GEN-> TED, GEN->SPED, TED->SPED. Source code is included, in SPED
format. Note: TED is a format of an editor/assembler which appeared in the MICROHOBBY
magazine, of Hobby Press.

REALDEBU.TAP

It consists on 2 disassemblers, one for 48k and the other for 128k. They are both like MONS.
Both source codes are included, in SPED format. They are both named as (R)EAL DEBUG, that's
because they control perfectly the R register, and some other disassemblers, like MONS, don't.

The 48k disassembler is relocatable. To run it:


CLEAR address-1: LOAD "RDEBUG6.CO" CODE address:
RANDOMIZE USR address

To know the keys of the 48k run the 128k disassembler, it has a help screen: there are only two
options that the 48k one doesn't have, RAM selection and Assembly.

The 128k disassembler uses RAM 1, plus a block of 256 bytes length placed below address

17
49152. To run it:

From 128 BASIC: RANDOMIZE USR 0. With this, we go to ROM3. Then:

CLEAR 29999: OUT 32765,17: LOAD "R37DE128.C" CODE 49152: RANDOMIZE


address: RANDOMIZE USR 49152

CLEAR can be whatever you want, but it must be below 49152. The "address" variable indicates
where the 256 bytes block is placed; it can be placed, for example, at 23296. If "address" is other
than 23296, then the CLEAR must be below "address".

CURSORDR.TAP

This is a painting program, the CURSOR DRAW, which also includes the source code in SPED
format.

18

Вам также может понравиться