This ZIP file contains the programs and code samples from ZXzine issue 6.
Most of it is a set of eleven short Z80 assembly examples for the TS2068, each with its source (test1.asm to test11.asm) and a ready-to-load TAP built with the pasmo assembler (pasmo --tapbas). They step from printing a single character with RST 16 to clearing the screen, filling the display, plotting points, printing at a position, opening a channel and printing a string, reading the keyboard, and animating a user-defined graphic. Two include files, lib/rom.asm and lib/sysvars.asm, give names to TS2068 ROM entry points and system variables so the examples can call them by name.
The ZIP also holds a copy of ZXpaintyONE, a browser-based paint program by Gasman for drawing ZX81 low-resolution pictures and exporting them as a .P file for a ZX81 emulator. It is an HTML/JavaScript page, not a TS2068 program.
Contents
Assembly examples (assembly/)
test1: prints a single “A” withRST 16and returns.test2: clears the screen, then prints an “A”.test3: prints ten “A” characters in a loop.test4: fills the display with character 51.test5: plots a vertical line of points by calling the ROM through the TS2068 function dispatcher (FUNCDISP, $6200).test6: plots using thePLOTBCROM routine.test7: clears the screen and prints a character at a set position with theSETATroutine, the machine code equivalent ofPRINT AT.test8: opens channel 2 (the upper screen) and prints a 12-character string withPR_STR.test9: points the UDG system variable at its own 8-byte graphic and moves it up the screen one line at a time, usingHALTfor timing.test10: prints a string through the ROM’s PRINT routine.test11: clearsLAST_K(23560), waits for a key and prints each character typed.
ZXpaintyONE (zxpaintyone/)
zxpaintyone.html with its palette images and a backup copy of the page (zxpaintyone.html~). test.txt is a long string of hex digits, apparently a saved picture.
Program Analysis
Loader
Every TAP starts with the same four-line BASIC loader written by pasmo: CLEAR 64999, POKE 23610,255, LOAD "" CODE and RANDOMIZE USR 65000. All the examples are assembled at 65000 (ORG 65000), so each code block is only a few bytes long, from 4 bytes for test1 to 69 bytes for the UDG animation.
Notable Techniques
- Named ROM entry points in
lib/rom.asm(BEEP, BORDER, CLS, OPCHAN, PLOTBC and others) are TS2068 addresses, so the examples are not interchangeable with a ZX Spectrum where the ROM differs. test5pushes its arguments on the stack and calls the function dispatcher at $6200, the TS2068’s way of reaching routines in the extension ROM.test9sets the UDG system variable (23675) to its own data and uses theATcontrol code (22) throughRST 16to position the graphic.
Potential Issues
test8andtest11loop forever (JP loop/JP start) and never return to BASIC, so only a reset stops them. This appears to be intended for the demonstrations.- The TAP files are dated about a month earlier than some of the
.asmfiles, so a TAP may not match the final version of its source exactly.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.