/*

File: address_protos.h
Author: Neil Cafferkey
Copyright (C) 1999-2001 Neil Cafferkey

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.

*/

#ifndef _address_protos_h
#define _address_protos_h


#include "address.h"
#include "exec/types.h"
#include "address_set.h"
#include <stdio.h>
#include "source_program.h"


/* Function: CreateAddress
 * =======================
 * Creates an Address. Possibly private.
 */

Address CreateAddress(SourceProgram src_prog,UWORD bank_no,ULONG offset);


/* Function: SetAddressInstruction
 * ===============================
 */

VOID SetAddressInstruction(Address address,Instruction instruction);


/* Function: GetAddressInstruction
 * ===============================
 */

Instruction GetAddressInstruction(Address address);


/* Function: SetSavedFlags
 * =======================
 */

VOID SetSavedFlags(Address address,LONGBITS new_flags);


/* Function: GetSavedFlags
 * =======================
 */

LONGBITS GetSavedFlags(Address address);


/* Function: GetContents
 * =====================
 */

UBYTE *GetAddressContents(Address address,SourceProgram src_prog);


/* Function: GetAddressDisassembly
 * ===============================
 */

TEXT *GetAddressDisassembly(Address address);


/* Function: GetAddressTranslation
 * ===============================
 */

TEXT *GetAddressTranslation(Address address);


/* Function: GetAddressOffset
 * ==========================
 */

ULONG GetAddressOffset(Address address);


/* Function: GetAddressLength
 * ==========================
 */

UBYTE GetAddressLength(Address address);


/* Function: GetSubsequent
 * =======================
 */

AddressSet GetSubsequent(Address address,SourceProgram src_prog);


/* Function: DisassembleAddress
 * ============================
 */

VOID DisassembleAddress(Address address,SourceProgram src_prog);


/* Function: TranslateAddress
 * ==========================
 */

VOID TranslateAddress(Address address,SourceProgram src_prog);


/* Function: IsSameAddress
 * =======================
 */

BOOL IsSameAddress(Address a1,Address a2);


/* Function: GetPrevModifyMem
 * ==========================
 * Finds all instructions that could possibly be the last to modify a
 * particular address.
 */
/*
VOID GetPrevModifyMem(Address address,Address key,AddressSet previous,
                      ReverseGraph graph,AddressSet visited);
*/

/* Function: SetUpCriticalFlags
 * ============================
 * Ensures that an address's critical flags are saved the last time they are
 * modified before the address's instruction is executed.
 */

VOID SetUpCriticalFlags(Address address,SourceProgram src_prog);


/* Function: FindLastJSR
 * =====================
 */

VOID FindLastJSR(SourceProgram src_prog,AddressSet subsequent,
   Address address);


/* Function: GetRelativeAddress
 * ============================
 */

Address GetRelativeAddress(Address address,LONG displacement,
   SourceProgram src_prog);


/* Function: KillAddress
 * =====================
 */

VOID KillAddress(Address address);


/* Function: ShowAddress
 * =====================
 */

VOID ShowAddress(Address address);


#endif
