[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
6502 assembler, linker, loader (for UNIX)
- Subject: 6502 assembler, linker, loader (for UNIX)
- From: archie@sax.CS.Berkeley.EDU (Archie Cobbs)
- Date: 21 Mar 95 22:53:25 GMT
- Keywords: 6502 assembler
- Newsgroups: comp.sys.apple2, comp.sys.apple2.programmer
- Organization: University of California, Berkeley
- Summary: Does anybody need one?
- Xref: nntp.gmd.de comp.sys.apple2:55517 comp.sys.apple2.programmer:4481
Hello!
I don't normally read comp.sys.apple2.* newsgroups, so I don't know
if this is going to be useful or not. Here's the story...
A while ago I wanted to learn about a certain retargetable C compiler
(called "lcc") and so just for fun decided to target it for the 6502.
This compiler runs under UNIX (and in my case, Linux, in conjunction
with the Linux SVGA Apple 2 emulator).
After doing this I of course wanted to try it out and that meant
getting a UNIX assembler for the 6502. I found one but it was kindof
crappy, had no linker, etc. So I decided to write my own full featured
6502 assembler, linker, and loader from scratch, using flex and bison
and based on a made up object file format (which handles external
references like "the high order byte of this symbol"), man pages, etc.
The result is a suite of programs which other people may find useful
or want to play with. If so, I'll put them under GNU copyleft and send
them to anyone who wants them.
In exchange, I'd appreciate:
- Feedback on bugs, suggestions, etc.
- Could somebody send me a description of the new 65c02 opcodes
and syntax so they can be included (I only have an Apple //e).
If I don't hear any replies I'll assume this stuff already exists and
won't bother you any further.
Here's a brief description:
a2asm - Assemble source file into linkable object file
a2link - Link together object files into one
a2load - Convert object file into fully linked executable
a2objx - Debugging dump of object file contents
You need flex, bison, and GNU make.
Assembler syntax includes full C type expressions on 32 bit quantities,
plus standard pseudo-ops: .import, .export, .zimport (import a zero-page
address), sectioning into .code, .data, and .bss, etc.
By the way, the C compiler is based on the older version of lcc (not
the newer one described in the book) and anyway, lcc is not really
appropriate for the 6502 because it is optimized for 32 bit machines
(and you'd want to make an "int" 16 bit for the 6502 to keep the
program size down). Someday: "gcc -b 6502 foo.c" ... :-)
Thanks,
-Archie