User`s manual

Dynamic C Users Manual digi.com 189
The following example from RS232.LIB illustrates the new I&D space compatible way of modifying
interrupt vectors.
The following function serAclose() from Dynamic C 7.25, is not compatible with separate I&D
space:
#asm xmem
serAclose::
ld a,iir ; hl=spaisr_start, de={iir,0xe0}
ld h,a
ld l,0xc0
ld a,0xc9 ; ret in first byte
ipset 1
ld (hl),a
ld a,0x00 ; disable interrupts for port
ld (SACRShadow), a
ioi ld (SACR), a
ipres
lret
#endasm
This version of serAclose() in Dynamic C 7.30 is compatible with separate I&D space:
#asm xmem
serAclose::
ld a, 0xc9
ipset 1
ld (INTVEC_BASE + SERA_OFS), a ; ret in first byte of spaisr_start
ld a, 0x00 ; disable interrupts for port
ld (SACRShadow),a
ioi ld (SACR),a
ipres
lret
#endasm