Back to index

glibc  2.9
asm-syntax.h
Go to the documentation of this file.
00001 /* Definitions for 68k syntax variations.
00002    Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.  Its master source is NOT part of
00004    the C library, however.  The master source lives in the GNU MP Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #ifdef HAVE_ELF
00022 
00023 /* ELF uses byte-counts for .align, most others use log2 of count of bytes.  */
00024 #define ALIGNARG(log2) 1<<log2
00025 /* For ELF we need the `.type' directive to make shared libs work right.  */
00026 #define PROLOG(name) .type name,@function
00027 #define EPILOG(name) .size name,.-name
00028 /* For ELF we need to prefix register names and local labels.  */
00029 #ifdef __STDC__
00030 #define R_(r) %##r
00031 #define R(r) R_(r)
00032 #define L(label) .##label
00033 #else
00034 #define R(r) %r
00035 #define L(label) .label
00036 #endif
00037 
00038 #else
00039 
00040 #define ALIGNARG(log2) log2
00041 #define PROLOG(name) /* Nothing.  */
00042 #define EPILOG(name) /* Nothing.  */
00043 #define R(r) r
00044 #define L(label) label
00045 
00046 #endif
00047 
00048 #ifdef MIT_SYNTAX
00049 #define MEM(base)R(base)@
00050 #define MEM_DISP(base,displacement)R(base)@(displacement)
00051 #define MEM_INDX(base,idx,size_suffix)R(base)@(R(idx):size_suffix)
00052 #define MEM_INDX1(base,idx,size_suffix,scale)R(base)@(R(idx):size_suffix:scale)
00053 #define MEM_PREDEC(memory_base)R(memory_base)@-
00054 #define MEM_POSTINC(memory_base)R(memory_base)@+
00055 #define TEXT .text
00056 #define ALIGN .even
00057 #define GLOBL .globl
00058 /* Use variable sized opcodes.  */
00059 #define bcc jcc
00060 #define bcs jcs
00061 #define bls jls
00062 #define beq jeq
00063 #define bne jne
00064 #define bra jra
00065 #endif
00066 
00067 #ifdef MOTOROLA_SYNTAX
00068 #define MEM(base)(R(base))
00069 #define MEM_DISP(base,displacement)(displacement,R(base))
00070 #define MEM_PREDEC(memory_base)-(R(memory_base))
00071 #define MEM_POSTINC(memory_base)(R(memory_base))+
00072 #ifdef __STDC__
00073 #define MEM_INDX_(base,idx,size_suffix)(R(base),R(idx##.##size_suffix))
00074 #define MEM_INDX(base,idx,size_suffix)MEM_INDX_(base,idx,size_suffix)
00075 #define MEM_INDX1_(base,idx,size_suffix,scale)(R(base),R(idx##.##size_suffix*scale))
00076 #define MEM_INDX1(base,idx,size_suffix,scale)MEM_INDX1_(base,idx,size_suffix,scale)
00077 #else
00078 #define MEM_INDX(base,idx,size_suffix)(R(base),R(idx).size_suffix)
00079 #define MEM_INDX1(base,idx,size_suffix,scale)(R(base),R(idx).size_suffix*scale)
00080 #endif
00081 #define TEXT .text
00082 #define ALIGN .align ALIGNARG(2)
00083 #define GLOBL .globl
00084 #define bcc jbcc
00085 #define bcs jbcs
00086 #define bls jbls
00087 #define beq jbeq
00088 #define bne jbne
00089 #define bra jbra
00090 #define movel move.l
00091 #define moveml movem.l
00092 #define moveql moveq.l
00093 #define cmpl cmp.l
00094 #define orl or.l
00095 #define clrl clr.l
00096 #define andw and.w
00097 #define eorw eor.w
00098 #define andl and.l
00099 #define lsrl lsr.l
00100 #define lsll lsl.l
00101 #define roxrl roxr.l
00102 #define roxll roxl.l
00103 #define addl add.l
00104 #define addxl addx.l
00105 #define addql addq.l
00106 #define subl sub.l
00107 #define subxl subx.l
00108 #define subqw subq.w
00109 #define subql subq.l
00110 #define negl neg.l
00111 #define mulul mulu.l
00112 #define tstw tst.w
00113 #define tstl tst.l
00114 #endif