The interrupt vector itself cannot be re-written. However, a process such as that described below can handle the situation.
Prepare a variable in which to set the address of the actual processing area in the short direct field, and store in advance the address of the processing area to be processed with the next interrupt. If an interrupt is accepted in this state, that variable is read and the program is branched to that address. In this way, the time it takes from interrupt acceptance to the actual processing is always the same.
Specifically, DSEG is declared in the saddr attribute to secure a 2-byte field (Intaddr in this case) as described below.
DW 2 ;Interrupt processing address storage field
Next, the following process is executed at the beginning of the interrupt processing:
PUSH AX ;Save the content of the AX register to the stack.
; As needed, other registers to be used in the interrupt are saved in the stack.
MOVW AX,Intaddr ;Read the processing address
BR AX ;Branch to the processing address
Now, the program can branch to the actual interrupt processing area while the AX (and other) register(s) are saved in the stack. Since this processing is constant regardless of the actual content to be processed by an interrupt, it satisfies the requirement.
There is also a method that uses a flag and table reference to acquire the address to be actually processed, and branches the program to that address. However, to minimize as much as possible the delay following the generation of an interrupt, the above-mentioned method, which sets the processing address in a variable in advance, is more advantageous.