I’m writing a custom IPL for the STPC microprocessor and Neutino 1.1, using
Watcom wasm, wlink, and the mknto utility.
I have a working IPL, but have had to work around a problem that I would
like to solve.
IPL code created with wasm, wlink, and mknto creates code which is located
towards the top of the F0000h segment, and inserts
a reset vector jump at FFFFFFF0. The jump at this location loads the CS
register with F000h, and the IP with the beginning offset in the F0000h
segment where my code begins, for example, F909h.
The problem is that if I want to access tables of data, the offset
determined by the linker is based on treating the start of my code as offset
0h, which is incorrect when the program is run. All table offsets are ‘off’
by F909 (the starting address of my program in this case). The following is
small code example:
mov bx, offset TableData
mov al, cs:[bx]
TableData: db 01, 02, 04, 08,
The work-around I have found is to read the reset vector offset at FFFFFFF1
& FFFFFFF2 to determine the start of the program, and add this to the offset
TableData above. I’d like to find a better way, though, as I have a hard
coded jump instruction which is required for
switching execution from EPROM to shadow RAM.
Is there a clean way I can get wlink to determine the proper offsets, or to
force the program to start at F0000h (F000:0000, which would make all
offsets work out correctly).
Thanks for any help on this.