#Bruce Dawson Review
05-Jan-89 11:53:48
Sb: #28888-#Bruce Dawson Review
Fm: Richard Rae/SYSOP 76703,4253
To: microsmiths 76004,1766
Right, but with word addresses you have the same problem, I.E., if one of them
won't fit into a +/- 32K range, you've got to stick in a longword, which blows
up the table, or insert an island branch somewhere. This approach is
absolutely, completely foolproof.
As far as size is concerned, if I was writing code for an embedded control
system with limited ROM (which I happen to be doing at the moment, but that's a
whole 'nother story), I'd keep an eye on it. But good heavens, even if you
have a hundred entry vector table (which would be huge), we're only talking
about an overhead of two hundred bytes here. (If you compare it with short
branches, that's STILL only 300 bytes.) In even a lil' 512K machine 200 bytes
is trivial. AND if it comes down to it, I'd wager a good programer could find
far more than 200 bytes wasted in a progam large enough to require a 100 entry
vector table. Here, change those modules you are JUMPing to to subroutines and
CALL them with longwords. Now the end of each one returns to just after the
vectored jump, and you can then swing back into your main loop. A RTS is one
byte shorter than a short branch; tada… there's 100 bytes right there. I'll
leave it to you to find the other byte. 😉
I'd rather squander space on solid, reliable code and clean up dregs elsewhere.
(Which I'm sure you would as well; I'm not accusing you of anything.)
Rick