It should be noted that in ZX-Spectrum BASIC there are no standards for line length, as in modern IDEs, there are also no native restrictions of 80 characters, as it was in modem times (however, home attempts to connect modems and extended screen modes [translation] were later made, but both Speccy BASIC editors was developed before that).
Long lines were used primarily to protect programs, because regular BASIC editors did not cope well with these lines. The first defenses of the early 80s were often based on BASIC tricks, but later almost every bootloader used the REM operator to place machine code in it. Polish hackers (such as Bill Gilbert, SS Capitan, etc.) in the 80-90s, after removing the original protections, also added simpler protections on their loaders that made editing the BASIC program more difficult and placed the machine code in a REM comment.
Essentially, long strings, such as well as color code control characters, lines with number 0 and modified ASCII values of numbers are only the first step in complicating the perception of programs and, in particular, to understand the place where the machine code loader runs. Most of these tricks were understandable to more experienced 8-bit programmers of the time, but for ordinary users it could be difficult.
So if you want an extra long lines, or place your machine code, you need to use POKES or directly write BASIC operator codes in assembler then modify saved code block to BASIC. Actually if you put youre code after the RANDOMIZE USR <start_of_code_bloack>
operator you don't need additional : REM
, just put your code after 5 bits digits form of <start_of_code_bloack>
. Here is an example:
ORG #8000 # Address to place your code block after compilation.
DISP #5CCB # Address of your BASIC program
# (not Multiface or TR-DOS, just clean BASIC 48/128).
DB 0,1 # First line number
DB #FF,#FF # Lenght of BASIC line
# (actually you don't need a correct length)
DB #D9 # RANDOMIZE
DB #C0 # USR
DB "0" # "0" in ASCII (you don't need to put real address in ASCII)
DB #0E,0,0 # 5 bytes of calculator form of number
DW START # where last two bytes is real address of code block
# If you wish you can put : REM here anyway using the corresponding
# bytes, but this is not required if your machine code program will
# not return to BASIC.
START # any code block here to run
ENDCOD DISPLAY "lenght: ",ENDCOD-#8000 # to calculate a real size of the
# code block
DB #80,#AA,#01,0 # But you need to save this one as
# the end of BASIC programm.
Then save your code block from #8000
with length of calculated length plus 5 bytes. But take a note you need to set up length without these 5 bytes add. Made them as BASIC (In TR-DOS you can edit file descriptor on the 0th track, on tape you could use other tools).
Based on a structure and ZX-Spectrum charecter set you can do any number of any size of lines with code block(s) inside.