stuff for gas programming, how to build an (dis-) assembler?

First question:

I'm interested in assembler programming with gas. Can somebody tell me where to find got stuff about this?

Second question:

Can someone explain me how an assembler compiler is programmed? Not that I would try, I just want to know how it works! Or does somebody know addresses of good stuff, whether in English or in German (html/pdf/ps)?

Third question:
Can somebody explain me how a disassembler works, or how it can be programmed? (My favourite programming language is C++)

Thank you in advance!

Comments

  • : First question:
    : I'm interested in assembler programming with gas. Can somebody tell me where to find got stuff about this?
    [green] www.google.com is a good place to search for internet stuff.
    www.webcrawler.com is my favorite web searcher.
    There probably is a gas home page some where.
    Other resident x86 experts here like: Blip, or AsmGuru62
    might have better ideas/input.
    [/green]
    : Second question:
    : Can someone explain me how an assembler compiler is programmed? Not that I would try, I just want to know how it works! Or does somebody know addresses of good stuff, whether in English or in German (html/pdf/ps)?
    [green] An assembler basicly process one line of instructions after another,
    changing it directly into machine code, different output is available, .com .exe .obj .bin .etc
    A disassembler checks the value of the first byte according to it's
    bits and decisions are made from there,
    is it for an instruction that takes X amount of bytes,
    it it MOV or what instruction, immedate or reg, etc.
    Most disassemblers use referance tables to write the output.
    Disassembler source code is available, search google, or heres
    a recient post of one in the creation process,
    http://fredd.dyndns.org/files/src/disasm.zip
    [/green]
    : Third question:
    : Can somebody explain me how a disassembler works, or how it can be programmed? (My favourite programming language is C++)
    [green] There is a
    C/C++ programming
    message board here at programmers heaven.
    It is quite popular and get's many posts daily.
    Bitdog
    [/green]


  • : : Third question:
    : : Can somebody explain me how a disassembler works, or how it can be programmed? (My favourite programming language is C++)
    That is damn broad question ! I am sure that if u go to SourceForge u will find some open source dis assembler. U can read its code and/ or talk to the guys who are making it....
  • It doesn't seem like GAS is commonly used because it requires you to write code in AT&T syntax without the .intel_syntax directive. Here's what some looks like in comparison with Intel syntax:
    [code]
    AT&T | Intel
    ---------------------+---------------------------
    movb MemLoc,al | mov al,[MemLoc]
    addl $67,Counter | add [Counter],67
    testb $0x40,19(%ebp) | test byte ptr [ebp+19],40h
    [/code]
    Many people here would reccomend you use NASM (uses Intel syntax with minor modifications), and I think there's a Linux port of it. Here's where I got my info: http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=program+OR+programming+with+GAS+ASM+OR+assembly+OR+assembler
  • : It doesn't seem like GAS is commonly used because it requires you to write code in AT&T syntax without the .intel_syntax directive. Here's what some looks like in comparison with Intel syntax:
    : [code]
    : AT&T | Intel
    : ---------------------+---------------------------
    : movb MemLoc,al | mov al,[MemLoc]
    : addl $67,Counter | add [Counter],67
    : testb $0x40,19(%ebp) | test byte ptr [ebp+19],40h
    : [/code]
    : Many people here would reccomend you use NASM (uses Intel syntax with minor modifications), and I think there's a Linux port of it. Here's where I got my info: http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=program+OR+programming+with+GAS+ASM+OR+assembly+OR+assembler
    :
    Personal opinion, google's just plain awful... gives too much that you can get from any other search engine... I like excite, myself, works quite well, just need to know how to search, which isn't really that hard, and clears out all the junk you'll get trying to search google.
    Anyway... sourceforge.net/projects/nasm
  • : : First question:
    : : I'm interested in assembler programming with gas. Can somebody tell me where to find got stuff about this?
    : [green] www.google.com is a good place to search for internet stuff.
    : www.webcrawler.com is my favorite web searcher.
    : There probably is a gas home page some where.
    : Other resident x86 experts here like: Blip, or AsmGuru62
    : might have better ideas/input.
    : [/green]
    : : Second question:
    : : Can someone explain me how an assembler compiler is programmed? Not that I would try, I just want to know how it works! Or does somebody know addresses of good stuff, whether in English or in German (html/pdf/ps)?
    : [green] An assembler basicly process one line of instructions after another,
    : changing it directly into machine code, different output is available, .com .exe .obj .bin .etc
    : A disassembler checks the value of the first byte according to it's
    : bits and decisions are made from there,
    : is it for an instruction that takes X amount of bytes,
    : it it MOV or what instruction, immedate or reg, etc.
    : Most disassemblers use referance tables to write the output.
    : Disassembler source code is available, search google, or heres
    : a recient post of one in the creation process,
    : http://fredd.dyndns.org/files/src/disasm.zip
    : [/green]
    : : Third question:
    : : Can somebody explain me how a disassembler works, or how it can be programmed? (My favourite programming language is C++)
    : [green] There is a
    : C/C++ programming
    : message board here at programmers heaven.
    : It is quite popular and get's many posts daily.
    : Bitdog
    : [/green]
    :
    :
    All your questions can probably be answered by checking out the intel pentium docs... I know I posted the address recently here, but I'll see if I can get it right by memory... nope, apparently not... anyway, look for it.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories