Home Download Musics Developers
API Sources Tools File Format Technicals

desa68 library documentation.


Detailed Description

Author:
Benjamin Gerard <ben@sashipa.com>
desa68 library is a 68000 disassembler with enhanced features that help to trace branch instructions.

Optionnally the disassembler may disassemble with symbol instead of absolute address or long immediat. A supplemental control is available to choose the range of address that must be disassembled as symbol.

A good sample is may be found in the sourcer68 directory. This library is also used by debug68 programs.

Warning:
desa68 library is not thread safe.


Files

file  desa68.h
 Motorola 68K disassembler.


Data Structures

struct  DESA68parm_t
 68K disassemble pass parameters. More...


Disassembly option flags.

Use bitwise OR operation with these values to set the the DESA68parm_t::flags in order to configure the disassembler.



#define DESA68_SYMBOL_FLAG   (1<<0)
 Disassemble with symbol.

#define DESA68_ASCII_FLAG   (1<<1)
 Disassemble with ascii char.

#define DESA68_FORCESYMB_FLAG   (1<<8)
 Force symbol disassemble.


Instruction type flags.

These flags are setted in the DESA68parm_t::status field by desa68() function.

It allow to determine the type of the dissassembled instruction.

#define DESA68_INST   (1<<0)
 Valid instruction.

#define DESA68_BRA   (1<<1)
 Branch always instruction (bra/jmp/dbcc).

#define DESA68_BSR   (1<<2)
 Subroutine (bsr/jsr)/ Conditionnal branch instruction (bcc/dbcc).

#define DESA68_RTS   (1<<3)
 Return from subroutine/Interruption instruction (rts/rte).

#define DESA68_INT   (1<<4)
 Software interrupt instruction (trap/chk).

#define DESA68_NOP   (1<<5)
 nop instruction.


Functions

void desa68 (DESA68parm_t *d)
 Disassemble a single 68000 instruction.


Define Documentation

#define DESA68_SYMBOL_FLAG   (1<<0)
 

Disassemble with symbol.

If the DESA68_SYMBOL_FLAG is set in the DESA68parm_t::flags and the value of absolute long addressing mode or an immediat long is in greater or equal to DESA68parm_t::immsym_min and less than DESA68parm_t::immsym_max then the disassembler replaces the value by a named symbol. The named symbol constist on the value transformed to an 6 hexadecimal digit number with a prefixed 'L'.

#define DESA68_ASCII_FLAG   (1<<1)
 

Disassemble with ascii char.

If the DESA68_ASCII_FLAG is set in the DESA68parm_t::flags immediat values are converted to ASCII string (if possible).

#define DESA68_FORCESYMB_FLAG   (1<<8)
 

Force symbol disassemble.

The DESA68_FORCESYMB_FLAG is a set of 5 bits. If the Nth bit if set it forces a symbolic dissassembly for a long starting at the Nth word. Since 68000 instructions are not more than 10 bytes long 5 bit is just enougth.


Function Documentation

void desa68 DESA68parm_t d  ) 
 

Disassemble a single 68000 instruction.

param d Pointer to disassemble pass parameter structure.