Login
Back to forumReply to this topicGo to last reply

Posted By

Fuzzweed
on 2025-06-23
16:02:57
 Vectored kernal routines

Just looking at the ROM disassembly and e.g. routines $FFD2 and $FFE4 are jumps to other parts of the ROM ($EC4B and $EBD9).

What is the reason to jsr to the jump vector rather than directly to the routine? Would it not be slightly faster to call the routine directly?
Posted By

SukkoPera
on 2025-06-23
16:16:07
 Re: Vectored kernal routines

The reason is portability: If they need to fix a bug in a routine, or add functionality in a following version, they might need to move stuff around, and if your code jumps directly to the function, it will stop working. If instead you jump to the vector, they will just put the new address there and your code will still work perfectly.

And while today it is rather unlikely that a new ROM version will come out, the added level of indirection also helps with porting the code among different platforms: for instance, $FFD2 works the same on VIC20, C64, +4 and (I guess) C128. If you write clever code, it can run everywhere (to some extent, of course!).

BTW, no need to look at the disassembly, the original sources are available.
Fuzzweed1


Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2025. Support Plus/4 World on Patreon