BigEd wrote:
Amstrad's machines very deliberately pulled the rug from underneath developers who called direct into the ROM, by moving things around, unapologetically. In principle that left Amstrad free to improve their implementations so long as they preserved the official interface.
Commodore did the same thing and made sure programmers knew it by relentlessly telling them to utilize the "kernal" jump table to call ROM routines. The jump table was stable from inception to the final days of eight bit Commodore production, but the routines themselves were frequently relocated as new ROM revisions were developed. If new routines were added, as was the case when the C-128 went into production, their entry points were tacked on to the bottom end of the jump table so none of the previous table entries were relocated. Hence, for example, a call to
BSOUT was guaranteed to work no matter which machine was in use, as
BSOUT was always at
$FFD2 and maintained the same parameter requirements in all cases.
Prior to the C-128, no Commodore machine had a BASIC ROM jump table, so it was every man for himself when it came to utilizing BASIC subroutines from within user-written assembly language programs, e.g., calling the floating point math functions. The C-128 had a formal BASIC jump table which was fully documented, but was tricky to use due to memory mapping acrobatics. The C-128's resident M/L monitor also had a formal jump table.