Amiga executables get the command length in d0 and the command buffer in a0.
I would like to pass SysBase (normally 4) in another register, e.g. d1.
Obviously only d1-aware executables will actually switch to that new base address. I can make PDPCLIB-based programs d1-aware.
For PDPCLIB-based programs to still work on standard AmigaOS, I cannot expect d1 to be set. It is a random value.
I was thinking that what I could do is see if d0 is more than 2 GiB. If it is above 2 GiB, then I will do two things:
1. Subtract 2 GiB from d0
2. Set SysBase to d1
Otherwise, SysBase will be set to 4.
That would give me the flexibility to run PDOS under AmigaOS and load and handle d1-aware Amiga executables (within PDOS).
Does that sound feasible?
Thanks. Paul.
|