|assembler design firstname.lastname@example.org (2004-05-30)|
|Re: assembler design email@example.com (2004-06-30)|
|Re: assembler design firstname.lastname@example.org (George Peter Staplin) (2004-07-13)|
|From:||email@example.com (praseed pai)|
|Date:||30 Jun 2004 23:14:23 -0400|
|Posted-Date:||30 Jun 2004 23:14:23 EDT|
firstname.lastname@example.org (macluvitch) wrote
> Well I'm trying to write a simple assembler with intel syntax.
> I've got a look at gasm source (the gnu assembler) to get an idea on
> how it's implemented or especially how it translates mnemonics into
> opcodes, it's so complicated the way he does .
> it uses a struct table representing the mnemonic token, it's
> equivalent opcode,
> how many arguments...
> for example these following statements haven't the same opcodes
> mov ah, mem
> mov mem, h
> so we have to say invent a way to handle all different possible ways
> please can anybody clear things up for me
I feel taking a look at SoftWire Dynamic Assembler Project (
http://softwire.sourceforge.net/ ) will give u a better idea of how to
translate the mnemonic sequence into code. The Source code is readable
( as it is written in C++ as opposed to C ). I have used the source
code there to study about instruction encoding for pentium processor.
( And has written a
dynamic compiler for a high level basic like language thanks to that )
Return to the
Search the comp.compilers archives again.