Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Disassemblers

    DSP5600x disassembly library 1.1

    Download button

    Downloads: 979  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.8/5)
    18 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Miloslaw Smyk | More programs
    BSD License / FREE
    March 7th, 2005, 19:14 GMT
    ROOT / Programming / Disassemblers

     Read user reviews (0)  Refer to a friend  Subscribe

    DSP5600x disassembly library 1.1 description

    DSP5600x disassembly library is a code disassembly library for the Motorola DSP5600x.

    lib5600x is a library implementing Motorola DSP5600x disassembler. It's an ANSI C link library that should be useful for people writing debuggers, memory monitors etc for DSP5600x chips.

    Usage

    1. First you call two initialization functions in the library. This step is mandatory:

    make_masks();
    make_masks2();

    You pass nothing and check for no results -- these functions are guaranteed to succeed.

    2. Now you have to allocate memory for a structure that will be used for passing data to/from the library. You may do that on the stack

    struct disasm_data dis, *d = &dis;

    Yes, the pointer will be useful, too. The disasm_data structure is defined in 5600x_disasm.h file. Let's take a closer look:


    #define LINE_SIZE 256

    struct disasm_data
    {
    unsigned char *memory;
    char line_buf[LINE_SIZE];
    char *line_ptr;
    char words;
    };

    First member -- "memory" -- should point to the opcode you want disassembled. IMPORTANT! The library expects it to be a 24-bit word, so if your assembler creates 32-bit words, you'll have to make a simple conversion. Take a look at test.c to see how it is done. What's more, the library may wish to evaluate two words at a time, so you have to account for that -- this is also demonstrated in the example source.

    3. After properly setting up disasm_data struct (i.e. "memory" pointer), you call following function:

    int disassemble_opcode(struct disasm_data *);

    This function takes pointer to the struct you've just prepared as an argument. When it returns, disasm_data struct's "line_buf" member contains the disassembled opcode as a string of ASCII characters. "line_ptr" should be of no interest to you (it is merely a internal variable) and "words" holds the number of 24-bit words you should advance your memory pointer by. This variable is also available as a return value of above function. Again, I
    shall refer you to the example source.

    4. Repeat step 3 until you run out of code to disassemble.

    Testing

    First, check out the makefile and make sure it contains proper flags and defines for your architecture. Big endian users should add -DBIGENDIAN to CFLAGS (I'd appreciate if someone created Autoconf script to avoid such tricks). Following that, type

    make
    ./test example_dsp_binary

    and compare the output (visually) with example.a56 which is a source code I used to create example_dsp_binary and which contains all instructions and addressing modes described in DSP56000/DSP56001 Digital Signal Processor User's Manual. You can also 'diff' your output and supplied example.out file to check if there are any differences (there should be none).

    Product's homepage

      


    TAGS:

    code disassembly | code | disassembly | library



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM