📄 m68k-defs.m4
字号:
divert(-1)dnl m4 macros for 68k assembler.dnl Copyright 2001, 2002 Free Software Foundation, Inc.dnldnl This file is part of the GNU MP Library.dnldnl The GNU MP Library is free software; you can redistribute it and/ordnl modify it under the terms of the GNU Lesser General Public License asdnl published by the Free Software Foundation; either version 2.1 of thednl License, or (at your option) any later version.dnldnl The GNU MP Library is distributed in the hope that it will be useful,dnl but WITHOUT ANY WARRANTY; without even the implied warranty ofdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUdnl Lesser General Public License for more details.dnldnl You should have received a copy of the GNU Lesser General Publicdnl License along with the GNU MP Library; see the file COPYING.LIB. Ifdnl not, write to the Free Software Foundation, Inc., 59 Temple Place -dnl Suite 330, Boston, MA 02111-1307, USA.dnl The default m4 `#' commenting interferes with the assembler syntax fordnl immediates. `|' would be correct, but it interferes with "||" indnl eval(). Would like to disable commenting, but that's not possible (seednl mpn/asm-defs.m4), so use `;' which should be harmless.changecom(;)dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo)dnldnl Same as the standard PROLOGUE, but align to 2 bytes not 4.define(`PROLOGUE_cpu',m4_assert_numargs(1)` TEXT ALIGN(2) GLOBL `$1' GLOBL_ATTR TYPE(`$1',`function')`$1'LABEL_SUFFIX')dnl Usage: d0, etcdnldnl Expand to d0 or %d0 according to the assembler's requirements.dnldnl Actually d0 expands to `d0' or %`d0', the quotes protecting againstdnl further expansion. Definitions are made even if d0 is to be just `d0',dnl so that any m4 quoting problems will show up everywhere, not just on adnl %d0 system.dnldnl Care must be taken with quoting when using these in a definition. Fordnl instance the quotes in the following are essential or two %'s will bednl produced when `counter' is used.dnldnl define(counter, `d7')dnldnl Called: m68k_reg(r)define(m68k_reg,m4_assert_numargs(1)m4_assert_defined(`WANT_REGISTER_PERCENT')`ifelse(WANT_REGISTER_PERCENT,yes,%)`$1'')dnl Usage: m68k_defreg(r)define(m68k_defreg,m4_assert_numargs(1)`deflit($1,`m68k_reg(`$1')')')m68k_defreg(d0)m68k_defreg(d1)m68k_defreg(d2)m68k_defreg(d3)m68k_defreg(d4)m68k_defreg(d5)m68k_defreg(d6)m68k_defreg(d7)m68k_defreg(a0)m68k_defreg(a1)m68k_defreg(a2)m68k_defreg(a3)m68k_defreg(a4)m68k_defreg(a5)m68k_defreg(a6)m68k_defreg(a7)m68k_defreg(sp)m68k_defreg(pc)dnl Usage: M(base)dnl M(base,displacement)dnl M(base,index,size)dnl M(base,index,size,scale)dnl M(base,+)dnl M(-,base)dnldnl `base' is an address register, `index' is a data register, `size' is wdnl or l, and scale is 1, 2, 4 or 8.dnldnl M(-,base) has it's arguments that way around to emphasise it's adnl pre-decrement, as opposed to M(base,+) a post-increment.dnldnl Enhancement: Add the memory indirect modes, if/when they're needed.define(M,m4_assert_numargs_range(1,4)m4_assert_defined(`WANT_ADDRESSING')`ifelse(WANT_ADDRESSING,mit,`ifelse($#,1, ``$1'@')dnlifelse($#,2,`ifelse($2,+, ``$1'@+',`ifelse($1,-, ``$2'@-', ``$1'@($2)')')')dnlifelse($#,3, ``$1'@(`$2':`$3')')dnlifelse($#,4, ``$1'@(`$2':`$3':$4)')',dnl WANT_ADDRESSING `motorola'`ifelse($#,1, `(`$1')')dnlifelse($#,2,`ifelse($2,+, `(`$1')+',`ifelse($1,-, `-(`$2')', `$2(`$1')')')')dnlifelse($#,3, `(`$1',`$2'.$3)')dnlifelse($#,4, `(`$1',`$2'.$3*$4)')')')dnl Usage: addl etcdnldnl m68k instructions with special handling for the suffix, with fordnl instance addl expanding to addl or add.l as necessary.dnldnl See also t-m68k-defs.pl which verifies all mnemonics used in the asmdnl files have entries here.dnl Called: m68k_insn(mnemonic,suffix)define(m68k_insn,m4_assert_numargs(2)m4_assert_defined(`WANT_DOT_SIZE')`ifelse(WANT_DOT_SIZE,yes, ``$1'.``$2''', ``$1$2'')')dnl Usage: m68k_definsn(mnemonic,suffix)define(m68k_definsn,m4_assert_numargs(2)`deflit($1`'$2,`m68k_insn(`$1',`$2')')')m68k_definsn(add, l)m68k_definsn(addx, l)m68k_definsn(addq, l)m68k_definsn(asl, l)m68k_definsn(cmp, l)m68k_definsn(clr, l)m68k_definsn(divu, l)m68k_definsn(eor, w)m68k_definsn(lsl, l)m68k_definsn(lsr, l)m68k_definsn(move, l)m68k_definsn(movem,l)m68k_definsn(moveq,l)m68k_definsn(mulu, l)m68k_definsn(neg, l)m68k_definsn(or, l)m68k_definsn(roxl, l)m68k_definsn(roxr, l)m68k_definsn(sub, l)m68k_definsn(subx, l)m68k_definsn(subq, l)dnl Usage: bra etcdnldnl Expand to `bra', `jra' or `jbra' according to what the assembler willdnl accept. The latter two give variable-sized branches in gas.dnldnl See also t-m68k-defs.pl which verifies all the bXX branches used in thednl asm files have entries here.dnl Called: m68k_branch(cond)define(m68k_branch,m4_assert_numargs(1)m4_assert_defined(`WANT_BRANCHES')`ifelse(WANT_BRANCHES,jra, `j$1',`ifelse(WANT_BRANCHES,jbra,`jb$1', ``b$1'')')')dnl Called: m68k_defbranch(cond)define(m68k_defbranch,m4_assert_numargs(1)`deflit(b$1,`m68k_branch(`$1')')')m68k_defbranch(ra)m68k_defbranch(cc)m68k_defbranch(cs)m68k_defbranch(ls)m68k_defbranch(eq)m68k_defbranch(ne)dnl Usage: scale_available_pdnldnl Expand to 1 if a scale factor can be used in addressing modes, or 0 ifdnl not. M(a0,d0,l,4), meaning a0+d0*4, is not available in 68000 ordnl 68010, but is in CPU32 and in 68020 and up.define(scale_available_p,`m4_ifdef_anyof_p(`HAVE_HOST_CPU_m68360'`HAVE_HOST_CPU_m68020'`HAVE_HOST_CPU_m68030'`HAVE_HOST_CPU_m68040'`HAVE_HOST_CPU_m68060')')divert
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -