I'm learning how to program in assembly language and I was wondering if anyone on this board knows assembly and if you would know of any decent complier programs, I've heard good things about boreland turbo assembler
why not try MinGW? it will run on windows and it practical for a newbie like you
FASM maybe?
FASM? where could I find that?
If you're on windows: MASM32.
The open sores people sure seem to like NASM. I haven't ever wanted to program in assembly for x86, so I don't know if it really is good or what.
PS: Assembly on x86 is completely and utterly horrid.
I'd go with NASM, it seems to be more or less the standard now.
> PS: Assembly on x86 is completely and utterly horrid.
It does have cmov. That and complex addressing are more fun than PPC sometimes. That's about it, though, and x86-64 is still two-operand all the time.
For x86-64, you can use YASM. It's apparently (haven't checked, myself) a rewrite of NASM and supports 64-bit modes. If I had to write code for amd64 processors by hand, I'd go with YASM simply because it's got the somewhat more acceptable Intel-style "movq rax, qword [rbx+rcx*4]" syntax rather than gas-style 68k-reject "movq (%rbx,%rcx,4), %rax" thing.
x86 assembly isn't too bad until having to deal with "Is the value stored in EAX, or in DX:AX" kind of things.
Are you learning this for a class or something out of personal interest? I can't see how assembly could possibly be useful in present day unless you're some sort of specialist. The only thing I've ever used it for is having some fun with personal reverse engineering and application modification projects.
>>12
You never know when you'd like to roll your own setcontext/getcontext/swapcontext functions.
>>14
Maybe you could explain that for those of us less schooled in low-level stuff?
gas
I'm pretty sure nobody but gcc itself ever used gas.
>>17
There's plenty of gas-style x86 code in Linux. Also, gas supports what is basically the platform reference syntax for PPC, ARM and ia64. You can hook the C preprocessor up to it too, for kinda-sorta macro support and the like.
>>17
hitler did
Don't forget about stack manipulation
http://www.cs.uaf.edu/2006/fall/cs301/lecture/
my assembly language programming course notes.
I'm learning it out of personal interest. I figure, it might not be practical but you never know.
Learning assembly might be useful to understand how exactly your computer does things, which might help you avoid doing stupid things. Besides that... dunno.
>>19
Thread was won at this point.
Also, amateur cracking with Ollydbg, warezed IDA etc = fun. That's enough reason to know some basic x86 asm right there.
> REMEMBER: Assembly does not use a compiler!
Yeah yeah, gramps, enjoy your shibboleths. An assembler is for all intents and purposes a compiler, and making a distinction is just silly.
I think the IA-64/Itanium assembler actually does optimize.
Yeah, I've heard of optimizing assemblers. I'm sure you can turn that off though.
>>24
Most assemblers that are intended for people to use in compiling hand-written assembly do some sort of hand-holding to accommodate unorthogonalities in the target instruction set. For instance, it was very common for m68k assemblers to produce the correct MOVEA
instruction when one tried to do MOVE.L D0,A0
or the like. (Of course programmers had to be aware that moves to address registers like that wouldn't affect the condition code register.)
Intel-style x86 assemblers generally grab the intended word length from the register names used, so that instead of mov eax, dword [ebx]
you omit explicit dword
.
And that's not going into things like macro functions, or other kinds of preprocessing. Even GNU "as" has intrinsics for declaring C-style string constants, which is more than is strictly required. I remember one for the Amiga that did basic peephole optimization of naïvely written, or compiler-generated, code in the same single pass it translated instructions into machine code. For all intents and purposes, assemblers are compilers.
What's funny is that it took two hours to sock puppet himself...
>>30
oh wow.. true.
Maybe in that two hours he learned all about the subject and he came back and posted because he wanted to let himself know about it.
"Assembly Language Step by Step" by Jeff Duntemann is a great book for x86 assembly. Gets into some assembly on Linux towards the end. But what I liked most about it was the writing style. Informative but humorous and entertaining. Too many assembly texts are just sleeping pills.