PDA

View Full Version : ASM (assembler)



hateshinai
12-02-2007, 04:06 PM
Hello, I've been wanting to learn assembler for quite some time now and I'd just want to know which type of asm works with FPC and C++ of windows (Intel?)?

Could someone explain the differences?

Thanks!

JSoftware
12-02-2007, 07:17 PM
As far as I know AT&T style assembler is the best implemented style in FPC. All my optimizations are however made in intel style assembler which works fine in both delphi and fpc(-Rintel).

The key difference between AT&T and Intel style is the ordering of the arguments and the syntax

Intelstyle:
MOV eax, 100 //eax := 100
ADD eax, edx //eax := eax+edx

AT&T:
MOV 100, eax //eax := 100
ADD edx, eax //eax := eax+edx

AT&T also has a few differences when accessing pointers and such where Intel style has a more delphi like syntax(That's my oppinion).

I have no idea what assembler style you usually would use in c++ though

hateshinai
13-02-2007, 07:26 PM
Thanks. Ok so I should basically use whichever I prefer, the tutorials will work for both. Great :D

I also like the Intel style better, the Intel mov seems more logical to me, don't know why they mess with them :/