And Acorn
also used the two byte vector:
Quote:
0200-0201 User vector(USERV)
0202-0203 BRK vector(BRKV)
0204-0205 Interrupt-request vector 1(IRQ1V)
0206-0207 Interrupt-request vector 2(IRQ2V)
(User interrupt routines vectored here)
0208-0209 OSCLI vector(CLIV)
020A-020B OSBYTE vector(BYTEV)
020C-020D OSWORD vector(WORDV)
020E-020F OSWRCH vector(WRCHV)
0210-0211 OSRDCH vector(RDCHV)
0212-0213 OSFILE vector(FILEV)
0214-0215 OSARGS vector(ARGSV)
0216-0217 OSBGET vector(BGETV)
0218-0219 OSBPUT vector(BPUTV)
021A-021B OSGBPB vector(GBPBV)
021C-021D OSFIND vector(FINDV)
021E-021F File system control entry vector(FSCV)
0220-0221 Event interrupt vector(EVNTV)
0222-0223 User's print routine vector(UPTV)
0224-0225 Used by ECONET to take control of computer(NETV)
0226-0227 Unrecognised VDU23 and PLOT commands(VDUV)
0228-0229 For all keyboard access(KEYV)
022A-022B Insert into buffer vector(INSV)
022C-022D Remove from buffer vector(REMV)
022E-022F Count/purge buffer vector(CNPV)
You could think of these as a way to override a method, or to hook into a routine to add value. Your example of adding print logging is a good one. Another would be to add handling of control codes in an output stream. Or one might add instrumentation to see how often, or when, or with what arguments something is called. Or insert a bug fix!
If the new handler calls the old, then the insertion method can be used again by another handler, so they daisychain. If it doesn't, then it replaces whatever the current chain is with its own behaviour.
The VDUV in the Acorn list is a good example: PLOT commands could be extended to draw ellipses, patterned lines, do flood fill, and so on.
The two IRQ vectors in the Acorn scheme is an interesting facility: one hooks in early, so the new code can act ahead of or instead of the OS behaviour, and the other hooks in late, so it doesn't add latency to the OS behaviour.
(However, in Acorn land an application doesn't call the vectors, it calls the ABI entry points in high memory. That's because the application might be running on the I/O processor or on a second processor. The vectors are a mechanism used on the I/O processor where the OS actually resides.)
BTW I'm not sure about your code snippets. The vector would be modified once, at installation of a driver, to be used for all subsequent uses. So the installation updates the vectors, possibly saving the old value for use by the new routine in case it daisy chains. The installation doesn't call the newly vectored code at all.
(I've a feeling I haven't been terribly clear)