DEFINITION MODULE AddrReg;

FROM items IMPORT ITEM, REGISTER;

EXPORT QUALIFIED ClearFromAddrRegSlave, 
                 ReleaseAddrReg,
                 PutIntoAddrRegSlave, 
		 DecUseCount, IncUseCount,
		 InAddrRegSlave, FreeAddrReg,
                 AddrRegStillAvailable,
		 FreeForFor, FreeAfterFor,
		 MarkForFor, PurgeAddrRegSlave,
                 PurgeVariablesInAddrRegSlave,
		 GetExternalBaseAddr, AddressMove,
                 GetAddrOnPsStkIntoUseableForm,
                 GetAddrRegsForBlockMove, SlavedExternal,
                 ProtectAddress, UnprotectAddress;

		 
PROCEDURE ClearFromAddrRegSlave (VAR item : ITEM);
PROCEDURE ReleaseAddrReg (reg : REGISTER);
PROCEDURE PutIntoAddrRegSlave (Reg : REGISTER; VAR item : ITEM);
PROCEDURE DecUseCount (Reg : REGISTER; PsStkPosn : CARDINAL);
PROCEDURE IncUseCount (Reg : REGISTER; PsStkPosn : CARDINAL);
PROCEDURE InAddrRegSlave (VAR item : ITEM; 
                          VAR Reg : REGISTER) : BOOLEAN;
PROCEDURE FreeAddrReg (PsStkPosn : CARDINAL) : REGISTER;
PROCEDURE AddressMove (VAR addr, StkPosn : ITEM);
PROCEDURE MarkForFor (Reg : REGISTER);
PROCEDURE FreeForFor () : REGISTER;
PROCEDURE AddrRegStillAvailable (VAR Reg : REGISTER) : BOOLEAN;
PROCEDURE FreeAfterFor (Reg : REGISTER);
PROCEDURE PurgeAddrRegSlave (AfterProcCall : BOOLEAN);
PROCEDURE PurgeVariablesInAddrRegSlave ();
PROCEDURE GetExternalBaseAddr (disp : INTEGER) : REGISTER;
PROCEDURE GetAddrOnPsStkIntoUseableForm 
                  (PsStkPosn : CARDINAL; ForIndex : BOOLEAN);
PROCEDURE GetAddrRegsForBlockMove (VAR source, dest : ITEM);
PROCEDURE SlavedExternal (offset : CARDINAL; VAR reg : REGISTER) : BOOLEAN;
PROCEDURE ProtectAddress (VAR Address : ITEM);
PROCEDURE UnprotectAddress (VAR Address : ITEM);
END AddrReg.
