x86 assembly compiler

KarsinTheHutt

Golden Member
Jun 28, 2000
1,687
0
0
I'd like to learn x86 assembly language, but I'm not sure where to start. Where can I get the proper compilers and how would I run a compiled assembly program?

thanks
 

DeeK

Senior member
Mar 25, 2000
700
0
0
NASM is one of the best known free asm compilers. There's an FAQ for comp.lang.asm.x86 here. Ask on the newsgroup where's the best place to get started with learning asm, and that should help you on your way.
 

sciencewhiz

Diamond Member
Jun 30, 2000
5,885
8
81
I think (I haven't tried learning assembly yet) that the easiest way would be to start with small assembly routines embeded in pascal or C (++) programs.
 
Apr 5, 2000
13,256
1
0
Learning embedded asm in C++ routines is even more confusing than learning it by itself

Grab a book and prepare to take some time learning it cause its not easy

And to compile an asm program, you compile it first, then if it compiles w/out error you can create an .exe based off the .obj (unless you get masm 6.0 or above, which compiles+creates the .exe in one step, my old TASM 3.0 doesn't without the help of a batch file)
 

Fandu

Golden Member
Oct 9, 1999
1,341
0
0
Be prepared to spend a long time reading and re-reading and asking questions because at first it'll totally confuse you. May I suggest that you start off learning a simpler ASM like Z80? Or maybe M68K?

If you really must start off with x86 ASM, then you may find MS Debug of interest as it can intrepret assembly in real time.

But the fun really starts when you get good with ASM and move on to machine....fun stuff!

3985:0100 B402
3985:0102 B90800
3989:0105 B200
3985:0107 D0D3
3985:0109 80D230
3985:010C CD21
3985:010E E2F5
3985:0110 CD20

AND... all that translates to..

MOV AH,02
MOV CX,0008
MOV DL,00
RCL BL,1
ADC DL,30
INT 21 (THIS IS FAMOUS!)
LOOP 0105
INT 20

Believe me, ASM gets very complicated, the transition is much easier if you start with a simpler ASM like Z80.
 

hans007

Lifer
Feb 1, 2000
20,212
18
81
yeah start with a risc processor like a MIPS. The x86 one is cisc and the bit offsets to make the variable length instructions are confusing. Also the segmented memory is more difficult. And you have to use their retarded register stack thing. I had to do a risc processor asm in college last year and at the end we had to read about the x86 and that it is much more difficult.
 

michaelh20

Senior member
Sep 4, 2000
482
0
0
My class is using a spim simulator called SPIM, which you could download. And doh it's a mips simulator.. gee I wonder where the name came from.

http://www-users.itlabs.umn.edu/~esse0027/spim/spim-manual is a manual for spim,

http://www.itlabs.umn.edu/classes/Fall-2000/csci2021/samprog.html small sample progrmas

The Spim Download


I wonder how a person runs an ASM program in windows.. wouldn't that like have to run in real-mode (I guess not, since other windows programs are also machine code right?). But windows would whine, wouldn't it if the program did much of anything?
 

michaelh20

Senior member
Sep 4, 2000
482
0
0
On a funny note, whenever my instructor talks about anything (we are doing machine architecture/representation, etc.) basically everytime she describes a way that it's done, she then goes on to say "but then in the Pentium x86 line, they do it differently" like she said the x86 has mostly special purpose registers whereas other lines (like mips) has many av. generic ones and that x86 essentially stores it's words backwards (little Endian, it's called). She called x86 old fashioned, etc... heh..

"This is the way most companies do it....."

"This is the way Intel did it with x86....." (describes some nasty way of doing things)

Don't beat up on me about this stuff, I've only been in class 3 weeks and haven't actually (yet) done any asm yet.......
 

Vincent

Platinum Member
Oct 9, 1999
2,030
2
81
I learned x86 ASM about 10 years ago and have moved away from it since then, but I didn't think it was particularly difficult. If you have a good general orientation to programming, I don't think it's necessary to start with another language.

However, if you're actually trying to develop a deeper understanding of assembly language in general, then it would be good to start off with the suggestions others have made.