CEGMON Patches for the microUK101

by Grant Searle

Last update: 31st March 2008

The original ROM contents were modified to remove options to print to the screen. Instead ALL I/O will be passed to/from the serial port.

A simple disassembly of the ROM can be found here. Please refer to this listing to allow you to understand the patches that I have applied.

I intended the patch to be as simple as possible, so I have not removed the original screen handling routines, but have merely applied minimal patching to allow the microUK101 to function properly.

The following locations were patched to produce the version that I use in the microUK101:

LOC  OLD   NEW
FB46 2C -> EA
FB47 03 -> EA
FB48 02 -> EA
FB49 10 -> EA
FB4A 1D -> EA
FB4B A9 -> EA
FB4C FD -> EA
FB4D 8D -> EA
FB4E 00 -> EA
FB4F DF -> EA
FB50 A9 -> EA
FB51 10 -> EA
FB52 2C -> EA
FB53 00 -> EA
FB54 DF -> EA
FB55 F0 -> EA
FB56 0A -> EA

FB95 12 -> 00
FB96 02 -> F0
FB97 D0 -> 4A
FB98 FA -> 90
FB99 A9 -> 0A
FB9A FE -> AD
FB9B 8D -> 01
FB9C 00 -> F0
FB9D DF -> C9
FB9E 2C -> 03
FB9F 00 -> D0
FBA0 DF -> 03
FBA1 70 -> 4C
FBA2 F0 -> 36
FBA3 A9 -> A6
FBA4 FB -> 60
FBA5 8D -> EA
FBA6 00 -> EA
FBA7 DF -> EA
FBA8 2C -> EA
FBA9 00 -> EA
FBAA DF -> EA
FBAB 70 -> EA
FBAC E6 -> EA
FBAD A9 -> EA
FBAE 03 -> EA
FBAF 4C -> EA
FBB0 36 -> EA
FBB1 A6 -> EA

LOC  OLD   NEW
FCEA 43 -> 4D
FCEB 45 -> 69
FCEC 47 -> 63
FCED 4D -> 72
FCEE 4F -> 6F
FCEF 4E -> 20
FCF0 28 -> 55
FCF1 43 -> 4B
FCF2 29 -> 31
FCF3 31 -> 30
FCF4 39 -> 31
FCF5 38 -> 20
FCF6 30 -> 43
FCF7 20 -> 2F
FCF8 44 -> 57
FCFA 43 -> 4D
FCFB 2F -> 3F
FCFC 57 -> 20
FCFD 2F -> 20
FCFE 4D -> 20
FCFF 3F -> 20

FEE9 A5 -> EA
FEEA FB -> EA
FEEB D0 -> EA
FEEC 93 -> EA
FEEE 00 -> 80
FEEF FD -> FE

FF0A 20 -> EA
FF0B 59 -> EA
FF0C FE -> EA














 

LOC  OLD   NEW
FF18 16 -> 13
FF20 C9 -> EA
FF21 44 -> EA
FF22 D0 -> EA
FF23 03 -> EA
FF24 4C -> EA
FF25 00 -> EA
FF26 FC -> EA

FF9B 20 -> EA
FF9C 36 -> EA
FF9D F8 -> EA
FF9E 48 -> EA
FF9F AD -> EA
FFA0 05 -> EA
FFA1 02 -> EA
FFA2 F0 -> EA
FFA3 17 -> EA
FFA4 68 -> EA
FFA8 C9 -> 60
FFA9 0D -> EA
FFAA D0 -> EA
FFAB 10 -> EA
FFAC 48 -> EA
FFAD 8A -> EA
FFAE 48 -> EA
FFAF A2 -> EA
FFB0 0A -> EA
FFB1 A9 -> EA
FFB2 00 -> EA
FFB3 20 -> EA
FFB4 B1 -> EA
FFB5 FC -> EA
FFB6 CA -> EA
FFB7 D0 -> EA
FFB8 FA -> EA
FFB9 68 -> EA
FFBA AA -> EA
FFBB 68 -> EA







 

Note, the 6502 OpCode for value EA = "NOP"

Details of the patched bytes

Location FB46 is the BASIC input routine to get a character from the KB or ACIA. I simply replaced the keyboard checking with NOPs to always cause the processing to read from the ACIA.

FB94 to FBB1 is the entry for the Control-C handler. I re-wrote this as it used to use dedicated hardware access.See below for details of my revised routine.

Locations FCEA to FCFF contained the message "CEGMON(C)1980 D/C/W/M?"
This can be replaced by any message the same length (please note that the "D" option is no longer available, and I have removed it from the message in the patched ROM).

Location FEE9 to FEEF gets a character from the KB or ACIA. I simply replaced the keyboard checking with NOPs to always cause the processing to proceed to the ACIA input routine.

FF0A to FF0C - NOPs replace the call to clear the screen.

FF20 to FF26 - Replaced with NOPs to prevent the user selecting disk boot (option "D" from the original selections).

FF9B is the entry to the write char to screen or ACIA. NOPs replace the code to test if the screen should be used to ensure the ACIA is always used. Also, the code to add NULLs to the output stream has also been replaced with NOPs.

Control-C handler

The original CEGMON ROM directly accessed the keyboard hardware to determine if the Control and "C" keys were pressed. this is no longer possible in the serial-only version, so I have re-written the Control-C handler code as follows:

FB94:    LDA    $F000   AD 00 F0
         LSR    A       4A
         BCC    nochar  90 0A        - Check if there is a character in the input buffer
         LDA    $F001   AD 01 F0
         CMP    #3      C9 03        - Check if the entered character is Control-C
         BNE    nochar  D0 03
         JMP    A636    4C 36 A6     - Jump to Control-C breakpoint
nochar   RTS            60           - Return if Control-C was not pressed

At location FB94, I have removed the check to see if Control-C should be disabled (by examining loc 212H), but you could reinstate it if you wish.

 

Back to microUK101 page