3 ms·
The 32/64 column trick was a bit obscure. I learned it from the sales guy in the Tandy store. I think from memory that printing CHR$(23) would also invoke it in
by Starwatcher2001 12y ago
The 32/64 column trick was a bit obscure. I learned it from the sales guy in the Tandy store. I think from memory that printing CHR$(23) would also invoke it in software.
I cut my programming teeth on the old TRS-80 too. Learned Basic, then Z80 assembler. Still have mine with the interface and pair of disks.
I came across the line number hack when writing a line renumber program in assembler. While getting it working, I screwed up quite a lot and ended up with all kinds of values in there. Screw-ups can be a great way to learn, or especially trying to fix them!
The line number was held as two bytes at the start of each line, which could also be massaged by using the Poke command. When listing the program, Basic expects the lines numbers to increase in value and stops listing as soon as it comes to one that's smaller than the last one (presumably thinks it's reached the end of the program). Poking 65535 (255,255) into the first line does the trick.
Surprisingly, it doesn't affect the running of the program. When looking for targets of GOTO or GOSUB, it seems to scan the whole program and not stop at the hacked line number. Weird.
A friend of mine used to "protect" his basic programs against being line printed by poking 200 page feed characters into one of the early lines of the program. Really made the paper shoot out of the old Epson MX80 dot matrix printer :-)
Cheers! [Edit typo]
- jeffwass 12y agoThat's awesome, thanks for the description! Sadly I never got into assembly on the Z80, I guess I didn't realize it would be accessible :-( Cheers for reminding me of the Epson MX80 which I also had. I loved the programming manual for it, embedded with funny comments like how to forge the Mona Lisa.