And I have some example code to create a run file here, though no examples
of a driver like that.

The template code does include a note how you have to exit differently for
a driver that stays resident vs a normal app that doesn't.

https://github.com/bkw777/WP-2_IC-Card/tree/master/SOFTWARE

The z88dk dir has an empty template asm and both memutil and dumprom are
working runnable apps. You can ignore all the stuff about the ic card and
bodge wires etc. memutil is just a hex viewer and editor you can run on any
machine.

Also of course John's CamelFORTH
http://bitchin100.com/files/wp2/CAMEL.ZIP


I adopted a convention that run files that run from ram have a .PR
extension and ones that run from rom have a .PI extension, because they are
different file formats, and there is an ID field that has those letters in
it. The machine doesn't care what run files are named so there is no other
convention or standard I could find. I don't like .CO for this because the
header is not a .CO header.

So that's a few different hello world starting point examples how to
construct an executable and use the main rom routines, though no example of
a driver/filter yet.

-- 
bkw





On Tue, Nov 17, 2026, 12:54 AM John R. Hogerhuis <[email protected]> wrote:

> Almost certainly, apparently! It's almost as if this eventuality was
> prepared for!
>
> From the WP-2 service manual:
>
> "HANDLER OF TIMER INTERRUPT
>
> To handle the TIMER interrupt, the following must be done.
> 1) Refer to hook table of timer interrupt.
> 2) Initialize the TIMER device.
> 3) Power Switch status is checked and handled.
> 4) Control the LOW BATTERY indication.
> 5) Control the LOW BACK UP indication.
> 6) Auto Power Off control
> 7) Refer to hook table of key scan.
> &) Handle the key scan.
>
> *If you want to change the Key Scan Handler of the WP-2 to another
> handier, you need to design the other Key Scan Handler as a RUN FILE
> PROGRAM. The initialize routine must rewrite the hook table to hook the
> other handler; that is, the entry address of the handler is written from
> the second byte in the hook table, and the instruction code for jump
> command is written into the first byte. The instruction 'POP' must be
> included in the handler routine as a dummy to ignore the handler of the
> WP-2.*
>
> HOOK TABLE OF DEBUGGER
>
> To refer the hook table of the Debugger, execute the instruction 'RST 28H\
> It will be used by the BREAK function to set the instruction 'RST 28H' to
> the address of the break pointer.
>
> 4-19"
>
> ...
>
> You could write it yourself. Or just feed the manual into Claude Code or
> similar and have it create a loadable Z80 program for you. Seems like
> everything is there. Even a debugger hook! That might make it easy for a
> coding agent to iterate through experiments.
>
> Neat little project.
>
> -- John.
>

Reply via email to