I know under normal (noob) usage, it is not possible to use 0 as a line number in XB, but i know i have seen it used.
I see it in XB programs that use the BXB / VDPUtil routine.
So if you can not enter that line normally, or even delete it if it is there, how do you successfully get it there to begin with?
I am guessing this requires a few well-placed CALL LOAD's to the right locations, or is there some other way of tricking XB into letting you use that no-no number for your own use?
I found this in my email archives. It comes from Fredrick Ohrstrom, written July 30 2013. I have not tested the routine. Be sure to do a CALL INIT at the command prompt - only need to do this once.
The program can be simplified for this particular problem.
Enter this program and run it (and do not forget to do "CALL INIT" first to be able to do loads.)
110 CALL PEEK(-31950,SL1,SL2)
130 CALL LOAD(SL,0,0)
Now line number 1 has changed into 0.
Change 130 into "CALL LOAD(SL,0,1)"
runt the program again, and line number 0 has changed into 1.
It works by fetching the address of the last byte of the line number table (Peek at 0x8332 = -31950) then convert the first two bytes into an address in decimal notation, and subtract 3 bytes to get the last chunk of four bytes in the line number table.
The first two bytes of the chunk are the line number (we are overwriting those) the second two bytes is the address of the actual line data (we do not change that....)
Oh, and the line number table is sorted in decreasing order, which means that the last entry is the first line in the basic program.
If you mess with the numbers of other lines, the basic interpreter can get very confused.