From owner-freebsd-hackers Sun May 26 09:22:44 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA03142 for hackers-outgoing; Sun, 26 May 1996 09:22:44 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id JAA03136 for ; Sun, 26 May 1996 09:22:41 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id CAA31130; Mon, 27 May 1996 02:14:52 +1000 Date: Mon, 27 May 1996 02:14:52 +1000 From: Bruce Evans Message-Id: <199605261614.CAA31130@godzilla.zeta.org.au> To: freebsd-hackers@freebsd.org, j@uriah.heep.sax.de Subject: Re: unix + asm Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> 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