Publication: Sinc-Link
Pub Details: Sinc-Link v10 n4 (Volume 10, Issue 4)
Date: July/August 1992
Pages: 20
Searce and Replace will search the screen for a character you specify and replace it with any other. Load this machine code routine into a REM staement in the first line of a program. The line should be no shorter than 23 bytes long. Search and Replace runs in a 16K ZX 81 only.
Z-80 Ass'y List'g Hexadecimal dump
LD HL, (D.FILE) 2A 0C 40
LD B, 24d 06 19
DEC HL 2B
INC HL 23
LD A, (HL) 7E
CP 118 FE 76
JRNZ + 3 20 03
DJNZ - 8 10 F8
RET C9
CP CHR$(n) FE CHR$(n)
JRNZ - 13 20 F3
LD (HL), CHR$(x) 36 CHR$(x)
JR - 17 18 EF
When a character is to be replaced, Poke 16530, CHR$(n) – where CHR$(n) means the character to be searched for, and POKE 16534, CHR$ (x) – where CHR$ (x) means the character to be replaced, then do a RAND USR 16514.
From Your Computer magazine Aug ’82 page 85
GFC
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.