User`s manual

188 digi.com Using Assembly Language
The following example from RS232.LIB illustrates the new I&D space compatible way of modifying
interrupt vectors.
The following code fragment to set up the interrupt service routine for the periodic interrupt from Dynamic
C 7.25 is not compatible with separate I&D space:
#asm xmem
;*** Old method ***
ld a,iir ; get the offset of interrupt table
ld h,a
ld l,0x00
ld iy,hl
ld (iy),0c3h ; jp instruction entry
inc iy
ld hl,periodic_isr ; set service routine
ld (iy),hl
#endasm
The following code fragment shows an I&D space compatible method for setting up the ISR for the peri-
odic interrupt in Dynamic C 7.30:
#asm xmem
;*** New method ***
ld a, 0xc3 ;jp instruction entry
ld hl, periodic_isr ;set service routine
ld (INTVEC_BASE+PERIODIC_OFS), a ;write to the interrupt table
ld (INTVEC_BASE+PERIODIC_OFS+1), hl
#endasm
When separate I&D space is enabled, INTVEC_BASE points to a proxy interrupt vector table in RAM
that is modifiable. The code above assumes that the actual interrupt vector table pointed to by the IIR is set
up to point to the proxy vector. When separate I&D space is disabled, INTVEC_BASE and the IIR point to
the same location. The code above is an example only, the default configuration for the periodic interrupt
is not modifiable.