Page 1 of 1

Learning x86... or... whatever

Posted: Sun Feb 22, 2009 5:05 am
by MinatureCookie
Heya guys, I've been looking through the internet trying to learn x86 - but it is unbelievably hard to find any kind of resource on this whatsoever.
http://www.skynet.ie/~darkstar/assembler/ I found that recently, and apparently I need as assembler - but it also says that the assembler chosen is the most critical factor, which implies to me if I choose a free assembler, I won't be able to follow that tutorial?

Obviously I am very new to x86, so any tutorials or advice on that one I found and anything on assemblers would be greatly appreciated if anyone could spare with their advice.
Thanks a lot guys :)

Re: Learning x86... or... whatever

Posted: Sun Feb 22, 2009 5:42 am
by JamesM
AS is free. The GNU project provide a free assembler (gas) in its binutils package.

The choice of assembler is less important now - nasm or gas are the most commonly used.

Re: Learning x86... or... whatever

Posted: Sun Feb 22, 2009 5:51 am
by MinatureCookie
Okay thanks, I'm just now downloading NASM (and noticing that I've come to a nasm.exe file and a ndisasm.exe file which don't seem to do anything so I'm gonna have to go researching how to use NASM :roll: )
But does this mean the tutorial I'm reading is outdated?

Re: Learning x86... or... whatever

Posted: Sun Feb 22, 2009 5:53 am
by JamesM
MinatureCookie wrote:Okay thanks, I'm just now downloading NASM (and noticing that I've come to a nasm.exe file and a ndisasm.exe file which don't seem to do anything so I'm gonna have to go researching how to use NASM :roll: )
But does this mean the tutorial I'm reading is outdated?
You must use nasm from the command line.

Re: Learning x86... or... whatever

Posted: Sun Feb 22, 2009 6:43 am
by MinatureCookie
Yeah I was just working that out reading the thing on the NASM page, can I be really annoying and ask for some example code of how to compile with NASM through the command-line? #-o
Thank-you

EDIT:
I think I've worked out, it's this (assuming command-line opened up in directory of NASM)
nasm -o Test.com Test.asm

And I write all my x86 in an ASM file, and it comes out as a COM file. I know I get a COM file when I do this, but is it valid, is this right?

Re: Learning x86... or... whatever

Posted: Sun Feb 22, 2009 9:13 pm
by leledumbo
I know I get a COM file when I do this, but is it valid, is this right?
It's entirely depend on you, .COM files are flat binaries. Meaning that everything you write there is exactly what the computer will do. No segmentation, no headers, no library calls (don't know whether it's possible to do).

Re: Learning x86... or... whatever

Posted: Mon Feb 23, 2009 2:54 am
by AJ
Hi,

A com file is simply a flat binary. Use nasm -hf for a list of other supported formats (my version also supports aout, elf, coff....).

Cheers,
Adam