flat assembler
Message board for the users of flat assembler.

Index > Main > writing asm/disasm

Author
Thread Post new topic Reply to topic
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 08 Apr 2010, 10:52
I want to write my own syntax assembler/disassembler, and i have few questions.

Can i have a list of ALL x86 architectures? i ont know how to name them, but i belive its 286, 386, 486, ... ? i want my assembler to have directive wich will encode instructions to specyfied architecture (eg. pop cs).

I dont want to integrate file formats (elf/coff). How should i write, to be able to use linker on my output?
My compiler will just encode instructions, and write output. Should i use special symbols or something? How will linker know how to handle my file?
Should i write my own linker? Or should i write linker inside compiler, wich i try to avoid? From my understanding, linker should need 2 files. 1 with raw code, and second with special directives. And this approach i want to follow.

What language should i use? For 99% i will use C, but im open to other suggestions.
Post 08 Apr 2010, 10:52
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 08 Apr 2010, 11:22
first, code your assembler for your own CPU in order to do selfcompilation.
after you will see what instructions you can add.
use fasm as a starting language. Very Happy
if not, i don't see why you are asking there.
Post 08 Apr 2010, 11:22
View user's profile Send private message Visit poster's website Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 08 Apr 2010, 11:35
if i use asm as starting language, i will have to make version for 16, 32, and 64 bit.
if i use C, i could cover all, and even more (ia64, arm). I belive if code in c is simple, it produce same result on all platforms.

what about instruction set diffrences? where will i get list of all intel/amd/any others? cpus wich i must support?
Post 08 Apr 2010, 11:35
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4347
Location: Now
edfed 08 Apr 2010, 11:49
Quote:
where will i get list of all intel/amd/any others?

in the faq on this forum; Wink
Post 08 Apr 2010, 11:49
View user's profile Send private message Visit poster's website Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 08 Apr 2010, 11:56
A good source is http://ref.x86asm.net/, this covers all x86 instructions for encoding/decoding purposes. You can also get the IA64 and ARM encodings from their respective manuals.
Post 08 Apr 2010, 11:56
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 08 Apr 2010, 13:28
i don't think it's a good idea to start such a project as assembler/disassembler when one still asks questions like "Can i have a list of ALL x86 architectures?". This will lead to a dead-end.
Post 08 Apr 2010, 13:28
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.