New 8K ROM Potpourri

Author(s): David Ornstein
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v2 n11 (Volume 2, Issue 11)
Date: November 1981
Pages: 7

As you know, Sinclair’s first 8K ROM has a few bugs. By the time you read this, however, Sinclair should have received updated, corrected ROMs which contain four primary modifications:

1–The INPUT routine (at 0EE9h in both 8K ROMs) contains a CALL 14A3h as the third instruction. This subroutine, actually part of the CLEAR routine, clears the memory area used to hold keyboard input. It sets the system variables STKEND and STKBOT equal to E*LINE, the pointer to the first byte of the input buffer. The CALL has been added at 0EEFh (new ROM). Thus, all code up to this point is identical in both 8K ROMs. Beyond this address, all code in the new ROM is offset by three bytes.

2–In the old 8K ROM, a bug in the PAUSE routine (at 0F32 in new ROM, 0F2F in old ROM) caused the machine to crash if you didn’t POKE 16437, 255 after PAUSEing. The offending instruction (at 0F3D in old ROM) was a SET 7,(IY+35) where IY held 4000h. This has been replaced with LD (IY+35),FE. Because of the three bytes added to the INPUT routine, the LD is at 0F40h in the new ROM. Now you no longer need to POKE 255 to 16437 every time you PAUSE with the new 8K ROM.

3–The evaluation routines are changed. The old code (at 102Fh in the new ROM) tested bit 6 of the system FLAGS. Originally a BIT instruction, it is now:

LD A,(4001)
CP #C0

This change moves all code beyond 1032h forward another byte.

4–The floating-point to 16-bit conversion routine has been changed. In the new ROM, three instructions have been deleted:

LD A,H
SUB L
LD H,A

Although I have not fully analyzed the new 8K ROM, I suspect that these three instructions, originally located at 1734h in the old ROM, are the cause of users’ troubles with numerical calculations. The end result of this deletion is that all code beyond 1737h is moved back three bytes.

These changes result in the following new 8K ROM map:

Loc. (hex)
0000        NMI Off
            Jump to Initialization
0008        Restarts
0066        NMI (Slow) Handler
007E        Keyboard Decode Table
00CC        Function (Keyboard)
             Decode Table
00F3        Graphics (Keyboard)
             Decode Table
0111        Command (Keyboard)
             Decode Table
01FC        I/O Routines
03A2        Initialization and
             Editing
0562        Mode/Edit Table
0575        List, etc.
0C29        Command Offset Table
0C48        Command Pointer Table
0D16        Syntax Class Table
0D1D        Class Evaluation
             Routines
0DAB        Command Handlers
0F55        Expression Evaluator
1263        String Slicing
14D9        Decimal to Floating
             Point Conversion
             Routine
158A        Floating Point to 16-
             Bit Conversion
             Routine
174C        Handlers for the Four
             Basic Arithmetic
             Operators
1923        Function Address Table
199D        Calculator
1A45        Function Evaluation
             Routines
1E00        Character Generator

ZX81 2K RAM UPGRADE: Blair Evans (Arlington, MA) told us of a 2K x 8 RAM chip that will fit the ZX81. Part #6116 from Hitachi and others.