ThorstenOtto wrote:BTW your example my_trap1_c_handler for the gemdos trap only works by accident. If you would do anything useful there, and the compiler chooses to save some registers to the stack first, you cannot just call the old vector, because the original saved parameters to that function are at the wrong offset.
What parameters? It's a void function, by definition.
It would also not work when compiled without optimization, because then the call to oldvec is done by a jsr.
Oh really. So instead of jmp old_vec + RTS in old_vec I would have jsr old_vec + RTS in old_vec + RTS in my_trap1_c_handler. Care to explain how this wouldn't work?
EDIT: Got this, too. ;) I guess you meant that if the system trap vector is called by JSR it would return with RTE what is wrong, of course. The updated code fixes this as well so thanks for spotting this!