![]() |
| ||
| assembly language help GNU nano 2.0.7 File: hello.asm why does this compile in nasm but not in gas? using linux btw and when i add rubbish inside the code the code compiles just fine as well, what gives? |
| ||
| Re: assembly language help Because they're different syntaxs and not even a little bit different... NASM syntax is based on intel syntax while gas syntax is based on AT&T syntax. If you write a simple hello world program in C and compile it using gcc -S mycode.c It'll leave you with a mycode.s that you can read and see what AT&T asm syntax looks like. You should of learned the difference when you were learning assembly as any good teacher/book should make you familiar with the concepts enough to show you different syntaxs so you can see that even if you don't know the syntax then you can still read the code. |
| ||
| Re: assembly language help yea but isnt there an option in gas to enable it to read intel syntax now? .intel_syntax or something like that, how do I enable it? |
| ||
| Re: assembly language help Quote:
Alternatively there are programs out there to convert your code back and forth. |
| ||
| Re: assembly language help i c, but intel syntax is more portable am i correct to say that? since i read that many more assemblers support intel than at&t another question is why is it that nasm compiles my code just fine even when i add rubbish inside like random "fsfgssdgvsdgsdf"? i exprected errors and such |
| ||
| Re: assembly language help Quote:
That's why when you're learning ASM you're not learning the 'language' per se but you're learning how things work. mnemonics and the differences between tasm/masm/nasm/gas and whatever else are easy to pick up on if you know how things work. And it depends where you're throwing this 'rubbish' as nasm could potentially just optimize out pieces of 'code' that it finds 'useless'. |
| ||
| Re: assembly language help can intel syntax be inlined into c code too? btw, which is better to pick up to learn about computer security, understanding exploits like buffer overflow, etc? and thanks for the input so far |
| All times are GMT -4. The time now is 4:49 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC