MAKING MISCHIEF WITH MINI-XMOD AND HOT-Z
You just have to admit it: There ARE some rather interesting programs written for the TS1000/ZX81. Although it normally takes a tiny length of extra time to LOAD and SAVE them with standard cassettes, the simplicity of this Z80-based machine leaves itself wide open to software configuration.
One program in particular that just screams out to have someone smooth the rough edges or install additional new subroutines is MINI XMOD 1.5. I choose 1.5 because I know for a fact that the UP/DOWNLOAD function works exactly the way it is supposed to (Version 1.7 does NOT work!). This is a real fun experience to actually see data, as hex, coming into or leaving your CPU. Once you get to playing with this program, however, you begin noticing areas where certain added features could be very helpful, such as a simple word processor. How neat it would be to load in only one program, type your text or load another program into it, edit it, then use this same program to dial up a BBS and upload this fresh data into it!
How can this, or any other mod, be possible? Crack the safe. Rip it open. Stare at and manipulate its innards. Use HOT-Z! First, LOAD in MINI XMOD 1.5. At this point, a modem need not be attached. Depending upon which “copy” you have, you’ll either have a BASIC list displayed, or 0/0, in which case you’ll have to do your own LIST. MINI XMOD will want a reset RAMTOP, so enter RUN. The main menu will come up telling you to touch any key. Do it. Without a modem, the display at this point will seem very strange. Dark and light horizontal bars will scroll all over the screen. Since the QUIT option is SHIFT/ENTER, do this. It will ask if you want to save files. Respond “N”. The program will terminate in a weird error code, but ignore this. Now, erase the BASIC with NEW. Don’t worry. With RAMTOP reset, MINI XMOD is still there, eagerly anticipating a RAND USR 31492 to start again (This will vary slightly, depending upon available RAM and modem type, per documentation). But don’t do this (you can, if you want, just to give yourself piece of mind that it really is there.). Next, LOAD in HOT-Z. With my particular copy, after the 0/0 report, a GOTO 1[illegible] command is necessary to activate HOT-Z. A hex list will be displayed for addresses and contents, plus mnemonics. In the upper left, a hi-lighted area that says “ADDR” is prompting you for the beginning address range you wish to view. Remember MINI XMOD’s BASIC? For the 16K Westridge version, it indicates decimal address 31492 to be the starting address. Trouble is, HOT-Z wants a hex input! Now, I don’t know about you, but I can’t instantly translate 31492 to hex in my head! So, push the X key. Now, the hi-lighted prompt says, “ADDRD.” With this extra ‘place’, you can now enter 31492. HOT-Z instantly displays MINI XMOD from hex address 7804! According to MINI XMOD’s docs, the actual address range of the MC program goes from 7300h to 7f40h. This works out to be from 29440 to 32576 in decimal. As a strictly comparative exercise, you can RUN a FOR-NEXT loop in BASIC just before loading HOT-Z. Use this loop to print decimal addresses, values and CHR$ of those values to later compare with what HOT-Z will show you. The BASIC loop can look like this:
1 LPRINT " ADDR ";" DEC VAL ";"CHR$ "
5 FOR N=29440 TO 32576
10 LPRINT N;" ";PEEK N;" ";CHR$ PEEK N
15 NEXT N
The results of this program by the way using a TS2040 or Alphacom 32 printer will use up most of a roll of thermal paper in slightly over a half an hour! Go visit the family, watch some TV or out to the local bar. Don’t forget to come back! When done, NEW it for the incoming HOT-Z.
So far, we have HOT-Z monitoring that area above RAMTOP where MINI XMOD 1.5 currently resides. We’re looking at a hex listing from 7300h. The biggest thing missing from here is decimal numbers! Pretty hard to compare with that BASIC printout, containing nothing but decimal numbers. Fortunately, an easy out exists. HOT-Z’s docs say that a mere push of the K key will change the display to include the missing decimals! This is definitely the way to go. I have a much, much easier time thinking in decimal, than I do in hex. Now, we can visually verify with that humongous roll we just printed out. Since we, at SWYM, are more interested in our readers acquiring results than spending gobs of time working for them, I’ll let you in on a secret: The listings match! With this relief, we progress to the next phase. Look for large blocks of NOPS (0). Make notes of where they are and how big. Again, we’ll let you cheat by my telling the answers: There’s a 47-byte block between 29632 and 29679; a 95-byte block between 29688 and 29783 (check out the ‘stranded’ 37d at 29760, first) and, finally, a whole 107 bytes at the tail end of its documented range, from 32469 to 32576. I say “documented range” because the actual machine code listing spells out the word “END” from addresses 32466 to 32468. Actually, according to HOT-Z, lots of additional nops are present past the 32576 “limit.”
What we have done is to identify areas where additional coding may be written. Since it’s likely that new subroutines can’t be blindly thrown in, a certain degree of experimentation is required for the user (You didn’t think we’d tell everything??). Once you have some possible routines coded per the above sizing specs, go to the area of NOPS you wish to play in and press W for HOT-Z’s Write Mode. Use SH/8 (right cursor) to position the position the cursor at the exact nybble you wish to change (up/down arrows also work), then type the hex coding for your routine. When done, hit ENTER to return to read mode. From here, HOT-Z supplies a One-Step execute test. If you really know your code, and where it branches from and to, you can follow it with this. Press V (also accessible by O from write mode) and the display changes to show registers, flags, stacks and anything else your program will affect. A mere press of the ENTER key one-steps you through each instruction. SPACE bypasses it for the next one. Be careful. If you have a real foul instruction, you’ll crash yourself! If you’re lucky and succeed on the first try. press Q to quit to the read mode or S to the SAVE mode. The SAVE mode will SAVE to tape anything from the cursor position to the user-specified End-of-Program marker. This way, you can save the entire modified Mini Xmod machine code! For those wondering how these two can co-reside in just 16K, remember that Mini Xmod uses a mere 3136 bytes before file initialization (since this is only done for data capture and storage, the program will run fine without doing this) and HOT-Z uses 9.25K of machine-coded REM. Also, don’t forget that when initializing a file in Mini Xmod, a huge empty REM statement is generated in the BASIC area. Because of this, it probably wouldn’t be a great idea to initialize a Mini Xmod file while also running HOT-Z! We hope that this will give an impetus to experiment with TS1000/ZX81 software. To be able to upload and download with this “doorstop” computer is a great thing to brag about. How much more impressive it would be to say that your lowly, 16K, 8-bit modem program has it’s own word processor built in! And don’t forget, any workable ideas you come up with should be shared with those TS1000 addicts of SEATUG. Why, we may even put them in SWYM!