Skip to content

Instantly share code, notes, and snippets.

@mistificator
Last active December 27, 2019 23:06
Show Gist options
  • Save mistificator/31bdf932d44ce17f5465fdf31aaa57c7 to your computer and use it in GitHub Desktop.
Save mistificator/31bdf932d44ce17f5465fdf31aaa57c7 to your computer and use it in GitHub Desktop.
ZX Spectrum +3 code that reboots BASIC to start loader screen
.org $5CD2 ; // fixed origin for https://clrhome.org/asm/ TAP generator
di
xor a
ld bc, $7ffd
out (c), a
ld b, $1f
out (c), a
rst $0 ; trick doesn't work when started from ZX Spectrum +3 boot menu right to BASIC48, cause bank switching is blocked forever
ld hl, 0
ld b, (hl) ; store byte of address 0
ld (hl), 1 ; write 1 to address 0
ld a, (hl) ; read byte of address 0
dec a
or a
jr nz, ROM
ld (hl), a ; write 0 to address 0
ld a, (hl) ; read byte of address 0
or a
jr nz, ROM
ld (hl), b ; restore byte of address 0
RAM:
...
ROM:
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment