.intel_syntax
Hi all,
Could someone please tell me how the .intel_syntax works.I can't seem to find any reference to it in the man pages or any other documentation on it.I want to compile some code written in the intel syntax using gcc. Thanks.
mishra.
AS (dvi, html or ps variant, 'info' is un-readable, 'man' doesn't even exist) documentation mentions only the difference wrt att syntax and some specific issues, basic coding should refer to intel docs.
find an excerpt at
http://www.lxhp.in-berlin.de/lhpas86.html
basic rules, very short:
<source> and <destn> appear exchanged (mostly! fp oprs are different!) mnonic+"l" for <dword> opr, "w" for word, "b" for byte the operand never takes a size praefix.
use "(...)" instead of " [ .. ]" or intel syntax "ptr" or "pointer". immediate oprs praefixed w. "$"
indexed addressing by " disp(reg)"
or " disp( base-reg, scaled-reg, scale-factor)"
where any of the rsp. items migh be left blank, e.g.
movl $1, (,edx,2)
which for nasm would be "mov dword[edx*2],1"
AS alway 'optimzes' branches and byte-codeable immeds, uncontrolably, but, any branches to labels which are declared "global" will be assembled 'long' regardless of the displacement figure - "nasm "jmp/jcc near label".
other differences exist wrt pseudo operations, which are fully explaind in AS documentation.
insert ".att_syntax noprefix" at top asm line for un-prefixed registers which would otherwise be expected w. a leading "%" character.
AS's ".intel_syntax" not orderly implemented, imo, not recommendable.
best,
hp
n mishra am Donnerstag, 16. Januar 2003 01:19:
Quoted 5 lines
Hi all,
Could someone please tell me how the .intel_syntax works.I can't seem to find any reference to it in the man pages or any other documentation on it.I want to compile some code written in the intel syntax using gcc.
Signature · 1 line
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
Quoted 1 line
Quoted 1 line
clf -at- lxhp -dot- in-berlin -dot- de <<
hp am Donnerstag, 16. Januar 2003 06:30:
I forgot (didn't read carefully)
intel_syntax is not documented, at all. but, you'll find several examples to almost all mnemonics in the <binutils> sources - which also reveal the current state of in-completeness.
Signature · 1 line
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
Quoted 1 line
Quoted 1 line
hp -at- lxhp -dot- in-berlin -dot- de <<
Quoted 2 lines · n mishra
Hi all,
Could someone please tell me how the .intel_syntax works.I can't seem to find any reference to it in the man pages or any other documentation on it.I want to compile some code written in the intel syntax using gcc.
you cant (unless I am wrong)
gcc does at&t syntax only .......... and uses gas to compile assembly
but you can use nasm to compile intel syntax ..... and link nasm object files to gcc compiled C or C++
there is heaps of intel syntax docs on Intel's site
etienne
Quoted 10 lines
Thanks.
mishra.-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html