Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Sep 1998 13:46:51 -0400
From:      sbabkin@dcn.att.com
To:        ormonde@aker.com.br, hackers@FreeBSD.ORG
Subject:   RE: Assembler with FreeBSD
Message-ID:  <C50B6FBA632FD111AF0F0000C0AD71EEFF8BC4@dcn71.dcn.att.com>

next in thread | raw e-mail | index | archive | help
Hi!

> -----Original Message-----
> From:	Rodrigo Ormonde [SMTP:ormonde@aker.com.br]
> 
>   I have to write a few high speed routines in assembler to run on a
> FreeBSD box. I used to program in assembler to DOS, so I think I have
> the
> necessary knowledge to do it on FreeBSD.
> 
>   The problem is that I realized that the mnemonics that gcc
> understands
> are different from the ones I'm used to. I'd like to know if there is
> a
> paper (or book, or something) that describes the gcc assembler
> mnemonics,
> or better, compares them to the ones used by TASM or MASM.
> 
The mnemonics used by GASM are modeled after VAX/Motorola, so
their most important differences from MASM are:

1. The destination operand is on the right side (the common rule is that
operands are in such case in reverse order compared to MASM). 
This brings an issue of CMP instructions, because even on VAX they are
in MASM-like order, so you can look at the existing code to understand
which way is right, I can't remember it now :-)

2. The length of operands is specified explicitly, like MOVL for 4-byte
operands, MOVS for 2-byte operands, MOVB for 1-byte operands instead
of one common MOV with strange additions like BYTE PTR.

3. The register names always have prefix '%', just like very old Intel
ASM.

4. The constants have prefix '$', the numbers without that prefix are
addresses.

5. Notation for hexadecimal and octal numbers is just like C.

There are also some other minor differences.

-Sergey

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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