Automatic MIKBUG patcher
My monitor program contains all major functions needed for MIKBUG applications to run but I did not bother to place all routines at the same locations as MIKBUG. Instead my monitor uses a jump table in the beginning of ROM to make things more robust and easier to maintain. The disadvantage is that I loose the direct MIKBUG compatibility. MIKBUG software needs to be altered to run on my system. It's usually an easy find-and-replace task when the source code is available but for binaries without source this can be a bit time consuming. Therefore I have written a piece of software that does this conversion automatically. Theory of operation MIKBUG resides in two pages of ROM. Pages $E0 and $E1. My jump table is on page $C0. Programs using routines from the monitor either JMP or JSR to them. Therefore converting a program from MIKBUG calls to MC3 calls requires some digging through the machine code and changing all JMP/JSR calls to page $E0 and $E1 to new routines in page $C0. My patcher program does this automatically. It looks for three-byte series that matches JMP or BSR to known MIKBUG routines. Example op code $BD $E1 $D1 corresponds to JSR OUTEEE in MIKBUG. This shall be changed to $BD $C0 $03 for MC3 compatibility. The program uses two tables containing MIKBUG and MC3 routines and converts every op code it finds. User need to supply start and end addresses for search. Source code is available below. MIKBUG auto patcher - source Example of usage I found an old MIKBUG chess program among some old floppies. No source code or manual was available and quite a lot of patching had to be done. This was a perfect task for my new auto patcher. The chess program loads between $0100 and $1FB7 - raw S19 dump Output from the auto patcher program I gave the auto patcher the range $0100-$1FB7 to work with and the output displays the calls that where patched. MIKBUG AUTO PATCHER FOR MC3 START ADDRESS: 0100 END ADDRESS: 1FB7 0383 BD E1 D1 PATCHED 0389 BD E1 D1 PATCHED 038E BD E1 D1 PATCHED 03AD BD E1 D1 PATCHED 03B9 BD E1 AC PATCHED 03C7 BD E1 D1 PATCHED 0444 BD E1 D1 PATCHED 0449 BD E1 D1 PATCHED 044E BD E1 D1 PATCHED 0453 BD E1 D1 PATCHED 0458 BD E1 D1 PATCHED 045D BD E1 D1 PATCHED 0465 7E E1 D1 PATCHED 0C3D 7E E0 E3 PATCHED 1A22 7E E0 E3 PATCHED > After the patching the chess program runs and is playable without any further modifications. Execution starts at $0100. WHAT IS YOUR NAME ? DANIEL DO YOU WANT TO BE WHITE OR BLACK DANIEL ? WHITE ENTER 1=LONG GAME, 0=SHORT GAME ? 0 --------------------------------- 8 I R I N I B I Q I K I B I N I R I --------------------------------- 7 I P I P I P I P I P I P I P I P I --------------------------------- 6 I I I I I I I I I --------------------------------- 5 I I I I I I I I I --------------------------------- 4 I I I I I I I I I --------------------------------- 3 I I I I I I I I I --------------------------------- 2 I P*I P*I P*I P*I P*I P*I P*I P*I --------------------------------- 1 I R*I N*I B*I Q*I K*I B*I N*I R*I --------------------------------- 1 2 3 4 5 6 7 8 WHERE IS THE PIECE YOU WANT TO MOVE DANIEL ? Nostalgic game play. Whites are marked with an '*'. Enter '2 1' for the left knight for example. The program appears to support more advanced moves like castling and such but I have no idea how to invoke those commands from the command line. Further investigation is needed. It's unknown to me who wrote this chess program. I you are the author and do not want it to be here. Just let me know.

Write a comment

Name or handle

E-mail (optional and not visible to others)

Comment


Code from above