A little routine to repeat a character code and preserve some memory room.
Example:
Code: Select all
10 PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
20 PRINT
30 PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Code: Select all
10 PRINT USR X;"X"
20 PRINT
30 PRINT USR X;"X"
Code: Select all
.org 16514
LD HL,($4016)
INC HL
INC HL
LD B,$20
LD C,$00
LD A,(HL)
Loop:
RST 10H
DJNZ Loop
INC HL
INC HL
LD ($4016),HL
JP $005B
.end
Code: Select all
1 REM [HEX:\
2A,16,40,23,23,06,20,0E,\
00,7E,D7,10,FD,23,23,22,\
16,40,C3,5B,00 ]
2 LET X=VAL "16514"
3 PRINT AT 10,0;
4 PRINT USR X;"\,,"
5 PRINT TAB 14;"HELLO",
6 PRINT USR X;"\''"
Note:
-Affect the cursor location.
-Can't be use with RAND USR, it will be compiled with any TexttoP, but the line can't be edited with the basic editor.
-All values and characters after this ASM call are ignored !
- if the "C3,5B,00 " (JP $005B) is replaced by "C9" (Ret) can't be use… the PRINT command will display the BC value !
In this case, just use the TAB function, if the line start at the first row…
Example: (The RET value in always BC=0)
Code: Select all
1 REM [HEX:\
2A,16,40,23,23,06,20,0E,\
00,7E,D7,10,FD,23,23,22,\
16,40,C9 ]
2 LET X=VAL "16514"
3 PRINT AT 10,0;
4 PRINT TAB USR X;"\,,";TAB 14;"HELLO",TAB USR X;"\''"
Have fun...