With hide you can hide a line or a full program or numeric parameters. The classic variant is the use with a REM line:
Code: Select all
REM _hide _asm
printch:
LD A,,'Z'
RST $10
LD A,,'X'
RST $10
LD A,,'8'
RST $10
LD A,,'1'
RST $10
RET
error:
RST 8
db $0A
END _asm
RAND USR #error
AUTORUN:
RAND USR #printch
Code: Select all
0074: [407D] 00 0A 13 00 EA 76 FF REM _hide _asm
printch:
007B: [4084] 3E 3F LD A,,'Z'
007D: [4086] D7 RST $10
007E: [4087] 3E 3D LD A,,'X'
0080: [4089] D7 RST $10
0081: [408A] 3E 24 LD A,,'8'
0083: [408C] D7 RST $10
0084: [408D] 3E 1D LD A,,'1'
0086: [408F] D7 RST $10
0087: [4090] C9 RET
error:
0088: [4091] CF RST 8
0089: [4092] 0A db $0A
008A: [4093] 76 END _asm
008B: [4094] 00 14 0E 00 F9 D4 1D 22 RAND USR #error
21 1E 25 7E 8F 01 22 00
00 76
AUTORUN:
009D: [40A6] 00 1E 0E 00 F9 D4 1D 22 RAND USR #printch
21 1D 22 7E 8F 01 08 00
00 76
Optical nicer is to use the code for REM in the last BASIC line because the code start address will be determined anyway automatically. Here the concept of no explicit use of line numbers is an advantage to move BASIC lines simply in the editor.
Code: Select all
RAND USR #error
AUTORUN:
RAND USR #printch
REM '(C) by PokeMon'
REM _hide _asm
printch:
LD A,,'Z'
RST $10
LD A,,'X'
RST $10
LD A,,'8'
RST $10
LD A,,'1'
RST $10
RET
error:
RST 8
db $0A
END _asm
Code: Select all
RAND USR #error
AUTORUN:
RAND USR _hide #printch
Code: Select all
0074: [407D] 00 0A 0E 00 F9 D4 1D 22 RAND USR #error
21 24 1D 7E 8F 01 8A 00
00 76
AUTORUN:
0086: [408F] 00 14 0A 00 F9 D4 1C 7E RAND USR _hide #printch
8F 01 70 00 00 76
2 byte line number big endian ($14=20)
2 byte line length little endian ($0A=10)
1 byte BASIC command RAND ($F9)
1 byte BASIC function USR ($D4)
1 byte string ($1C='0')
1 integer identifier ($7E)
5 byte integer ($8F,$01,$70,$00,$00 = 16572)
1 byte end character (NEWLINE) ($76)
This will look live like this:
So this was part 1 of ZX BASIC.