To use this file copy and paste this:
// #URL-lib "http://pin1.org/forthlib/flb/IASI2/IASI2-b.flb" into BV Terminal 3
or here to download.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// IASI2 interface
// This library is use for the new IASI version 2 devices
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// HISTORY:
// Dec 2008 Version b of this libraty stored the o/p from the device
// or devices to a buffer, i-buffer
// CONSTANTS:
&E0010000 constant U1DLL
&E0010004 constant U1DLM
&E001000C constant U1LCR
62 constant I-ACK // '>'
20 constant BMAX
BMAX vspace$ i-buffer // o/p goes into here
Full Contents of File
&E0010000  constant  U1DLL
&E0010004  constant  U1DLM
&E001000C  constant  U1LCR
62  constant  I-ACK 
20  constant  BMAX
BMAX  vspace$  i-buffer 
: baud1 
        rate  16  *  10 
        PCLK  swap 
        5  +  10 
        256  u
        &83  U1LCR  ! 
        U1DLM  !         
        U1DLL  !         
        &3  U1LCR  !   
;       
: baud1@
        &83  U1LCR  ! 
        U1DLM  @         
        256  *
        U1DLL  @         
        +
        &3  U1LCR  !   
       
        16  *  pclk  swap  u
;       
: cr113  emit1  ;             
: stype1
        addr  255  +         
        addr                     
        do
                i  c@  0= 
                if 
                        leave
                else
                        i  c@  emit1         
                then
        next       
; 
: iu.<#  #s  #>  stype1  ;               
: i-in
        0 
        50000
        for
                key1?
                if
                        drop
                        key1
                        leave
                then     
        next                                 
;
: i-ack?
        i-in  I-ACK  =
;       
: i-send
int#:  bcount  0
        0  i-buffer  c! 
        begin
                i-in  ?dup  0  <>
        while
                dup 
                i-buffer  bcount  +  c! 
                1  +>  bcount
                bcount  BMAX  >  if  ."  buffer  full"  abort  then
                I-ACK  =  if
                        0  i-buffer  bcount  1  +  +  c! 
                        escape 
                then 
        repeat
        0  i-buffer  bcount  1  +  +  c! 
;               
: i-buff.
        i-buffer  stype     
;
: i-cbuff
        BMAX  for  0  i  i-buffer  +  c!  next
       
        key1?
        if
                begin
                        key1  drop
                        key1?  0= 
                until
        then               
;
: i-autobaud
        3  for 
                cr1  10  ms 
        next
        10  ms
        4  emit1  cr1     
        100  ms           
        i-cbuff       
;
: i-ndev
int#:  devices  0
        i-cbuff           
        1  emit1  cr1   
        780  ms           
        i-send           
        -1                     
        begin
                1+  dup  i-buffer  +  c@  ?dup  0  <>
        while
                I-ACK  =  if  1  +>  devices  then 
        repeat     
        drop 
        devices
;
: i-connect
        i-autobaud
        i-ndev
;
                   
: i-device
int#:  found  0
        i-ndev           
        if
                -1                     
                begin
                        1+  dup  i-buffer  +  c@  ?dup  0  <>
                while
                        address  =  if  1  +>  found  then 
                repeat     
                drop 
                found   
        else
                ."  No  devices  connected"
                0     
        then                       
;
: i-resetall
        3  emit1  cr1     
        i-connect               
;       
: i-setaddress
        i-cbuff
        old  emit1  [char]  U  emit1  cr1   
       
        old  emit1  [char]  A  emit1  new  emit1
        i-ack?
;       
: i-commandB
        i-cbuff
        adr  emit1  [char]  B  emit1 
        eeadr  iu.   
        text  stype1  cr1
        i-ack?
;
: i-commandC
        i-cbuff
        emit1  [char]  C  emit1  cr1
        i-ack?
;
 
: i-commandD
        emit1  [char]  D  emit1 
        iu.  cr1
        begin
            i-ack?
        -1  =  until
;                           
: i-commandE
        i-cbuff
        emit1  [char]  E  emit1  cr1
        i-ack?
;
: i-commandF
        i-cbuff
        emit1  [char]  F  emit1
        [char]  Y  emit1  [char]  e  emit1  [char]  S  emit1  cr1 
        i-ack?
;
: i-commandG
        adr  emit1  [char]  G  emit1
        start  iu.  bytes  iu.
;
       
: (i-ipb)     
        i-cbuff         
        13  word         
        stype1 
        cr1                 
;
: i-sendit
       
        i-buff.         
        cr
;
: i-report
        i-connect
        cr  ."  Number  of  devices  connected  "  u.
        i-buff.
;           
: i-gn
int:  bc  num  mult
        0  =>  num
        1  =>  mult
        i-buffer  0  I-ACK  instr$     
        dup  =>  bc
        0  <> 
        if
                begin
                        -1  +>  bc               
                        bc  i-buffer  +  c@  48  - 
                        mult  *  +>  num
                        mult  10  *  =>  mult
                        bc  0=
                until
                num  -1
        else
                0     
        then
;                 
: xi-connect  ;