PrintLogo

Disassembling and reassembling 8048 code with GPL tools




Check out D51 for a GPL disassembler for the 8048. I've typically assembled programs by hand. For an open source cross assembler, check out asl. For instance, here is a hand-assembled listing of this 8048 binary for a PV charge control project I designed. If I run D51 against the binary:

D48 8048/8041 Disassembler V 3.0

Copyright (C) 1996-2002 by J. L. Post

Released under the GNU General Public License

reading mem.bin

No control file found

Pass 1 - Reference search complete

Pass 2 - Source generation complete

Pass 3 - Equate generation complete

Done[usr-1@wrk-1 LINUX]$

Here is the output file. Pretty nice, eh? If I take this same output file, add the line CPU 8048 to it, call it mem.asm, and run:

asl mem -l

I get this file. If I then run:

p2bin mem.p

I get the same binary I started with. So very nice. My days of hand assembling may soon be over.

I put both of the above files up on Hackinjoe's files:

asl-1.41r5.tar.gz
d51v30.zip

The asl program will assemble many, many different kinds of CPUs. The D51 program will disassemble Z-80, 8051, as well as 8048 code.



This article comes from Coprolite:
http://coprolite.com/

The URL for this story is:
http://coprolite.com/art16.html

Copyright 1997-2006 Coprolite.com. Read our Terms of Use.