Well, forgive me if I ask some silly questions, until now I had been doing assembly and C separately 'cause I never needed that + I used the nice Intel Syntax, now I have this GCC which uses the AT&T syntax,
After reading some horrible pages about AT&T syntax, I tried some code.
So what I am trying to do is put the value in RSI into a character (char c) through this :
Of course there is something wrong, I am doing some lazy stuff, cause GCC says mov
doesn't support that.
Forgive me again for my knowledge, I have just started with inline assembly in C,
(Because I never needed it,)
Here goes my first try : (I screwed up)
; Let the awesome intel syntax go here
; And switch back to AT&T! Useless piece of puke
; Compile with
; gcc -<Options> -masm=intel source.c
AT&T syntax is ugly as hell and goes against the object code operand order in many cases. About the *only* thing good about it on Intel is the instructions specify operand length so you don't have to code byte, word, dword ugliness. It was not designed for humans to use, since UNIX-heads write C, not assembler like real men. So it's more about being easy to parse than it is about being useful and it is a back-end to all their compilers which are really not true compilers (they don't put out object code) but translators from whatever source language to assembly code on target X. Of course that means it's good for them if the assembly syntax varies as little as possible across the many platforms gcc has oozed and slimed itself onto.
The % for registers and $ for immediate operand stuff is a pain in the ass for humans and the operand reversal is a true mind-fart, especially since it's not 100%.
You may guess why AT&T syntax is so thorough about operand's meaning (cf. MASM vs. TASM .ideal and fasm memory references' syntax). PDP's MACRO-11 also had those %0, …, %7 native names for slightly more user-friendly R0, …, R5, SP, PC, along with # for numeric literals and so on. That's all about simplification of source parsing (several KiBs of memory and lousy CPU speed definitely require it).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum