Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 May 1996 02:14:52 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-hackers@freebsd.org, j@uriah.heep.sax.de
Subject:   Re: unix + asm
Message-ID:  <199605261614.CAA31130@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> I just was curious as to what the diffs were between intel asm 
>> and at&t asm.

See also /usr/share/info/as-all.info.gz.

>Everything is just ``a bit different''.  The operators are in the
>`right' order, i.e.

`wrong'

>	mov	$0, %eax	``move number 0 into register eax''

>as opposed to Intel (Microsloth?):

>	mov	eax, 0		``move eax into 0'' ??? :)

Intel.  Gas (AT&T?) (MIT?) order is only right if C order is wrong.

>Many things in the microsloth assemblers are implicit, like operand
>size, or indirectness of the operand (0 in the above example), and you
>fairly often need to override the assembler's idea (which is
>particular fun if you need to override something for both operands).

>The unix assembler makes more things explicit.  Direct values are
>always prepended with $.  Register names start with % (at least for us

Most things in gas are implicit too, but gas gets most of the implicit
things wrong (it doesn't complain, but generates garbage).

>#
># const char *
># btos (int b);
>#
># /* Boolean to string */
>#

`#' is a standard comment symbol (I think '/' works too), but it is best
to usually use C comments, since `# if' is a cpp conditional, not a
comment, and everything must be a cpp token.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605261614.CAA31130>