Learning x86... or... whatever

Programming, for all ages and all languages.
Post Reply
MinatureCookie
Posts: 7
Joined: Sun Feb 22, 2009 5:00 am

Learning x86... or... whatever

Post 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 :)
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

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

Post 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.
MinatureCookie
Posts: 7
Joined: Sun Feb 22, 2009 5:00 am

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

Post 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?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

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

Post 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.
MinatureCookie
Posts: 7
Joined: Sun Feb 22, 2009 5:00 am

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

Post 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?
leledumbo
Member
Member
Posts: 103
Joined: Wed Apr 23, 2008 8:46 pm

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

Post 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).
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

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

Post 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
Post Reply