Source file: /~heha/hs/gputils64-210929.zip/libgputils/gpdis.h

/* Convert one word from memory into an equivalent assembly instruction
   Copyright 2001-2005	Craig Franklin
*/

#pragma once

#include "gpregister.h"

EXDATA bool gp_decode_mnemonics;
EXDATA bool gp_decode_extended;

typedef struct {
  int      wreg;
  int      pclath;
  unsigned pclath_valid;
  int      bank;
  unsigned bank_valid;
  const gp_register_table_t *proc_regs;
  unsigned bsr_boundary;      /* Only case of PIC16E. */
  bool     need_sfr_equ;
} gpdasm_fstate_t;

/* Values of the "Behavior". */
#define GPDIS_SHOW_NOTHING      0
#define GPDIS_SHOW_NAMES        (1 << 0)
#define GPDIS_SHOW_FSRN         (1 << 1)
#define GPDIS_SHOW_BYTES        (1 << 2)
#define GPDIS_SHOW_ALL_BRANCH   (1 << 3)
#define GPDIS_SHOW_EXCLAMATION  (1 << 4)

FUNC(unsigned) gp_disassemble_mark_false_addresses(MemBlock_t *M, unsigned Byte_address,
	pic_processor_t Processor);

FUNC(unsigned) gp_disassemble_find_labels(MemBlock_t *M, unsigned Byte_address,
	pic_processor_t Processor, gpdasm_fstate_t *Fstate);

FUNC(unsigned) gp_disassemble_find_registers(MemBlock_t *M, unsigned Byte_address,
	pic_processor_t Processor, gpdasm_fstate_t *Fstate,
	void (_stdcall*User_data_finder)(MemArg_t *));

FUNC(void) gp_disassemble_show_data(MemBlock_t *M, unsigned Byte_address, proc_class_t Class,
                                     unsigned Behavior, char *Buffer, size_t Buffer_length,
                                     size_t Current_length);

FUNC(unsigned) gp_disassemble(MemBlock_t *M, unsigned Byte_address, proc_class_t Class,
                                   unsigned Bsr_boundary, unsigned Prog_mem_size,
                                   unsigned Behavior, char *Buffer, size_t Buffer_length,
                                   size_t Current_length);

FUNC(unsigned) gp_disassemble_byte(MemBlock_t *M, unsigned Byte_address,
                                        char *Buffer, size_t Buffer_length);

extern unsigned gp_disassemble_word(MemBlock_t *M, unsigned Byte_address, proc_class_t Class,
                                        char *Buffer, size_t Buffer_length);

FUNC(unsigned) gp_disassemble_size(MemBlock_t *M, unsigned Byte_address, proc_class_t Class,
                                        unsigned Bsr_boundary, unsigned Prog_mem_size,
                                        unsigned Behavior, char *Buffer, size_t Buffer_length,
                                        unsigned Size);
Detected encoding: ASCII (7 bit)2