Closed sam-falvo closed 8 years ago
Even better still would be if we could express the interface to the kernel as a (set of) COM object(s). But, I think I'll wait for STS V2.0 for that.
Relying on ECALL
is perhaps an option here as well. But, this gets somewhat complicated, for now we need to deal with CPU state (saving and restoring CPU registers, etc.).
For ROM-resident programs, I can get away with this kind of really hacky solution, only because the assembler knows where everything is:
This works, of course, but is inelegant. It'd be better to use a jump table instead:
Where
EPV_xxx
would be in increments of four, sinceX16
would point to an array ofJAL X0, xxx
instructions.