Writing aids Julian Wood, +---------+ Downham Market, | ZX-81 | [sic] Norfolk +---------+ The following machine-code routines are a great aid to the Basic programmer writing and developing programs. The ex- planation of how to enter and use each routine refers to the listings of the relevant Basic program which Pokes the machine code into memory. First a Line Block Delete: Enter a line 1 Rem followed by 96 characters and then POKE 23756,0 which changes it to line 0, so it cannot be deleted. Enter the rest of the program and Run 10, and the routine will be Poked into line 0. To delete the now unwanted data, Run the program and enter 10 and then 77 for the inputs. If all is successful you should find that lines 10 to 77 have been deleted, leaving the delete program which can be Saved as a normal program. [The whole program is on the TZX under the name of "LneDelLoad", the loaded, shortened version as "LineDelete".] Next, a Utilities program. Enter it and Run it, and the machine code will be Poked in above RAMtop, and can be saved using SAVE "util" CODE 32416,183 [These are on the TZX as... well, the obvious names.] When loading back, it is necessary to Clear 32415 before- hand. The subroutines are as follows: ATTR CHANGE To use this, you simply have to use the normal Basic colour commands and then Rand Usr 32416. For example: FOR a=32 TO 255: PRINT CHR$ a;:NEXT a: PAPER 1: INK 6:FLASH 1: RAND USR 32416 prints the character set, and then sets the whole screen flashing with blue paper and yellow ink without clearing the screen. SEARCH AND REPLACE Replaces any specified character with another character. Poke 32435 with the search character code and 32437 with the replace character code. For example, to change all the Print commands to LPrint: POKE 32435,245: POKE 32437,224: RAND USR 32434 The next Utilities subroutine is SCREEN$ This differs from the one in ROM as it works with the pre- defined graphics and the user defined graphics, as well as the normal ASCII characters. To use it, Print At the posi- tion on the screen you wish to check and call the routine. For example: PRINT AT 10,10;: LET L=USR 32477 will give the code of the character at position 10,10. If there is no such character, then L will equal zero.