hello to all...

Can anyone suggest me any link or tutorials regarding assembly coding on AIX platform.. please don't say that it is not related to Windows platform..

Any assembly language lover will love to port his code to any other platform..

I have tried google but didn't find any useful links neither i find any demo tutorial for " how to write assembly code on AIX platform "

Please help me out...

Regards
Posted on 2003-01-10 16:51:38 by processingspeed

hello to all...

Can anyone suggest me any link or tutorials regarding assembly coding on AIX platform.. please don't say that it is not related to Windows platform..

Any assembly language lover will love to port his code to any other platform..

I have tried google but didn't find any useful links neither i find any demo tutorial for " how to write assembly code on AIX platform "

Please help me out...

Regards


AIX is a Unix derivate which uses "normal" ELF format, so FASM should work. If not, inline assembly in GCC/GAS will do the job, too.
Posted on 2003-01-10 17:44:27 by bazik
I suppose that you are trying to port to AIX x86. If your target is RS series, forget about porting. Write your routine from the scratch. That is much faster and will give you more efficient code (in general).

All x86 unix assemblers (I know of) use AT&T syntax. AT&T syntax reference is easy to find. Just to give you an idea, in AT&T syntax,
1. operands are reversed: mov eax,1 => movl $1,%eax
2. registers are prefixed by '%'.
3. immidiate values are prefixed by '$'
4. indirect addressing uses (): => 3(%eax,%edx,4)
5. op code is suffixed by operand size: mov eax,dword ptr => movl (%edx),%eax

If you are going to code FPU stuff, be careful about SCO blunder which has been propagating to other architectures in the name of "compatibility".

One reference I can tell you is GAS manual. GAS manual is not perfect, but any assembly programmer will quickly fill in the missing links by himself.

One possible tool (which is anything but a sane tool, but it seems to me that this is the only tool) converting Intel syntax to AT&T syntax is 'intel2gas'. This tool assumes NASM syntax, so you may need to convert the input file to NASM syntax, and, after that, sanitize the output a lot.
Posted on 2003-01-10 17:49:36 by Starless

All x86 unix assemblers (I know of) use AT&T syntax. AT&T syntax reference is easy to find. Just to give you an idea, in AT&T syntax,blah blah blah


You didnt try FASM yet? Shame on you! :grin: :stupid:
Posted on 2003-01-10 18:04:05 by bazik

You didnt try FASM yet? Shame on you! :grin: :stupid:


FASM is great only when you are going to settle at static linking, IMO.

Seriously, my Unix assembly coding effort is focused on library functions - some libc and most of libm, and my personal project (BLAS and LAPACK). Until FASM supports PIC (and FreeBSD), I'm forced to use AT&T syntax. But, hey, AT&T syntax is not that bad, once you get used to it. :)
Posted on 2003-01-10 18:15:48 by Starless
Starless: AFAIK fasm should run on FreeBSD if you "brandelf" if correctly. As for the PIC support, well I don't know why it would be needed when doing assembly programming, because in assembly you can reduce number of relocations to only one (this is how the .got table works, if I understood ELF docs correctly) in much easier and more elegant (in my opinion) way, like in this example:


format ELF

section '.text' executable

public main

main:
push ebx
mov ebx,data_base ; only one relocation here

mov eax,[ebx+var1]
add eax,[ebx+var2]
push eax
lea eax,[ebx+msg]
push eax
extrn printf
call printf
add esp,8

pop ebx
ret

section '.data' writeable

data_base: org 0

var1 dd 3
var2 dd 7
msg db 'sum is: %d',0xD,0xA,0

But if you convince me that PIC is needed for assembly programms also, please tell me what syntax in your opinion would be the best for .got table accessing in fasm.
Posted on 2003-01-11 11:00:13 by Tomasz Grysztar