flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > interface C-ASM |
Author |
|
Bob++ 03 May 2013, 01:54
Currently gcc supports intel's assembly syntax. Not only output it,inline too.
Put this Code: .intel_syntax noprefix Code: -masm=intel But don't forget to switch back to ATT's assembly after: Code: .att_syntax noprefix EDIT: To use non-inline assembly routines with gcc,it's very simple. Make you assembly generate objcode(on FASM,see "format" section from fasm's documentation) code and then compile with gcc to an executable as following: Code: gcc foo.o etc.c -o exe |
|||
03 May 2013, 01:54 |
|
alessandro95 03 May 2013, 02:14
Thanks a lot for the fast answer, I prefer to use non-inline assembly so I have some other questions:
Should the assembly routines have some particular name? (begin with underscore or something) How do I pass parameters? And if there is a return value where should it be? The compiler deals with the values of registers or my routines should worry about restoring them? If you could make me a very basic example, a function that adds two values and return the sum or something like that, I would find it truly useful since I know really a little of C! Thank again! |
|||
03 May 2013, 02:14 |
|
TmX 03 May 2013, 02:26
|
|||
03 May 2013, 02:26 |
|
alessandro95 03 May 2013, 02:30
That does look exactly what I was searching for, thanks a lot!
I'll look at this files, I'll post here again in case I still have some doubts |
|||
03 May 2013, 02:30 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.