disasm(3E)

dis_init, dis_init32, dis_init64, dis_regs, dis_regs32, dis_regs64, disasm, disasm32, disasm64, disassembler32, disassembler64 - Disassembler functions

As shipped in IRIX 6.5.7. Last changed in IRIX 6.5.5.

NAME
     dis_init, dis_init32, dis_init64, dis_regs, dis_regs32, dis_regs64,
     disasm, disasm32, disasm64, disassembler32, disassembler64 -
     Disassembler functions

SYNOPSIS
     #include <disassembler.h>

     void dis_init (char *addr_format,char *value_format,
       char *reg_names[],int print_jal_targets);

     void dis_init32 (char *addr_format,char *value_format,
       char *reg_names[],int print_jal_targets);

     void dis_init64 (char *addr_format,char *value_format,
       char *reg_names[],int print_jal_targets);

     void dis_regs(char *buffer,unsigned regmask,
       unsigned reg_values[]);

     void dis_regs32(char *buffer,unsigned regmask,
       unsigned reg_values[]);

     void dis_regs64(char *buffer,unsigned regmask,
       __uint64_t reg_values[]);

     int disasm(char *buffer,Elf32_Addr address,Elf32_Addr iword,
       Elf32_Addr *regmask,Elf32_Addr *symbol_value,
       Elf32_Addr *ls_register);

     int disasm32(char *buffer,Elf32_Addr address,Elf32_Addr iword,
       Elf32_Addr *regmask,Elf32_Addr *symbol_value,
       Elf32_Addr *ls_register);

     int disasm64(char *buffer,Elf64_Addr address, Elf32_Addr iword,
       Elf32_Addr *regmask,Elf64_Addr *symbol_value,
       Elf32_Addr *ls_register);

     int disassembler(Elf32_Addr iadr, int regstyle,
       char *(*get_symname)(),int (*get_regvalue)(),
       long (*get_bytes)(), void (*print_header)());

     int disassembler32(Elf32_Addr iadr, int regstyle,
       char *(*get_symname)(),int (*get_regvalue)(),
       long (*get_bytes)(), void (*print_header)());

     int disassembler64(__uint64_t iadr, int regstyle,
       char *(*get_symname)(),int (*get_regvalue)(),
       long (*get_bytes)(), void (*print_header)());

IMPLEMENTATION
     IRIX systems

DESCRIPTION
     The following  register names (_NAMES macro) may be useful in using
     this command:

     compiler: zero, at, v0, ...

     hardware: r0, r1, r2, ...

     assembler: $0, $at, $2,...

     dis_init, dis_init32, and dis_init64 functions initialize the
     disassembler and set options for disassembly.

     When given a null-terminated buffer (presumably from disasm), the
     dis_regs, dis_regs32, and dis_regs64 functions append an ASCII
     representation of register values in the form <$5=0x50,$7=0x44,...>.

     The disasm, disasm32, and disasm64 functions disassemble instructions,
     putting a null-terminated result into buffer (no trailing newline).
     Details governed by dis_init.

     The disassembler, disassembler32, and disassembler64 functions are
     older interfaces, which always print on stdout.

     The following options are accepted by the disassembler:

     addr_format, value_format
               Specify (in the style of printf) the null-terminated formats
               for printing the address and value of the instruction.  If
               nil, they default to %#010x; if they are the empty string,
               these items are not printed.

     reg_names Pointer to an array of 32 strings that represent the
               general-purpose registers.  The preceding *_NAMES macros
               give three common choices; if nil, compiler names are used.

     print_jal_targets
               Specifies whether to print the targets of jal instructions
               numerically.

     regmask   Bitmask of registers as in disasm, reg_values. An array
               (with empty slots for the registers not indicated in the
               mask) of their values.

     buffer    Array of characters allocated by the caller; 64 bytes should
               be adequate.

     address   Specifies byte address.

     iword     Specifies the instruction.

     regmask   Returns a bitmask of the gp registers that the instruction
               uses, with the LSB indicating register 0 regardless of
               endianness.

     symbol_value
               For a JAL instruction, the target value; for a load or
               store, the immediate value.

     ls_register
               For a load or store, the number of the base register.

RETURN VALUES
     The following values are returned:

     -1   for a load or store 1 for a JAL

     2    for a J, JR, JALR, or branch

     0    for other

SEE ALSO
     disassembler(3X)

     This man page is available only online.