Assembly language (35)

1 Name: #!/usr/bin/anonymous : 2007-03-13 02:45 ID:riKIHnZ+

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

2 Name: #!/usr/bin/anonymous : 2007-03-13 04:43 ID:riKIHnZ+

why not try MinGW? it will run on windows and it practical for a newbie like you

3 Name: #!/usr/bin/anonymous : 2007-03-13 05:34 ID:Qa+EdHPE

FASM maybe?

4 Name: #!/usr/bin/anonymous : 2007-03-13 05:58 ID:riKIHnZ+

FASM? where could I find that?

5 Name: #!/usr/bin/anonymous : 2007-03-13 06:05 ID:Heaven

google

6 Name: dmpk2k!hinhT6kz2E : 2007-03-13 07:01 ID:Heaven

If you're on windows: MASM32.

7 Name: #!/usr/bin/anonymous : 2007-03-13 12:41 ID:39l06QFQ

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.

8 Name: #!/usr/bin/anonymous : 2007-03-13 15:25 ID:ABpPKJk/

I'd go with NASM, it seems to be more or less the standard now.

9 Name: #!/usr/bin/anonymous : 2007-03-14 13:43 ID:rVsSzNh0

> 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.

10 Name: #!/usr/bin/anonymous : 2007-03-14 15:28 ID:Kz37HzoM

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.

11 Name: #!/usr/bin/anonymous : 2007-03-15 02:24 ID:NHhr6Ggw

x86 assembly isn't too bad until having to deal with "Is the value stored in EAX, or in DX:AX" kind of things.

12 Name: #!/usr/bin/anonymous : 2007-03-15 06:00 ID:Heaven

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.

13 Name: #!/usr/bin/anonymous : 2007-03-15 11:14 ID:Heaven

>>12

  1. Reverse engineering
  2. Compiler design
  3. Inner-loop optimization (these days, mostly using SSE and the like)

14 Name: #!/usr/bin/anonymous : 2007-03-15 13:49 ID:Kz37HzoM

>>12
You never know when you'd like to roll your own setcontext/getcontext/swapcontext functions.

15 Name: #!/usr/bin/anonymous : 2007-03-15 15:33 ID:ABpPKJk/

>>14
Maybe you could explain that for those of us less schooled in low-level stuff?

16 Name: #!/usr/bin/anonymous : 2007-03-15 16:21 ID:BRVRY32g

gas

17 Name: #!/usr/bin/anonymous : 2007-03-15 19:48 ID:Heaven

I'm pretty sure nobody but gcc itself ever used gas.

18 Name: #!/usr/bin/anonymous : 2007-03-16 00:55 ID:Heaven

>>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.

19 Name: #!/usr/bin/anonymous : 2007-03-16 05:48 ID:Heaven

>>17
hitler did

20 Name: #!/usr/bin/anonymous : 2007-03-17 12:18 ID:snf+7U4w

Don't forget about stack manipulation
http://www.cs.uaf.edu/2006/fall/cs301/lecture/
my assembly language programming course notes.

21 Name: #!/usr/bin/anonymous : 2007-03-18 05:06 ID:riKIHnZ+

>>12

I'm learning it out of personal interest. I figure, it might not be practical but you never know.

22 Name: #!/usr/bin/anonymous : 2007-03-19 08:10 ID:OocTlGq8

Learning assembly might be useful to understand how exactly your computer does things, which might help you avoid doing stupid things. Besides that... dunno.

23 Name: #!/usr/bin/anonymous : 2007-03-21 22:26 ID:rZbq6GrU

>>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.

24 Name: #!/usr/bin/anonymous : 2007-03-21 22:55 ID:ocx4tlfi

You can check this link for books related with Assembly.
REMEMBER: Assembly does not use a compiler! It uses an assembler and a linker.
If you use linux i suggest nasm if you are used in the Intel syntax and GAS if you are used in the AT&T syntax.
For a linker you can use ld.
Also if you don't know about the syntaxes mentioned above, i got you a good link to read about them.
w00w00 att - vs - intel

25 Name: #!/usr/bin/anonymous : 2007-03-23 13:03 ID:39l06QFQ

> 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.

26 Name: #!/usr/bin/anonymous : 2007-03-24 18:51 ID:rVsSzNh0

I think the IA-64/Itanium assembler actually does optimize.

27 Name: #!/usr/bin/anonymous : 2007-03-25 14:59 ID:ABpPKJk/

Yeah, I've heard of optimizing assemblers. I'm sure you can turn that off though.

28 Name: #!/usr/bin/anonymous : 2007-03-26 06:30 ID:Kz37HzoM

>>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.

29 Name: #!/usr/bin/anonymous : 2008-11-29 10:21 ID:K3PVFyXj

>>1
>>2
unbelievable that nobody noticed: same person

30 Name: #!/usr/bin/anonymous : 2008-12-01 19:06 ID:Heaven

>>29

What's funny is that it took two hours to sock puppet himself...

31 Name: #!/usr/bin/anonymous : 2008-12-03 18:52 ID:Heaven

>>30
oh wow.. true.

32 Name: #!/usr/bin/anonymous : 2008-12-06 13:58 ID:Heaven

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.

33 Name: #!/usr/bin/anonymous : 2008-12-07 12:25 ID:z/5LRrNu

34 Name: #!/usr/bin/anonymous : 2008-12-07 17:07 ID:adt0mQ6X

"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.

35 Name: #!/usr/bin/anonymous : 2008-12-08 21:24 ID:YMFB5ybO

>>32
haha possible.

>>34
sounds nice. need to look into it.

This thread has been closed. You cannot post in this thread any longer.