I was wondering if i could design an 8086 assembler in C. Can i have any ideas on how to go about it? Any suggestion would be helpful.
I was wondering if i could design an 8086 assembler in C. Can i have any ideas on how to go about it? Any suggestion would be helpful.
Of course you can. There's nothing magical about an assembler. All an assembler is is a "compiler" that takes human understandable mnemonics (opcodes) and translates them into raw binary.
The main points about an assembler are:
1) It can have a text interface, a GUI is nice but not at all necessary.
2) It needs to be able to build a symbol table and a have a linker to resolve references.
3) You need to know the specific format of how programs are built, and understand how to build those pieces (like jump tables, stubs, etc.)
I would _strongly_ recommend you obtain a free assembler for any processor, and play with it, so that you can get a feel for what one does, and what programmers need assemblers to offer.
Thanx for the help guys. Can i have more examples of free assemblers? Where can i find the information? Thank you once again.
Here are some links of assemblers with source :
in asm
http://fasm.metro-nt.pl/fasm.zip
http://www.geocities.com/SiliconVall...s/intasm52.zip
http://www.geocities.com/rtcvb32/zips/intasm52.zip
http://betov.free.fr/SpAsm
in Qbasic
http://www.geocities.com/rtcvb32/zips/intel27.zip
in C
http://gaztek.sourceforge.net/gasm/gasm-source-0.55.zip
nasm
I am coding one in c( just for fun)
What I can say is that you have first to understand opcodes R/M bytes et SIB bytes. Get "pentium4-v2.pdf" at Intel site
You could also take a look at:
developer.intel.com