To use this file copy and paste this:
// #URL-lib "http://pin1.org/forthlib/flb/Interupts/interrupt.flb" into BV Terminal 3
or here to download.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// High level interrupts
// This file contains the words to activate and act
// upon interrupt requests. A request is made by placing an entry
// into the interrupt table using int> "word" (without the quotes)
// REQUIRES:
// #URL-lib "http://pin1.org/forthlib/flb/General/decompile.flb"
// CONSTANTS:
// the following constants map to the interrrupt 32bit word
// in the VIC tables, see LPC user manual chapter 5
4 constant TIMER0
5 constant TIMER1
6 constant UART0
7 constant UART1
8 constant PWM0
9 constant I2C0
10 constant SPI0
11 constant SPI1
12 constant PLL
13 constant RTC
14 constant EINT0
15 constant EINT1
16 constant EINT2
17 constant EINT3
18 constant AD0
19 constant I2C1
20 constant BOD
21 constant AD1
// -------------- Vector constants --------------------
&FFFFF010 constant VICena // RW enable 1 = enable
&FFFFF00C constant VICsel // 0 = IRQ 1 = FIQ
&FFFFF014 constant VICclr // 1 = clr-irq
Full Contents of File
4  constant  TIMER0
5  constant  TIMER1
6  constant  UART0
7  constant  UART1
8  constant  PWM0
9  constant  I2C0
10  constant  SPI0
11  constant  SPI1
12  constant  PLL
13  constant  RTC
14  constant  EINT0
15  constant  EINT1
16  constant  EINT2
17  constant  EINT3
18  constant  AD0
19  constant  I2C1
20  constant  BOD
21  constant  AD1
&FFFFF010  constant  VICena     
&FFFFF00C  constant  VICsel     
&FFFFF014  constant  VICclr     
: intr1 
dup  12  -  ?@  &f00  and  &900  =     
if                   
        8  - 
        dc2 
else 
        drop  ."  ?"           
then 
;
: (intr.)
        dup
        12  sys@  -  8  -  4  u
        dup  32  > 
        if
                drop  ."  [x]  "
        else       
                91  emit  <#  #  #  #>  stype  93  emit  space
        then       
        dup  ph.  space     
        dup  40  emit  @  ph.  41  emit  space 
        @  intr1 
;
: <0>intr.
        cr 
        12  sys@                 
        31  for
                dup    4  +
                cr
        next
        drop
;               
 
: <0>int>
        4  *                 
        8  +                 
        12  sys@    +   
        '             
        swap  !
;
: <0>int>>
        4  *                 
        8  +                 
        12  sys@    +   
        !           
;
: <0>intSel
    1  swap  lshift     
    VICsel  @               
    or  VICsel  !
;   
: <0>intEn
    1  swap  lshift     
    VICena  @               
    or  VICena  !
;   
: <0>intDis
    1  swap  lshift     
    VICena  @               
    or  VICclr  !
;