• Project Log

    Keith02/01/2020 at 01:43 0 comments

    2020-01-29

    Found errors in a webpage about upgrading the Z8 BASIC to use a fixed baud rate for a given frequency.

    The assembly listing conflicts with the pure hex data. Not major, I can fix it, but it shows they did not check it.

    Hip repair surgery means I have to take bus or train to work for a while. This takes longer than my usual 35 minute cycle ride, so I have less free time. I will have to do hobby work at the weekends.

    2020-02-03

    Found source code for a Z8 disassembler, which says it compiles with Microsoft C. It compiles with cygwin gcc but crashes when run. Also gives a segmentation fault when compiled under Linux on my home PC.

    The problem was that Linux has 32-bit ints and 64-bit long ints, while the original code expected 16-bit ints and 32-bit long ints. Therefore Linux produced 64-bit indexes which is far too big. I conditionally #define  int32 depending on the environment. It now compiles and runs without crashing.

    It assumes the code is located at 0000h and the program counter initialises to zero.

    The RZ8 ROM begins at 1000h and contains ASCII text, data and BASIC. I do not know the machine-code entry points, but I can read the BASIC text and see it makes USR calls  here:

    usr(84): (a routine in BASIC ROM)
    if and(usr(84),%5f)<>%43 goto 30089"

    if usr(%1776,s,e)=0 goto 30070"
    if usr(%1779)<>0 goto 30064
    if usr(%177c,s,e)=0 goto 30087
    if usr(%177f)<>0 goto 30082

    The monitor manual says

    30040 - 30041 Cassette reading
    30060 - 30089 EPROM programming
    30090 - 30093 EPROM reading
    30200 - 30201 Memory modification
    30210 Memory examination

    which gives clues as to what the usr routines do. I imagine the s,e parameters are start,end for EPROM reading and writing.

    2020-01-04

    Added code to show the BASIC code in the ROM. Results uploaded.

    2020-02-09

    Uploaded assembly source code that generates the original ROM data. Quite a lot of work!
    It shows text and BASIC, and the rest is from a disassembly. The latter may be code or data, I don't have time to analyse this in full detail. I leave that to experienced Z8 programmers. It is a good starting point.