(**************************************************************************

     $RCSfile: Cia.mod $
  Description: Interface to ciaa.resource and ciab.resource

   Created by: fjc (Frank Copeland)
    $Revision: 1.2 $
      $Author: fjc $
        $Date: 1994/05/12 19:11:02 $

  Copyright © 1994, Frank Copeland.
  This file is part of the Oberon-A Library.
  See Oberon-A.doc for conditions of use and distribution.

  Log entries are at the end of the file.

***************************************************************************)

MODULE Cia;

(* $P- allow non-portable code *)

IMPORT T := Types, E := Exec;

CONST

  CiaAName * = "ciaa.resource";
  CiaBName * = "ciab.resource";

(*-- Resource Base variable --------------------------------------------*)

TYPE

  CiaBasePtr = CPOINTER TO CiaBase;
  CiaBase = RECORD (E.Library) END;

VAR

  CiaA *, CiaB * : CiaBasePtr;

(*-- Resource Functions ------------------------------------------------*)

LIBCALL (base : CiaBasePtr) AddICRVector*
  ( iCRBit        {0} : LONGINT;
    VAR interrupt {9} : E.Interrupt )
  : E.InterruptPtr;
  -6;
LIBCALL (base : CiaBasePtr) RemICRVector*
  ( iCRBit        {0} : LONGINT;
    VAR interrupt {9} : E.Interrupt );
  -12;
LIBCALL (base : CiaBasePtr) AbleICR*
  ( mask {0} : SET )
  : T.WSET;
  -18;
LIBCALL (base : CiaBasePtr) SetICR*
  ( mask {0} : SET )
  : T.WSET;
  -24;

(*-- Resource Base variable --------------------------------------------*)
(* $L- Address globals through A4 *)

(*-----------------------------------*)
PROCEDURE OpenCiaA * ();

BEGIN
  IF CiaA = NIL THEN
    CiaA := E.Base.OpenResource (CiaAName);
    IF CiaA = NIL THEN HALT (100) END;
  END;
END OpenCiaA;

(*-----------------------------------*)
PROCEDURE OpenCiaB * ();

BEGIN
  IF CiaB = NIL THEN
    CiaB := E.Base.OpenResource (CiaBName);
    IF CiaB = NIL THEN HALT (100) END;
  END;
END OpenCiaB;

END Cia.

(**************************************************************************

  $Log: Cia.mod $
  Revision 1.2  1994/05/12  19:11:02  fjc
  - Prepared for release

  Revision 1.1  1994/01/15  21:17:52  fjc
  - Start of revision control

***************************************************************************)

 

(* Comments stripped by StripComments 1.0 *)
