TI C54x target.
This commit is contained in:
parent
2d30b3dab4
commit
39bec121fb
|
@ -1,3 +1,23 @@
|
|||
2000-06-20 Timothy Wall <twall@cygnus.com>
|
||||
|
||||
* doc/internals.texi (CPU backend): Add @itemx for
|
||||
TC_START_LABEL_WITHOUT_COLON.
|
||||
* doc/c-tic54x.texi: New.
|
||||
* doc/as.texinfo: Add tic54x features and include primary tic54x
|
||||
documentation file.
|
||||
* doc/all.texi: Add C54X.
|
||||
* doc/Makefile.am (CPU_DOCS): Add c-tic54x.texi.
|
||||
* doc/Makefile.in: Regenerate.
|
||||
* configure.in: Add tic54x and define LIBM for tic54x.
|
||||
* configure: Regenrate.
|
||||
* config/tc-tic54x.[ch]: New.
|
||||
* config/obj-coff.h: Add tic54x.
|
||||
* Makefile.am: (CPU_TYPES): Add tic54x.
|
||||
(TARGET_CPU_CFILES): Add 'tc-tic54x.c'.
|
||||
(TARGET_CPU_HFILES): Add 'tc-tic54x.h'.
|
||||
(as_new_LDADD): Add $(LIBM).
|
||||
* Makefile.in: Regenerate.
|
||||
|
||||
2000-06-18 Stephane Carrez <stcarrez@worldnet.fr>
|
||||
|
||||
* doc/Makefile.am (CPU_DOCS): Added 68hc11 file.
|
||||
|
@ -746,7 +766,7 @@ Fri Apr 21 13:20:53 2000 Richard Henderson <rth@cygnus.com>
|
|||
Jim Wilson <wilson@cygnus.com>
|
||||
|
||||
* Makefile.am (CPU_TYPES): Add ia64.
|
||||
(TARGET_CPU_CFILES): Add cofnig/tc-ia64.c.
|
||||
(TARGET_CPU_CFILES): Add config/tc-ia64.c.
|
||||
(TARGET_CPU_HFILES): Add config/tc-ia64.h.
|
||||
* Makefile.in: Rebuild.
|
||||
* app.c (do_scrub_chars): Handle DOUBLESLASH_COMMENTS.
|
||||
|
|
|
@ -68,6 +68,7 @@ CPU_TYPES = \
|
|||
sparc \
|
||||
tahoe \
|
||||
tic30 \
|
||||
tic54x \
|
||||
tic80 \
|
||||
vax \
|
||||
w65 \
|
||||
|
@ -240,6 +241,7 @@ TARGET_CPU_CFILES = \
|
|||
config/tc-sparc.c \
|
||||
config/tc-tahoe.c \
|
||||
config/tc-tic30.c \
|
||||
config/tc-tic54x.c \
|
||||
config/tc-tic80.c \
|
||||
config/tc-vax.c \
|
||||
config/tc-w65.c \
|
||||
|
@ -278,6 +280,7 @@ TARGET_CPU_HFILES = \
|
|||
config/tc-sparc.h \
|
||||
config/tc-tahoe.h \
|
||||
config/tc-tic30.h \
|
||||
config/tc-tic54x.h \
|
||||
config/tc-tic80.h \
|
||||
config/tc-vax.h \
|
||||
config/tc-w65.h \
|
||||
|
@ -445,7 +448,7 @@ $(OBJS): @ALL_OBJ_DEPS@
|
|||
|
||||
as_new_SOURCES = $(GAS_CFILES)
|
||||
as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
|
||||
$(extra_objects) $(GASLIBS) $(INTLLIBS)
|
||||
$(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM)
|
||||
as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \
|
||||
$(extra_objects) $(GASLIBS) $(INTLDEPS)
|
||||
|
||||
|
@ -1264,6 +1267,10 @@ DEPTC_tic30_elf = $(INCDIR)/bin-bugs.h $(INCDIR)/progress.h \
|
|||
$(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \
|
||||
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
|
||||
$(srcdir)/config/tc-tic30.h emul.h $(INCDIR)/opcode/tic30.h
|
||||
DEPTC_tic54x_coff = $(INCDIR)/bin-bugs.h $(INCDIR)/progress.h \
|
||||
$(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(BFDDIR)/libcoff.h \
|
||||
$(INCDIR)/bfdlink.h emul.h $(INCDIR)/opcode/tic54x.h
|
||||
DEPTC_tic80_coff = $(INCDIR)/bin-bugs.h $(INCDIR)/progress.h \
|
||||
$(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \
|
||||
|
@ -1658,6 +1665,10 @@ DEPOBJ_tic30_elf = $(INCDIR)/bin-bugs.h $(INCDIR)/progress.h \
|
|||
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \
|
||||
$(srcdir)/config/tc-tic30.h emul.h subsegs.h $(INCDIR)/obstack.h \
|
||||
$(INCDIR)/aout/aout64.h
|
||||
DEPOBJ_tic54x_coff = $(INCDIR)/bin-bugs.h $(INCDIR)/progress.h \
|
||||
$(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(BFDDIR)/libcoff.h \
|
||||
$(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h subsegs.h
|
||||
DEPOBJ_tic80_coff = $(INCDIR)/bin-bugs.h $(INCDIR)/progress.h \
|
||||
$(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \
|
||||
|
@ -1914,6 +1925,9 @@ DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \
|
|||
DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
|
||||
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h
|
||||
DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(BFDDIR)/libcoff.h \
|
||||
$(INCDIR)/bfdlink.h
|
||||
DEP_tic80_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic80.h \
|
||||
$(INCDIR)/coff/internal.h $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h \
|
||||
$(INCDIR)/bfdlink.h
|
||||
|
|
2075
gas/Makefile.in
2075
gas/Makefile.in
File diff suppressed because it is too large
Load Diff
2
gas/NEWS
2
gas/NEWS
|
@ -2,6 +2,8 @@
|
|||
|
||||
Changes in 2.11:
|
||||
|
||||
Support for Texas Instruments TMS320C54x (tic54x).
|
||||
|
||||
Support for IA-64.
|
||||
|
||||
x86 gas has a new .arch pseudo op to specify the target CPU architecture.
|
||||
|
|
|
@ -149,6 +149,11 @@
|
|||
#define TARGET_FORMAT "coff-tic30"
|
||||
#endif
|
||||
|
||||
#ifdef TC_TIC54X
|
||||
#include "coff/tic54x.h"
|
||||
#define TARGET_FORMAT "coff1-c54x"
|
||||
#endif
|
||||
|
||||
#ifdef TC_TIC80
|
||||
#include "coff/tic80.h"
|
||||
#define TARGET_FORMAT "coff-tic80"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,128 @@
|
|||
/* tc-tic54x.h -- Header file for tc-tic54x.c
|
||||
Copyright (C) 1999, 2000 Free Software Foundation.
|
||||
Contributed by Timothy Wall (twall@alum.mit.edu)
|
||||
|
||||
This file is part of GAS, the GNU Assembler.
|
||||
|
||||
GAS is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GAS is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GAS; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#ifndef _TC_TIC54X_H_
|
||||
#define _TC_TIC54X_H_
|
||||
|
||||
/* select the proper coff format (see obj-coff.h) */
|
||||
#define TC_TIC54X
|
||||
|
||||
#define TARGET_BYTES_BIG_ENDIAN 0
|
||||
#define OCTETS_PER_BYTE_POWER 1
|
||||
|
||||
#define TARGET_ARCH bfd_arch_tic54x
|
||||
#define BFD_ARCH TARGET_ARCH
|
||||
|
||||
#define WORKING_DOT_WORD 1
|
||||
|
||||
#define MAX_OPERANDS 4
|
||||
#define PARALLEL_SEPARATOR '|'
|
||||
#define LABELS_WITHOUT_COLONS 1
|
||||
/* accept 0FFFFh, 1010b, etc. */
|
||||
#define NUMBERS_WITH_SUFFIX 1
|
||||
/* $ is section program counter */
|
||||
#define DOLLAR_DOT 1
|
||||
/* accept parallel lines like
|
||||
add #1,a || ld #1, b
|
||||
(may also be split across lines)
|
||||
*/
|
||||
#define DOUBLEBAR_PARALLEL 1
|
||||
/* affects preprocessor */
|
||||
#define KEEP_WHITE_AROUND_COLON 1
|
||||
|
||||
/* We need the extra field in the fixup struct to put the relocation in. */
|
||||
|
||||
#define NEED_FX_R_TYPE
|
||||
|
||||
struct bit_info
|
||||
{
|
||||
segT seg;
|
||||
#define TYPE_SPACE 0
|
||||
#define TYPE_BES 1
|
||||
#define TYPE_FIELD 2
|
||||
int type;
|
||||
symbolS *sym;
|
||||
valueT value;
|
||||
char *where;
|
||||
int offset;
|
||||
};
|
||||
|
||||
/* We sometimes need to keep track of bit offsets within words */
|
||||
#define TC_FRAG_TYPE int
|
||||
#define TC_FRAG_INIT(FRAGP) do {(FRAGP)->tc_frag_data = 0;}while(0)
|
||||
|
||||
/* tell GAS whether the given token is indeed a code label */
|
||||
#define TC_START_LABEL_WITHOUT_COLON(c,ptr) tic54x_start_label(c,ptr)
|
||||
extern int tic54x_start_label PARAMS((int, char *));
|
||||
|
||||
/* custom handling for relocations in cons expressions */
|
||||
#define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) tic54x_cons_fix_new(FRAG,OFF,LEN,EXP)
|
||||
extern void tic54x_cons_fix_new PARAMS((fragS *,int,int,expressionS *));
|
||||
|
||||
/* Define md_number_to_chars as the appropriate standard big endian or
|
||||
little endian function. Mostly littleendian, but longwords and floats are
|
||||
stored MS word first.
|
||||
*/
|
||||
|
||||
#define md_number_to_chars tic54x_number_to_chars
|
||||
extern void tic54x_number_to_chars PARAMS((char *, valueT, int));
|
||||
#define tc_adjust_symtab() tic54x_adjust_symtab()
|
||||
extern void tic54x_adjust_symtab PARAMS(());
|
||||
#define tc_unrecognized_line(ch) tic54x_unrecognized_line(ch)
|
||||
extern int tic54x_unrecognized_line PARAMS((int ch));
|
||||
#define md_parse_name(s,e) tic54x_parse_name(s,e)
|
||||
extern int tic54x_parse_name PARAMS((char *name, expressionS *e));
|
||||
#define md_undefined_symbol(s) tic54x_undefined_symbol(s)
|
||||
extern symbolS *tic54x_undefined_symbol PARAMS((char *name));
|
||||
#define md_macro_start() tic54x_macro_start()
|
||||
extern void tic54x_macro_start ();
|
||||
#define md_macro_end() tic54x_macro_end()
|
||||
extern void tic54x_macro_end ();
|
||||
#define md_macro_info(args) tic54x_macro_info(args)
|
||||
extern void tic54x_macro_info PARAMS((void *macro));
|
||||
#define tc_frob_label(sym) tic54x_define_label (sym)
|
||||
extern void tic54x_define_label PARAMS((symbolS *));
|
||||
|
||||
#define md_start_line_hook() tic54x_start_line_hook()
|
||||
extern void tic54x_start_line_hook ();
|
||||
|
||||
#define md_estimate_size_before_relax(f,s) \
|
||||
tic54x_estimate_size_before_relax(f,s)
|
||||
extern int tic54x_estimate_size_before_relax(fragS *, segT);
|
||||
|
||||
#define md_relax_frag(f,s) tic54x_relax_frag(f,s)
|
||||
extern int tic54x_relax_frag(fragS *, long);
|
||||
|
||||
#define md_convert_frag(b,s,f) tic54x_convert_frag(b,s,f)
|
||||
extern void tic54x_convert_frag(bfd *, segT, fragS *);
|
||||
|
||||
/* Other things we don't support... */
|
||||
|
||||
/* Define away the call to md_operand in the expression parsing code.
|
||||
This is called whenever the expression parser can't parse the input
|
||||
and gives the assembler backend a chance to deal with it instead. */
|
||||
|
||||
#define md_operand(X)
|
||||
|
||||
/* spruce up the listing output */
|
||||
#define LISTING_WORD_SIZE 2
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -393,6 +393,8 @@ changequote([,])dnl
|
|||
|
||||
tic30-*-*aout*) fmt=aout bfd_gas=yes ;;
|
||||
tic30-*-*coff*) fmt=coff bfd_gas=yes ;;
|
||||
tic54x-*-* | c54x*-*-*)
|
||||
fmt=coff bfd_gas=yes need_libm=yes;;
|
||||
tic80-*-*) fmt=coff ;;
|
||||
|
||||
v850-*-*) fmt=elf bfd_gas=yes ;;
|
||||
|
@ -816,6 +818,14 @@ AC_CHECK_FUNCS(unlink remove, break)
|
|||
# Some systems don't have sbrk().
|
||||
AC_CHECK_FUNCS(sbrk)
|
||||
|
||||
# do we need the math library?
|
||||
case "${need_libm}" in
|
||||
yes)
|
||||
AC_CHECK_LIBM
|
||||
AC_SUBST(LIBM)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Some non-ANSI preprocessors botch requoting inside strings. That's bad
|
||||
# enough, but on some of those systems, the assert macro relies on requoting
|
||||
# working properly!
|
||||
|
|
|
@ -33,6 +33,7 @@ CPU_DOCS = \
|
|||
c-pj.texi \
|
||||
c-sh.texi \
|
||||
c-sparc.texi \
|
||||
c-tic54x.texi \
|
||||
c-vax.texi \
|
||||
c-v850.texi \
|
||||
c-z8k.texi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
|
@ -46,9 +46,10 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_FLAG =
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
|
@ -83,6 +84,7 @@ INTLDEPS = @INTLDEPS@
|
|||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
LEX = @LEX@
|
||||
LIBM = @LIBM@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
|
@ -118,27 +120,7 @@ man_MANS = as.1
|
|||
|
||||
info_TEXINFOS = as.texinfo gasp.texi
|
||||
|
||||
CPU_DOCS = \
|
||||
c-a29k.texi \
|
||||
c-arm.texi \
|
||||
c-d10v.texi \
|
||||
c-h8300.texi \
|
||||
c-h8500.texi \
|
||||
c-hppa.texi \
|
||||
c-i370.texi \
|
||||
c-i386.texi \
|
||||
c-i960.texi \
|
||||
c-m32r.texi \
|
||||
c-m68hc11.texi \
|
||||
c-m68k.texi \
|
||||
c-mips.texi \
|
||||
c-ns32k.texi \
|
||||
c-pj.texi \
|
||||
c-sh.texi \
|
||||
c-sparc.texi \
|
||||
c-vax.texi \
|
||||
c-v850.texi \
|
||||
c-z8k.texi
|
||||
CPU_DOCS = c-a29k.texi c-arm.texi c-d10v.texi c-h8300.texi c-h8500.texi c-hppa.texi c-i370.texi c-i386.texi c-i960.texi c-m32r.texi c-m68hc11.texi c-m68k.texi c-mips.texi c-ns32k.texi c-pj.texi c-sh.texi c-sparc.texi c-tic54x.texi c-vax.texi c-v850.texi c-z8k.texi
|
||||
|
||||
|
||||
# This one isn't ready for prime time yet. Not even a little bit.
|
||||
|
@ -378,7 +360,7 @@ uninstall: uninstall-am
|
|||
all-am: Makefile $(MANS)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(mandir)/man1
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
@set PJ
|
||||
@set SH
|
||||
@set SPARC
|
||||
@set C54X
|
||||
@set V850
|
||||
@set VAX
|
||||
@set VXWORKS
|
||||
|
|
|
@ -249,6 +249,10 @@ Here is a brief summary of how to invoke @code{@value{AS}}. For details,
|
|||
-Av8plus | -Av8plusa | -Av9 | -Av9a ]
|
||||
[ -xarch=v8plus | -xarch=v8plusa ] [ -bump ] [ -32 | -64 ]
|
||||
@end ifset
|
||||
@ifset TIC54X
|
||||
[ -mcpu=54[123589] | -mcpu=54[56]lp ] [ -mfar-mode | -mf ]
|
||||
[ -merrors-to-file <filename> | -me <filename> ]
|
||||
@end ifset
|
||||
@ifset Z8000
|
||||
@c Z8000 has no machine-dependent assembler options
|
||||
@end ifset
|
||||
|
@ -623,6 +627,22 @@ Warn when the assembler switches to another architecture.
|
|||
@end table
|
||||
@end ifset
|
||||
|
||||
@ifset TIC54X
|
||||
The following options are available when @value{AS} is configured for the 'c54x
|
||||
architecture.
|
||||
|
||||
@table @code
|
||||
@item -mfar-mode
|
||||
Enable extended addressing mode. All addresses and relocations will assume
|
||||
extended addressing (usually 23 bits).
|
||||
@item -mcpu=@var{CPU_VERSION}
|
||||
Sets the CPU version being compiled for.
|
||||
@item -merrors-to-file @var{FILENAME}
|
||||
Redirect error output to a file, for broken systems which don't support such
|
||||
behaviour in the shell.
|
||||
@end table
|
||||
@end ifset
|
||||
|
||||
@ifset MIPS
|
||||
The following options are available when @value{AS} is configured for
|
||||
a MIPS processor.
|
||||
|
@ -5031,6 +5051,9 @@ subject, see the hardware manufacturer's manual.
|
|||
@ifset SPARC
|
||||
* Sparc-Dependent:: SPARC Dependent Features
|
||||
@end ifset
|
||||
@ifset TIC54X
|
||||
* TIC54X-Dependent:: TI TMS320C54x Dependent Features
|
||||
@end ifset
|
||||
@ifset V850
|
||||
* V850-Dependent:: V850 Dependent Features
|
||||
@end ifset
|
||||
|
@ -5221,6 +5244,10 @@ family.
|
|||
@include c-sparc.texi
|
||||
@end ifset
|
||||
|
||||
@ifset TIC54X
|
||||
@include c-tic54x.texi
|
||||
@end ifset
|
||||
|
||||
@ifset Z8000
|
||||
@include c-z8k.texi
|
||||
@end ifset
|
||||
|
@ -5524,6 +5551,9 @@ Linas Vepstas added GAS support for the ESA/390 "IBM 370" architecture.
|
|||
Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote GAS and BFD
|
||||
support for openVMS/Alpha.
|
||||
|
||||
Timothy Wall, Michael Hayes, and Greg Smart contributed to the various tic*
|
||||
flavors.
|
||||
|
||||
Several engineers at Cygnus Support have also provided many small bug fixes and
|
||||
configuration enhancements.
|
||||
|
||||
|
|
|
@ -0,0 +1,767 @@
|
|||
@c Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
||||
@c This is part of the GAS manual.
|
||||
@c For copying conditions, see the file as.texinfo.
|
||||
@c TI TMS320C54X description by Timothy Wall, twall@cygnus.com
|
||||
@ifset GENERIC
|
||||
@page
|
||||
@node C54X-Dependent
|
||||
@chapter C54X Dependent Features
|
||||
@end ifset
|
||||
@ifclear GENERIC
|
||||
@node Machine Dependencies
|
||||
@chapter C54X Dependent Features
|
||||
@end ifclear
|
||||
|
||||
@cindex C54X support
|
||||
@menu
|
||||
* C54X-Opts:: Command-line Options
|
||||
* C54X-Block:: Blocking
|
||||
* C54X-Env:: Environment Settings
|
||||
* C54X-Constants:: Constants Syntax
|
||||
* C54X-Subsyms:: String Substitution
|
||||
* C54X-Locals:: Local Label Syntax
|
||||
* C54X-Builtins:: Builtin Assembler Math Functions
|
||||
* C54X-Ext:: Extended Addressing Support
|
||||
* C54X-Directives:: Directives
|
||||
* C54X-Macros:: Macro Features
|
||||
* C54X-MMRegs:: Memory-mapped Registers
|
||||
@end menu
|
||||
|
||||
@node C54X-Opts
|
||||
@section Options
|
||||
|
||||
@cindex options, C54X
|
||||
@cindex C54X options
|
||||
The 'c54x version of @code{@value{AS}} has a few machine-dependent options.
|
||||
|
||||
@cindex @samp{-mfar-mode} option, far-mode
|
||||
@cindex @samp{-mf} option, far-mode
|
||||
You can use the @samp{-mfar-mode} option to enable extended addressing mode.
|
||||
All addresses will be assumed to be > 16 bits, and the appropriate
|
||||
relocation types will be used. This option is equivalent to using the
|
||||
@samp{.far_mode} directive in the assembly code. If you do not use the
|
||||
@samp{-mfar-mode} option, all references will be assumed to be 16 bits.
|
||||
This option may be abbreviated to @samp{-mf}.
|
||||
|
||||
@cindex @samp{-mcpu} option, cpu
|
||||
You can use the @samp{-mcpu} option to specify a particular CPU.
|
||||
This option is equivalent to using the @samp{.version} directive in the
|
||||
assembly code. For recognized CPU codes, see
|
||||
@xref{C54X-Directives,,@code{.version}}. The default CPU version is
|
||||
@samp{542}.
|
||||
|
||||
@cindex @samp{-merrors-to-file} option, stderr redirect
|
||||
@cindex @samp{-me} option, stderr redirect
|
||||
You can use the @samp{-merrors-to-file} option to redirect error output
|
||||
to a file (this provided for those deficient environments which don't
|
||||
provide adequate output redirection). This option may be abbreviated to
|
||||
@samp{-me}.
|
||||
|
||||
@node C54X-Block
|
||||
@section Blocking
|
||||
A blocked section or memory block is guaranteed not to cross the blocking
|
||||
boundary (usually a page, or 128 words) if it is smaller than the
|
||||
blocking size, or to start on a page boundary if it is larger than the
|
||||
blocking size.
|
||||
|
||||
@node C54X-Env
|
||||
@section Environment Settings
|
||||
|
||||
@cindex environment settings, C54X
|
||||
@cindex @samp{A_DIR} environment variable, C54X
|
||||
@cindex @samp{C54XDSP_DIR} environment variable, C54X
|
||||
@samp{C54XDSP_DIR} and @samp{A_DIR} are semicolon-separated
|
||||
paths which are added to the list of directories normally searched for
|
||||
source and include files. @samp{C54XDSP_DIR} will override @samp{A_DIR}.
|
||||
|
||||
@node C54X-Constants
|
||||
@section Constants Syntax
|
||||
|
||||
@cindex constants, C54X
|
||||
The C54X version of @code{@value{AS}} allows the following additional
|
||||
constant formats, using a suffix to indicate the radix:
|
||||
@smallexample
|
||||
@cindex binary constants, C54X
|
||||
|
||||
Binary @code{000000B, 011000b}
|
||||
Octal @code{10Q, 224q}
|
||||
Hexadecimal @code{45h, 0FH}
|
||||
|
||||
@end smallexample
|
||||
|
||||
@node C54X-Subsyms
|
||||
@section String Substitution
|
||||
A subset of allowable symbols (which we'll call subsyms) may be assigned
|
||||
arbitrary string values. This is roughly equivalent to C preprocessor
|
||||
#define macros. When @code{@value{AS}} encounters one of these
|
||||
symbols, the symbol is replaced in the input stream by its string value.
|
||||
Subsym names @strong{must} begin with a letter.
|
||||
|
||||
Subsyms may be defined using the @code{.asg} and @code{.eval} directives
|
||||
(@xref{C54X-Directives,,@code{.asg}},
|
||||
@xref{C54X-Directives,,@code{.eval}}.
|
||||
|
||||
Expansion is recursive until a previously encountered symbol is seen, at
|
||||
which point substitution stops.
|
||||
|
||||
In this example, x is replaced with SYM2; SYM2 is replaced with SYM1, and SYM1
|
||||
is replaced with x. At this point, x has already been encountered
|
||||
and the substitution stops.
|
||||
|
||||
@smallexample @code
|
||||
.asg "x",SYM1
|
||||
.asg "SYM1",SYM2
|
||||
.asg "SYM2",x
|
||||
add x,a ; final code assembled is "add x, a"
|
||||
@end smallexample
|
||||
|
||||
Macro parameters are converted to subsyms; a side effect of this is the normal
|
||||
@code{@value{AS}} '\ARG' dereferencing syntax is unnecessary. Subsyms
|
||||
defined within a macro will have global scope, unless the @code{.var}
|
||||
directive is used to identify the subsym as a local macro variable
|
||||
@pxref{C54X-Directives,,@code{.var}}.
|
||||
|
||||
Substitution may be forced in situations where replacement might be
|
||||
ambiguous by placing colons on either side of the subsym. The following
|
||||
code:
|
||||
|
||||
@smallexample @code
|
||||
.eval "10",x
|
||||
LAB:X: add #x, a
|
||||
@end smallexample
|
||||
|
||||
When assembled becomes:
|
||||
|
||||
@smallexample @code
|
||||
LAB10 add #10, a
|
||||
@end smallexample
|
||||
|
||||
Smaller parts of the string assigned to a subsym may be accessed with
|
||||
the following syntax:
|
||||
|
||||
@table @code
|
||||
@item @code{:@var{symbol}(@var{char_index}):}
|
||||
Evaluates to a single-character string, the character at @var{char_index}.
|
||||
@item @code{:@var{symbol}(@var{start},@var{length}):}
|
||||
Evaluates to a substring of @var{symbol} beginning at @var{start} with
|
||||
length @var{length}.
|
||||
@end table
|
||||
|
||||
@node C54X-Locals
|
||||
@section Local Labels
|
||||
Local labels may be defined in two ways:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
$N, where N is a decimal number between 0 and 9
|
||||
@item
|
||||
LABEL?, where LABEL is any legal symbol name.
|
||||
@end itemize
|
||||
|
||||
Local labels thus defined may be redefined or automatically generated.
|
||||
The scope of a local label is based on when it may be undefined or reset.
|
||||
This happens when one of the following situations is encountered:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
.newblock directive @pxref{C54X-Directives,,@code{.newblock}}
|
||||
@item
|
||||
The current section is changed (.sect, .text, or .data)
|
||||
@item
|
||||
Entering or leaving an included file
|
||||
@item
|
||||
The macro scope where the label was defined is exited
|
||||
@end itemize
|
||||
|
||||
@node C54X-Builtins
|
||||
@section Math Builtins
|
||||
|
||||
@cindex math builtins, C54X
|
||||
@cindex C54X builtin math functions
|
||||
@cindex builtin math functions, C54X
|
||||
|
||||
The following built-in functions may be used to generate a
|
||||
floating-point value. All return a floating-point value except
|
||||
@samp{$cvi}, @samp{$int}, and @samp{$sgn}, which return an integer
|
||||
value.
|
||||
|
||||
@table @code
|
||||
@cindex @code{$acos} math builtin, C54X
|
||||
@item @code{$acos(@var{expr})}
|
||||
Returns the floating point arccosine of @var{expr}.
|
||||
|
||||
@cindex @code{$asin} math builtin, C54X
|
||||
@item @code{$asin(@var{expr})}
|
||||
Returns the floating point arcsine of @var{expr}.
|
||||
|
||||
@cindex @code{$atan} math builtin, C54X
|
||||
@item @code{$atan(@var{expr})}
|
||||
Returns the floating point arctangent of @var{expr}.
|
||||
|
||||
@cindex @code{$atan2} math builtin, C54X
|
||||
@item @code{$atan2(@var{expr1},@var{expr2})}
|
||||
Returns the floating point arctangent of @var{expr1} / @var{expr2}.
|
||||
|
||||
@cindex @code{$ceil} math builtin, C54X
|
||||
@item @code{$ceil(@var{expr})}
|
||||
Returns the smallest integer not less than @var{expr} as floating point.
|
||||
|
||||
@cindex @code{$cosh} math builtin, C54X
|
||||
@item @code{$cosh(@var{expr})}
|
||||
Returns the floating point hyperbolic cosine of @var{expr}.
|
||||
|
||||
@cindex @code{$cos} math builtin, C54X
|
||||
@item @code{$cos(@var{expr})}
|
||||
Returns the floating point cosine of @var{expr}.
|
||||
|
||||
@cindex @code{$cvf} math builtin, C54X
|
||||
@item @code{$cvf(@var{expr})}
|
||||
Returns the integer value @var{expr} converted to floating-point.
|
||||
|
||||
@cindex @code{$cvi} math builtin, C54X
|
||||
@item @code{$cvi(@var{expr})}
|
||||
Returns the floating point value @var{expr} converted to integer.
|
||||
|
||||
@cindex @code{$exp} math builtin, C54X
|
||||
@item @code{$exp(@var{expr})}
|
||||
Returns the floating point value e ^ @var{expr}.
|
||||
|
||||
@cindex @code{$fabs} math builtin, C54X
|
||||
@item @code{$fabs(@var{expr})}
|
||||
Returns the floating point absolute value of @var{expr}.
|
||||
|
||||
@cindex @code{$floor} math builtin, C54X
|
||||
@item @code{$floor(@var{expr})}
|
||||
Returns the largest integer that is not greater than @var{expr} as
|
||||
floating point.
|
||||
|
||||
@cindex @code{$fmod} math builtin, C54X
|
||||
@item @code{$fmod(@var{expr1},@var{expr2})}
|
||||
Returns the floating point remainder of @var{expr1} / @var{expr2}.
|
||||
|
||||
@cindex @code{$int} math builtin, C54X
|
||||
@item @code{$int(@var{expr})}
|
||||
Returns 1 if @var{expr} evaluates to an integer, zero otherwise.
|
||||
|
||||
@cindex @code{$ldexp} math builtin, C54X
|
||||
@item @code{$ldexp(@var{expr1},@var{expr2})}
|
||||
Returns the floating point value @var{expr1} * 2 ^ @var{expr2}.
|
||||
|
||||
@cindex @code{$log10} math builtin, C54X
|
||||
@item @code{$log10(@var{expr})}
|
||||
Returns the base 10 logarithm of @var{expr}.
|
||||
|
||||
@cindex @code{$log} math builtin, C54X
|
||||
@item @code{$log(@var{expr})}
|
||||
Returns the natural logarithm of @var{expr}.
|
||||
|
||||
@cindex @code{$max} math builtin, C54X
|
||||
@item @code{$max(@var{expr1},@var{expr2})}
|
||||
Returns the floating point maximum of @var{expr1} and @var{expr2}.
|
||||
|
||||
@cindex @code{$min} math builtin, C54X
|
||||
@item @code{$min(@var{expr1},@var{expr2})}
|
||||
Returns the floating point minimum of @var{expr1} and @var{expr2}.
|
||||
|
||||
@cindex @code{$pow} math builtin, C54X
|
||||
@item @code{$pow(@var{expr1},@var{expr2})}
|
||||
Returns the floating point value @var{expr1} ^ @var{expr2}.
|
||||
|
||||
@cindex @code{$round} math builtin, C54X
|
||||
@item @code{$round(@var{expr})}
|
||||
Returns the nearest integer to @var{expr} as a floating point number.
|
||||
|
||||
@cindex @code{$sgn} math builtin, C54X
|
||||
@item @code{$sgn(@var{expr})}
|
||||
Returns -1, 0, or 1 based on the sign of @var{expr}.
|
||||
|
||||
@cindex @code{$sin} math builtin, C54X
|
||||
@item @code{$sin(@var{expr})}
|
||||
Returns the floating point sine of @var{expr}.
|
||||
|
||||
@cindex @code{$sinh} math builtin, C54X
|
||||
@item @code{$sinh(@var{expr})}
|
||||
Returns the floating point hyperbolic sine of @var{expr}.
|
||||
|
||||
@cindex @code{$sqrt} math builtin, C54X
|
||||
@item @code{$sqrt(@var{expr})}
|
||||
Returns the floating point square root of @var{expr}.
|
||||
|
||||
@cindex @code{$tan} math builtin, C54X
|
||||
@item @code{$tan(@var{expr})}
|
||||
Returns the floating point tangent of @var{expr}.
|
||||
|
||||
@cindex @code{$tanh} math builtin, C54X
|
||||
@item @code{$tanh(@var{expr})}
|
||||
Returns the floating point hyperbolic tangent of @var{expr}.
|
||||
|
||||
@cindex @code{$trunc} math builtin, C54X
|
||||
@item @code{$trunc(@var{expr})}
|
||||
Returns the integer value of @var{expr} truncated towards zero as
|
||||
floating point.
|
||||
|
||||
@end table
|
||||
|
||||
@node C54X-Ext
|
||||
@section Extended Addressing
|
||||
The @code{LDX} pseudo-op is provided for loading the extended addressing bits
|
||||
of a label or address. For example, if an address @code{_label} resides
|
||||
in extended program memory, the value of @code{_label} may be loaded as
|
||||
follows:
|
||||
@smallexample @code
|
||||
ldx #_label,16,a ; loads extended bits of _label
|
||||
or #_label,a ; loads lower 16 bits of _label
|
||||
bacc a ; full address is in accumulator A
|
||||
@end smallexample
|
||||
|
||||
@node C54X-Directives
|
||||
@section Directives
|
||||
|
||||
@cindex machine directives, C54X
|
||||
@cindex C54X machine directives
|
||||
|
||||
@table @code
|
||||
|
||||
@cindex @code{align} directive, C54X
|
||||
@cindex @code{even} directive, C54X
|
||||
@item .align [@var{size}]
|
||||
@itemx .even
|
||||
Align the section program counter on the next boundary, based on
|
||||
@var{size}. @var{size} may be any power of 2. @code{.even} is
|
||||
equivalent to @code{.align} with a @var{size} of 2.
|
||||
@table @code
|
||||
@item 1
|
||||
Align SPC to word boundary
|
||||
@item 2
|
||||
Align SPC to longword boundary (same as .even)
|
||||
@item 128
|
||||
Align SPC to page boundary
|
||||
@end table
|
||||
|
||||
@cindex @code{asg} directive, C54X
|
||||
@item .asg @var{string}, @var{name}
|
||||
Assign @var{name} the string @var{string}. String replacement is
|
||||
performed on @var{string} before assignment.
|
||||
|
||||
@cindex @code{eval} directive, C54X
|
||||
@itemx .eval @var{string}, @var{name}
|
||||
Evaluate the contents of string @var{string} and assign the result as a
|
||||
string to the subsym @var{name}. String replacement is performed on
|
||||
@var{string} before assignment.
|
||||
|
||||
@cindex @code{bss} directive, C54X
|
||||
@item .bss @var{symbol}, @var{size} [, [@var{blocking_flag}] [,@var{alignment_flag}]]
|
||||
Reserve space for @var{symbol} in the .bss section. @var{size} is in
|
||||
words. If present, @var{blocking_flag} indicates the allocated space
|
||||
should be aligned on a page boundary if it would otherwise cross a page
|
||||
boundary. If present, @var{alignment_flag} causes the assembler to
|
||||
allocate @var{size} on a long word boundary.
|
||||
|
||||
@cindex @code{byte} directive, C54X
|
||||
@cindex @code{ubyte} directive, C54X
|
||||
@cindex @code{char} directive, C54X
|
||||
@cindex @code{uchar} directive, C54X
|
||||
@item .byte @var{value} [,...,@var{value_n}]
|
||||
@itemx .ubyte @var{value} [,...,@var{value_n}]
|
||||
@itemx .char @var{value} [,...,@var{value_n}]
|
||||
@itemx .uchar @var{value} [,...,@var{value_n}]
|
||||
Place one or more bytes into consecutive words of the current section.
|
||||
The upper 8 bits of each word is zero-filled. If a label is used, it
|
||||
points to the word allocated for the first byte encountered.
|
||||
|
||||
@cindex @code{clink} directive, C54X
|
||||
@item .clink ["@var{section_name}"]
|
||||
Set STYP_CLINK flag for this section, which indicates to the linker that
|
||||
if no symbols from this section are referenced, the section should not
|
||||
be included in the link. If @var{section_name} is omitted, the current
|
||||
section is used.
|
||||
|
||||
@cindex @code{c_mode} directive, C54X
|
||||
@item .c_mode
|
||||
TBD.
|
||||
|
||||
@cindex @code{copy} directive, C54X
|
||||
@item .copy "@var{filename}" | @var{filename}
|
||||
@itemx .include "@var{filename}" | @var{filename}
|
||||
Read source statements from @var{filename}. The normal include search
|
||||
path is used. Normally .copy will cause statements from the included
|
||||
file to be printed in the assembly listing and .include will not, but
|
||||
this distinction is not currently implemented.
|
||||
|
||||
@cindex @code{data} directive, C54X
|
||||
@item .data
|
||||
Begin assembling code into the .data section.
|
||||
|
||||
@cindex @code{double} directive, C54X
|
||||
@cindex @code{ldouble} directive, C54X
|
||||
@cindex @code{float} directive, C54X
|
||||
@cindex @code{xfloat} directive, C54X
|
||||
@item .double @var{value} [,...,@var{value_n}]
|
||||
@itemx .ldouble @var{value} [,...,@var{value_n}]
|
||||
@itemx .float @var{value} [,...,@var{value_n}]
|
||||
@itemx .xfloat @var{value} [,...,@var{value_n}]
|
||||
Place an IEEE single-precision floating-point representation of one or
|
||||
more floating-point values into the current section. All but
|
||||
@code{.xfloat} align the result on a longword boundary. Values are
|
||||
stored most-significant word first.
|
||||
|
||||
@cindex @code{drlist} directive, C54X
|
||||
@cindex @code{drnolist} directive, C54X
|
||||
@item .drlist
|
||||
@itemx .drnolist
|
||||
Control printing of directives to the listing file. Ignored.
|
||||
|
||||
@cindex @code{emsg} directive, C54X
|
||||
@cindex @code{mmsg} directive, C54X
|
||||
@cindex @code{wmsg} directive, C54X
|
||||
@item .emsg @var{string}
|
||||
@itemx .mmsg @var{string}
|
||||
@itemx .wmsg @var{string}
|
||||
Emit a user-defined error, message, or warning, respectively.
|
||||
|
||||
@cindex @code{far_mode} directive, C54X
|
||||
@item .far_mode
|
||||
Use extended addressing when assembling statements. This should appear
|
||||
only once per file, and is equivalent to the -mfar-mode option @pxref{C54X-Opts,,@code{-mfar-mode}}.
|
||||
|
||||
@cindex @code{fclist} directive, C54X
|
||||
@cindex @code{fcnolist} directive, C54X
|
||||
@item .fclist
|
||||
@itemx .fcnolist
|
||||
Control printing of false conditional blocks to the listing file.
|
||||
|
||||
@cindex @code{field} directive, C54X
|
||||
@item .field @var{value} [,@var{size}]
|
||||
Initialize a bitfield of @var{size} bits in the current section. If
|
||||
@var{value} is relocatable, then @var{size} must be 16. @var{size}
|
||||
defaults to 16 bits. If @var{value} does not fit into @var{size} bits,
|
||||
the value will be truncated. Successive @code{.field} directives will
|
||||
pack starting at the current word, filling the most significant bits
|
||||
first, and aligning to the start of the next word if the field size does
|
||||
not fit into the space remaining in the current word. A @code{.align}
|
||||
directive with an operand of 1 will force the next @code{.field}
|
||||
directive to begin packing into a new word. If a label is used, it
|
||||
points to the word that contains the specified field.
|
||||
|
||||
@cindex @code{global} directive, C54X
|
||||
@cindex @code{def} directive, C54X
|
||||
@cindex @code{ref} directive, C54X
|
||||
@item .global @var{symbol} [,...,@var{symbol_n}]
|
||||
@itemx .def @var{symbol} [,...,@var{symbol_n}]
|
||||
@itemx .ref @var{symbol} [,...,@var{symbol_n}]
|
||||
@code{.def} nominally identifies a symbol defined in the current file
|
||||
and availalbe to other files. @code{.ref} identifies a symbol used in
|
||||
the current file but defined elsewhere. Both map to the standard
|
||||
@code{.global} directive.
|
||||
|
||||
@cindex @code{half} directive, C54X
|
||||
@cindex @code{uhalf} directive, C54X
|
||||
@cindex @code{short} directive, C54X
|
||||
@cindex @code{ushort} directive, C54X
|
||||
@cindex @code{int} directive, C54X
|
||||
@cindex @code{uint} directive, C54X
|
||||
@cindex @code{word} directive, C54X
|
||||
@cindex @code{uword} directive, C54X
|
||||
@item .half @var{value} [,...,@var{value_n}]
|
||||
@itemx .uhalf @var{value} [,...,@var{value_n}]
|
||||
@itemx .short @var{value} [,...,@var{value_n}]
|
||||
@itemx .ushort @var{value} [,...,@var{value_n}]
|
||||
@itemx .int @var{value} [,...,@var{value_n}]
|
||||
@itemx .uint @var{value} [,...,@var{value_n}]
|
||||
@itemx .word @var{value} [,...,@var{value_n}]
|
||||
@itemx .uword @var{value} [,...,@var{value_n}]
|
||||
Place one or more values into consecutive words of the current section.
|
||||
If a label is used, it points to the word allocated for the first value
|
||||
encountered.
|
||||
|
||||
@cindex @code{label} directive, C54X
|
||||
@item .label @var{symbol}
|
||||
Define a special @var{symbol} to refer to the load time address of the
|
||||
current section program counter.
|
||||
|
||||
@cindex @code{length} directive, C54X
|
||||
@cindex @code{width} directive, C54X
|
||||
@item .length
|
||||
@itemx .width
|
||||
Set the page length and width of the output listing file. Ignored.
|
||||
|
||||
@cindex @code{list} directive, C54X
|
||||
@cindex @code{nolist} directive, C54X
|
||||
@item .list
|
||||
@itemx .nolist
|
||||
Control whether the source listing is printed. Ignored.
|
||||
|
||||
@cindex @code{long} directive, C54X
|
||||
@cindex @code{ulong} directive, C54X
|
||||
@cindex @code{xlong} directive, C54X
|
||||
@item .long @var{value} [,...,@var{value_n}]
|
||||
@itemx .ulong @var{value} [,...,@var{value_n}]
|
||||
@itemx .xlong @var{value} [,...,@var{value_n}]
|
||||
Place one or more 32-bit values into consecutive words in the current
|
||||
section. The most significant word is stored first. @code{.long} and
|
||||
@code{.ulong} align the result on a longword boundary; @code{xlong} does
|
||||
not.
|
||||
|
||||
@cindex @code{loop} directive, C54X
|
||||
@cindex @code{break} directive, C54X
|
||||
@cindex @code{endloop} directive, C54X
|
||||
@item .loop [@var{count}]
|
||||
@itemx .break [@var{condition}]
|
||||
@itemx .endloop
|
||||
Repeatedly assemble a block of code. @code{.loop} begins the block, and
|
||||
@code{.endloop} marks its termination. @var{count} defaults to 1024,
|
||||
and indicates the number of times the block should be repeated.
|
||||
@code{.break} terminates the loop so that assembly begins after the
|
||||
@code{.endloop} directive. The optional @var{condition} will cause the
|
||||
loop to terminate only if it evaluates to zero.
|
||||
|
||||
@cindex @code{macro} directive, C54X
|
||||
@cindex @code{endm} directive, C54X
|
||||
@item @var{macro_name} .macro [@var{param1}][,...@var{param_n}]
|
||||
@itemx [.mexit]
|
||||
@itemx .endm
|
||||
See the section on macros for more explanation (@xref{C54X-Macros}.
|
||||
|
||||
@cindex @code{mlib} directive, C54X
|
||||
@item .mlib "@var{filename}" | @var{filename}
|
||||
Load the macro library @var{filename}. @var{filename} must be an
|
||||
archived library (BFD ar-compatible) of text files, expected to contain
|
||||
only macro definitions. The standard include search path is used.
|
||||
|
||||
@cindex @code{mlist} directive, C54X
|
||||
@cindex @code{mnolist} directive, C54X
|
||||
@item .mlist
|
||||
@item .mnolist
|
||||
Control whether to include macro and loop block expansions in the
|
||||
listing output. Ignored.
|
||||
|
||||
@cindex @code{mmregs} directive, C54X
|
||||
@item .mmregs
|
||||
Define global symbolic names for the 'c54x registers. Supposedly
|
||||
equivalent to executing @code{.set} directives for each register with
|
||||
its memory-mapped value, but in reality is provided only for
|
||||
compatibility and does nothing.
|
||||
|
||||
@cindex @code{newblock} directive, C54X
|
||||
@item .newblock
|
||||
This directive resets any C54X local labels currently defined. Normal
|
||||
@code{@value{AS}} local labels are unaffected.
|
||||
|
||||
@cindex @code{option} directive, C54X
|
||||
@item .option @var{option_list}
|
||||
Set listing options. Ignored.
|
||||
|
||||
@cindex @code{sblock} directive, C54X
|
||||
@item .sblock "@var{section_name}" | @var{section_name} [,"@var{name_n}" | @var{name_n}]
|
||||
Designate @var{section_name} for blocking. Blocking guarantees that a
|
||||
section will start on a page boundary (128 words) if it would otherwise
|
||||
cross a page boundary. Only initialized sections may be designated with
|
||||
this directive. See also @xref{C54X-Block}.
|
||||
|
||||
@cindex @code{sect} directive, C54X
|
||||
@item .sect "@var{section_name}"
|
||||
Define a named initialized section and make it the current section.
|
||||
|
||||
@cindex @code{set} directive, C54X
|
||||
@cindex @code{equ} directive, C54X
|
||||
@item @var{symbol} .set "@var{value}"
|
||||
@itemx @var{symbol} .equ "@var{value}"
|
||||
Equate a constant @var{value} to a @var{symbol}, which is placed in the
|
||||
symbol table. @var{symbol} may not be previously defined.
|
||||
|
||||
@cindex @code{space} directive, C54X
|
||||
@cindex @code{bes} directive, C54X
|
||||
@item .space @var{size_in_bits}
|
||||
@itemx .bes @var{size_in_bits}
|
||||
Reserve the given number of bits in the current section and zero-fill
|
||||
them. If a label is used with @code{.space}, it points to the
|
||||
@strong{first} word reserved. With @code{.bes}, the label points to the
|
||||
@strong{last} word reserved.
|
||||
|
||||
@cindex @code{sslist} directive, C54X
|
||||
@cindex @code{ssnolist} directive, C54X
|
||||
@item .sslist
|
||||
@itemx .ssnolist
|
||||
Controls the inclusion of subsym replacement in the listing output. Ignored.
|
||||
|
||||
@cindex @code{string} directive, C54X
|
||||
@cindex @code{pstring} directive, C54X
|
||||
@item .string "@var{string}" [,...,"@var{string_n}"]
|
||||
@itemx .pstring "@var{string}" [,...,"@var{string_n}"]
|
||||
Place 8-bit characters from @var{string} into the current section.
|
||||
@code{.string} zero-fills the upper 8 bits of each word, while
|
||||
@code{.pstring} puts two characters into each word, filling the
|
||||
most-significant bits first. Unused space is zero-filled. If a label
|
||||
is used, it points to the first word initialized.
|
||||
|
||||
@cindex @code{struct} directive, C54X
|
||||
@cindex @code{tag} directive, C54X
|
||||
@cindex @code{endstruct} directive, C54X
|
||||
@item [@var{stag}] .struct [@var{offset}]
|
||||
@itemx [@var{name_1}] element [@var{count_1}]
|
||||
@itemx [@var{name_2}] element [@var{count_2}]
|
||||
@itemx [@var{tname}] .tag @var{stagx} [@var{tcount}]
|
||||
@itemx ...
|
||||
@itemx [@var{name_n}] element [@var{count_n}]
|
||||
@itemx [@var{ssize}] .endstruct
|
||||
@itemx @var{label} .tag [@var{stag}]
|
||||
Assign symbolic offsets to the elements of a structure. @var{stag}
|
||||
defines a symbol to use to reference the structure. @var{offset}
|
||||
indicates a starting value to use for the first element encountered;
|
||||
otherwise it defaults to zero. Each element can have a named offset,
|
||||
@var{name}, which is a symbol assigned the value of the element's offset
|
||||
into the structure. If @var{stag} is missing, these become global
|
||||
symbols. @var{count} adjusts the offset that many times, as if
|
||||
@code{element} were an array. @code{element} may be one of
|
||||
@code{.byte}, @code{.word}, @code{.long}, @code{.float}, or any
|
||||
equivalent of those, and the structure offset is adjusted accordingly.
|
||||
@code{.field} and @code{.string} are also allowed; the size of
|
||||
@code{.field} is one bit, and @code{.string} is considered to be one
|
||||
word in size. Only element descriptors, structure/union tags,
|
||||
@code{.align} and conditioanl assembly directies are allowed within
|
||||
@code{.struct}/@code{.endstruct}. @code{.align} aligns member offsets
|
||||
to word boundaries only. @var{ssize}, if provided, will always be
|
||||
assigned the size of the structure.
|
||||
|
||||
The @code{.tag} directive, in addition to being used to define a
|
||||
structure/union element within a structure, may be used to apply a
|
||||
structure to a symbol. Once applied to @var{label}, the individual
|
||||
structure elements may be applied to @var{label} to produce the desired
|
||||
offsets using @var{label} as the structure base.
|
||||
|
||||
@cindex @code{tab} directive, C54X
|
||||
@item .tab
|
||||
Set the tab size in the output listing. Ignored.
|
||||
|
||||
@cindex @code{union} directive, C54X
|
||||
@cindex @code{tag} directive, C54X
|
||||
@cindex @code{endunion} directive, C54X
|
||||
@item [@var{utag}] .union
|
||||
@itemx [@var{name_1}] element [@var{count_1}]
|
||||
@itemx [@var{name_2}] element [@var{count_2}]
|
||||
@itemx [@var{tname}] .tag @var{utagx}[,@var{tcount}]
|
||||
@itemx ...
|
||||
@itemx [@var{name_n}] element [@var{count_n}]
|
||||
@itemx [@var{usize}] .endstruct
|
||||
@itemx @var{label} .tag [@var{utag}]
|
||||
Similar to @code{.struct}, but the offset after each element is reset to
|
||||
zero, and the @var{usize} is set to the maximum of all defined elements.
|
||||
Starting offset for the union is always zero.
|
||||
|
||||
@cindex @code{usect} directive, C54X
|
||||
@item [@var{symbol}] .usect "@var{section_name}", @var{size}, [,[@var{blocking_flag}] [,@var{alignment_flag}]]
|
||||
Reserve space for variables in a named, uninitialzed section (similar to
|
||||
.bss). @code{.usect} allows definitions sections independent of .bss.
|
||||
@var{symbol} points to the first location reserved by this allocation.
|
||||
The symbol may be used as a variable name. @var{size} is the allocated
|
||||
size in words. @var{blocking_flag} indicates whether to block this
|
||||
section on a page boundary (128 words) (@pxref{C54X-Block}).
|
||||
@var{alignment flag} indicates whether the section should be
|
||||
longword-aligned.
|
||||
|
||||
@cindex @code{var} directive, C54X
|
||||
@item .var @var{sym}[,..., @var{sym_n}]
|
||||
Define a subsym to be a local variable within a macro. See
|
||||
@xref{C54X-Macros}.
|
||||
|
||||
@cindex @code{version} directive, C54X
|
||||
@item .version @var{version}
|
||||
Set which processor to build instructions for. Though the following
|
||||
values are accepted, the op is ignored.
|
||||
@table @code
|
||||
@item 541
|
||||
@itemx 542
|
||||
@itemx 543
|
||||
@itemx 545
|
||||
@itemx 545LP
|
||||
@itemx 546LP
|
||||
@itemx 548
|
||||
@itemx 549
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@node C54X-Macros
|
||||
@section Macros
|
||||
|
||||
@cindex C54X-specific macros
|
||||
@cindex macros, C54X
|
||||
Macros do not require explicit dereferencing of arguments (i.e. \ARG).
|
||||
|
||||
During macro expansion, the macro parameters are converted to subsyms.
|
||||
If the number of arguments passed the macro invocation exceeds the
|
||||
number of parameters defined, the last parameter is assigned the string
|
||||
equivalent of all remaining arguments. If fewer arguments are given
|
||||
than parameters, the missing parameters are assigned empty strings. To
|
||||
include a comma in an argument, you must enclose the agument in quotes.
|
||||
|
||||
@cindex subsym builtins, C54X
|
||||
@cindex C54X subsym builtins
|
||||
@cindex builtin subsym functions, C54X
|
||||
The following built-in subsym functions allow examination of the string
|
||||
value of subsyms (or ordinary strings). The arguments are strings
|
||||
unless otherwise indicated (subsyms passed as args will be replaced by
|
||||
the strings they represent).
|
||||
@table @code
|
||||
@cindex @code{$symlen} subsym builtin, C54X
|
||||
@item @code{$symlen(@var{str})}
|
||||
Returns the length of @var{str}.
|
||||
|
||||
@cindex @code{$symcmp} subsym builtin, C54X
|
||||
@item @code{$symcmp(@var{str1},@var{str2})}
|
||||
Returns 0 if @var{str1} == @var{str2}, non-zero otherwise.
|
||||
|
||||
@cindex @code{$firstch} subsym builtin, C54X
|
||||
@item @code{$firstch(@var{str},@var{ch})}
|
||||
Returns index of the first occurrence of character constant @var{ch} in
|
||||
@var{str}.
|
||||
|
||||
@cindex @code{$lastch} subsym builtin, C54X
|
||||
@item @code{$lastch(@var{str},@var{ch})}
|
||||
Returns index of the last occurrence of character constant @var{ch} in
|
||||
@var{str}.
|
||||
|
||||
@cindex @code{$isdefed} subsym builtin, C54X
|
||||
@item @code{$isdefed(@var{symbol})}
|
||||
Returns zero if the symbol @var{symbol} is not in the symbol table,
|
||||
non-zero otherwise.
|
||||
|
||||
@cindex @code{$ismember} subsym builtin, C54X
|
||||
@item @code{$ismember(@var{symbol},@var{list})}
|
||||
Assign the first member of comma-separated string @var{list} to
|
||||
@var{symbol}; @var{list} is reassigned the remainder of the list. Returns
|
||||
zero if @var{list} is a null string. Both arguments must be subsyms.
|
||||
|
||||
@cindex @code{$iscons} subsym builtin, C54X
|
||||
@item @code{$iscons(@var{expr})}
|
||||
Returns 1 if string @var{expr} is binary, 2 if octal, 3 if hexadecimal,
|
||||
4 if a character, 5 if decimal, and zero if not an integer.
|
||||
|
||||
@cindex @code{$isname} subsym builtin, C54X
|
||||
@item @code{$isname(@var{name})}
|
||||
Returns 1 if @var{name} is a valid symbol name, zero otherwise.
|
||||
|
||||
@cindex @code{$isreg} subsym builtin, C54X
|
||||
@item @code{$isreg(@var{reg})}
|
||||
Returns 1 if @var{reg} is a valid predefined register name (AR0-AR7 only).
|
||||
|
||||
@cindex @code{$structsz} subsym builtin, C54X
|
||||
@item @code{$structsz(@var{stag})}
|
||||
Returns the size of the structure or union represented by @var{stag}.
|
||||
|
||||
@cindex @code{$structacc} subsym builtin, C54X
|
||||
@item @code{$structacc(@var{stag})}
|
||||
Returns the reference point of the structure or union represented by
|
||||
@var{stag}. Always returns zero.
|
||||
|
||||
@end table
|
||||
|
||||
@node C54X-MMRegs
|
||||
@section Memory-mapped Registers
|
||||
|
||||
@cindex C54X memory-mapped registers
|
||||
@cindex registers, C54X memory-mapped
|
||||
@cindex memory-mapped registers, C54X
|
||||
The following symbols are recognized as memory-mapped registers:
|
||||
|
||||
@table @code
|
||||
@end table
|
|
@ -991,6 +991,7 @@ If you define this macro, GAS will assume that any text at the start of a line
|
|||
is a label, even if it does not have a colon.
|
||||
|
||||
@item TC_START_LABEL
|
||||
@itemx TC_START_LABEL_WITHOUT_COLON
|
||||
@cindex TC_START_LABEL
|
||||
You may define this macro to control what GAS considers to be a label. The
|
||||
default definition is to accept any name followed by a colon character.
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
2000-06-19 Timothy Wall <twall@cygnus.com>
|
||||
|
||||
* gas/macros/macros.exp: Avoid tests which are not useful on tic54x.
|
||||
* gas/all/gas.exp: Make adjustments for tic54x target.
|
||||
* gas/ieee-fp/x930509a.exp: Ditto.
|
||||
* gas/tic54x/*: New tests for tic54x. NOTE: load page has been
|
||||
moved into the LMA and is not printed separately by objdump any
|
||||
longer. This still needs to be tested.
|
||||
|
||||
2000-06-18 Stephane Carrez <stcarrez@worldnet.fr>
|
||||
|
||||
* gas/m68k/all.exp: Don't execute tests if the target is m68hc11&12.
|
||||
|
|
|
@ -11,7 +11,12 @@ gas_test "p2425.s" "" "" "pcrel values in assignment"
|
|||
# Therefore this test (as it is currently written) is completely bogus
|
||||
# for any PA target. Do not bother trying to run it and just claim
|
||||
# it fails.
|
||||
if [istarget hppa*-*-*] then {
|
||||
#
|
||||
# The C54x uses ".space" to allocate bits, and requires absolute expressions;
|
||||
# The ".space" directive is taken care of in the C54x-specific tests, so fail
|
||||
# here
|
||||
#
|
||||
if { [istarget hppa*-*-*] || [istarget *c54x*-*-*] } then {
|
||||
setup_xfail *-*-*
|
||||
fail "simplifiable double subtraction"
|
||||
} else {
|
||||
|
@ -79,7 +84,9 @@ proc do_930509a {} {
|
|||
|
||||
# This test is meaningless for the PA; the difference of two symbols
|
||||
# must not be resolved by the assembler.
|
||||
if ![istarget hppa*-*-*] then {
|
||||
# C54x assembler (for compatibility) does not allow differences between
|
||||
# forward references
|
||||
if { ![istarget hppa*-*-*] && ![istarget *c54x*-*-*] } then {
|
||||
# the vax fails because VMS can apparently actually handle this
|
||||
# case in relocs, so gas doesn't handle it itself.
|
||||
setup_xfail "vax*-*-vms*"
|
||||
|
@ -88,8 +95,11 @@ if ![istarget hppa*-*-*] then {
|
|||
do_930509a
|
||||
}
|
||||
|
||||
# ".struct" and ".align" have different meanings on c54x
|
||||
# These directives are done in the c54x-specific tests instead
|
||||
case $target_triplet in {
|
||||
{ hppa*-*-* } { }
|
||||
{ *c54x*-*-* } { }
|
||||
default {
|
||||
run_dump_test struct
|
||||
run_dump_test align
|
||||
|
@ -100,7 +110,8 @@ case $target_triplet in {
|
|||
# We omit m88k COFF because it uses weird pseudo-op names.
|
||||
# We omit the ARM toolchains because they define locals to
|
||||
# start with '.', which eliminates .eos, .text etc from the output.
|
||||
if { ([istarget *-*-coff*] && ![istarget m88*-*-*] && ![istarget *arm*-*-coff] && ![istarget thumb*-*-coff]) \
|
||||
# Omit c54x, since .tag and .def mean something different on that target
|
||||
if { ([istarget *-*-coff*] && ![istarget m88*-*-*] && ![istarget *arm*-*-coff] && ![istarget thumb*-*-coff] && ![istarget *c54x*-*-coff]) \
|
||||
||([istarget *-*-pe*] && ![istarget arm*-*-pe*] && ![istarget thumb*-*-pe*]) \
|
||||
|| [istarget a29k-*-udi*] \
|
||||
|| [istarget a29k-*-ebmon*] \
|
||||
|
@ -137,7 +148,10 @@ proc test_cond {} {
|
|||
}
|
||||
}
|
||||
|
||||
test_cond
|
||||
# again, p2align doesn't work on c54x target
|
||||
if ![istarget *c54x*-*-*] then {
|
||||
test_cond
|
||||
}
|
||||
|
||||
# FIXME: this is here cause of a bug in DejaGnu 1.1.1. When it is no longer
|
||||
# in use, then this can be removed.
|
||||
|
|
|
@ -4,18 +4,23 @@ if ![istarget hppa*-*-*] {
|
|||
run_dump_test test1
|
||||
}
|
||||
|
||||
run_dump_test test2
|
||||
if ![istarget *c54x*-*-*] {
|
||||
run_dump_test test2
|
||||
}
|
||||
|
||||
run_dump_test test3
|
||||
|
||||
run_dump_test irp
|
||||
if ![istarget *c54x*-*-*] {
|
||||
run_dump_test irp
|
||||
run_dump_test rept
|
||||
}
|
||||
|
||||
run_dump_test rept
|
||||
|
||||
gas_test_error "err.s" "" "macro infinite recursion"
|
||||
|
||||
case $target_triplet in {
|
||||
{ hppa*-*-* } { }
|
||||
{ *c54x*-*-* } { }
|
||||
default {
|
||||
run_dump_test semi
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
#objdump: -d
|
||||
#name: c54x addressing modes
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <_addressing>:
|
||||
0: 1801.*
|
||||
1: 1881.*
|
||||
2: 1989.*
|
||||
3: 1891.*
|
||||
4: 8199.*
|
||||
5: 18a1.*
|
||||
6: 19a9.*
|
||||
7: 18b1.*
|
||||
8: 19b9.*
|
||||
9: 18c1.*
|
||||
a: 19c9.*
|
||||
b: 18d1.*
|
||||
c: 19d9.*
|
||||
d: 18e1.*
|
||||
e: 8000.*
|
||||
f: 19e9.*
|
||||
10: 0001.*
|
||||
11: 18f1.*
|
||||
12: 0001.*
|
||||
13: 19f8.*
|
||||
14: ffff.*
|
|
@ -0,0 +1,24 @@
|
|||
;; test all addressing permutations
|
||||
.text
|
||||
_addressing:
|
||||
and Y,a ; direct
|
||||
and *ar1,a ; indirect (all modes)
|
||||
and *ar1-,b
|
||||
and *ar1+,a
|
||||
stl b,*+ar1
|
||||
and *ar1-0b,a
|
||||
and *ar1-0,b
|
||||
and *ar1+0,a
|
||||
and *ar1+0b,b
|
||||
and *ar1-%,a
|
||||
and *ar1-0%,b
|
||||
and *ar1+%,a
|
||||
and *ar1+0%,b
|
||||
and *ar1(32768),a
|
||||
and *+ar1(X+1),b
|
||||
and *+ar1(Y)%,a
|
||||
and *(65535),b
|
||||
.data
|
||||
X: .word 0
|
||||
Y: .word 1
|
||||
.end
|
|
@ -0,0 +1,31 @@
|
|||
#as: -mcpu=548 -mfar-mode
|
||||
#objdump: -d
|
||||
#name: c54x addressing modes, w/extended addressing (far mode)
|
||||
#source: address.s
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <_addressing>:
|
||||
0: 1801.*
|
||||
1: 1881.*
|
||||
2: 1989.*
|
||||
3: 1891.*
|
||||
4: 8199.*
|
||||
5: 18a1.*
|
||||
6: 19a9.*
|
||||
7: 18b1.*
|
||||
8: 19b9.*
|
||||
9: 18c1.*
|
||||
a: 19c9.*
|
||||
b: 18d1.*
|
||||
c: 19d9.*
|
||||
d: 18e1.*
|
||||
e: 8000.*
|
||||
f: 19e9.*
|
||||
10: 0001.*
|
||||
11: 18f1.*
|
||||
12: 0001.*
|
||||
13: 19f8.*
|
||||
14: ffff.*
|
|
@ -0,0 +1,56 @@
|
|||
#objdump: -d --headers
|
||||
#name: c54x align (NOTE: .even is broken on TI tools)
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .text 00000089 00000000 00000000 0000.... 2..7
|
||||
CONTENTS, ALLOC, LOAD, CODE
|
||||
1 .data 00000005 00000000 00000000 0000.... 2..1
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
2 .bss 00000000 00000000 00000000 0000.... 2..0
|
||||
ALLOC
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: 4160.*
|
||||
1: 0001.*
|
||||
2: 0002.*
|
||||
...
|
||||
|
||||
00000004 <even>:
|
||||
4: 0003.*
|
||||
...
|
||||
|
||||
00000006 <align2>:
|
||||
6: 0061.*
|
||||
7: 0062.*
|
||||
8: 0063.*
|
||||
9: 0064.*
|
||||
a: 0065.*
|
||||
...
|
||||
|
||||
00000010 <align8>:
|
||||
10: 0008.*
|
||||
11: 0000.*
|
||||
12: 0001.*
|
||||
13: 0002.*
|
||||
14: 0003.*
|
||||
15: 0004.*
|
||||
16: 0005.*
|
||||
17: 0006.*
|
||||
18: 0007.*
|
||||
...
|
||||
|
||||
00000080 <align128>:
|
||||
80: 0004.*
|
||||
81: 0000.*
|
||||
82: 0001.*
|
||||
83: 0002.*
|
||||
84: 0003.*
|
||||
85: 0004.*
|
||||
86: 0005.*
|
||||
87: 0006.*
|
||||
88: 0007.*
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
* alignment directives
|
||||
* .even == .align 1, .even 2 == longword boundary
|
||||
* .align [size] ; size is number of words (value must be a power of 2)
|
||||
.global even, align2, align8, align128
|
||||
.field 2, 3
|
||||
.field 11, 8
|
||||
.word 0x1, 0x2
|
||||
.even
|
||||
even .word 0x3
|
||||
.align 2
|
||||
align2 .string "abcde"
|
||||
.align 8
|
||||
align8 .word 8
|
||||
.word 0,1,2,3,4,5,6,7
|
||||
.align
|
||||
align128 .byte 4
|
||||
.word 0,1,2,3,4,5,6,7
|
||||
.data
|
||||
.field 2, 3
|
||||
.field 11, 8
|
||||
.word 0x1, 0x2
|
||||
.even
|
||||
.word 0x3
|
||||
.end
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,131 @@
|
|||
#objdump: -d
|
||||
#name: c54x subsym assignment/use
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <L1>:
|
||||
0: f000.*
|
||||
1: 0064.*
|
||||
|
||||
00000002 <L2>:
|
||||
2: 1090.*
|
||||
|
||||
00000003 <L3>:
|
||||
3: 1090.*
|
||||
|
||||
00000004 <newlabel>:
|
||||
4: f000.*
|
||||
5: 0000.*
|
||||
6: f000.*
|
||||
7: 0001.*
|
||||
8: 0001.*
|
||||
9: 0002.*
|
||||
a: 0003.*
|
||||
b: 0004.*
|
||||
c: 0005.*
|
||||
d: 0000.*
|
||||
e: 0001.*
|
||||
f: 0002.*
|
||||
10: 0003.*
|
||||
11: 0004.*
|
||||
12: 0005.*
|
||||
13: 0006.*
|
||||
14: 0007.*
|
||||
15: 0008.*
|
||||
16: 0009.*
|
||||
17: 000a.*
|
||||
18: 000b.*
|
||||
19: 000c.*
|
||||
1a: 000d.*
|
||||
1b: 000e.*
|
||||
1c: 000f.*
|
||||
1d: 0010.*
|
||||
1e: 0011.*
|
||||
1f: 0012.*
|
||||
20: 0013.*
|
||||
21: 0014.*
|
||||
22: 0015.*
|
||||
23: 0016.*
|
||||
24: 0017.*
|
||||
25: 0018.*
|
||||
26: 0019.*
|
||||
27: 001a.*
|
||||
28: 001b.*
|
||||
29: 001c.*
|
||||
2a: 001d.*
|
||||
2b: 001e.*
|
||||
2c: 001f.*
|
||||
2d: 0020.*
|
||||
2e: 0021.*
|
||||
2f: 0022.*
|
||||
30: 0023.*
|
||||
31: 0024.*
|
||||
32: 0025.*
|
||||
33: 0026.*
|
||||
34: 0027.*
|
||||
35: 0028.*
|
||||
36: 0029.*
|
||||
37: 002a.*
|
||||
38: 002b.*
|
||||
39: 002c.*
|
||||
3a: 002d.*
|
||||
3b: 002e.*
|
||||
3c: 002f.*
|
||||
3d: 0030.*
|
||||
3e: 0031.*
|
||||
3f: 0032.*
|
||||
40: 0033.*
|
||||
41: 0034.*
|
||||
42: 0035.*
|
||||
43: 0036.*
|
||||
44: 0037.*
|
||||
45: 0038.*
|
||||
46: 0039.*
|
||||
47: 003a.*
|
||||
48: 003b.*
|
||||
49: 003c.*
|
||||
4a: 003d.*
|
||||
4b: 003e.*
|
||||
4c: 003f.*
|
||||
4d: 0040.*
|
||||
4e: 0041.*
|
||||
4f: 0042.*
|
||||
50: 0043.*
|
||||
51: 0044.*
|
||||
52: 0045.*
|
||||
53: 0046.*
|
||||
54: 0047.*
|
||||
55: 0048.*
|
||||
56: 0049.*
|
||||
57: 004a.*
|
||||
58: 004b.*
|
||||
59: 004c.*
|
||||
5a: 004d.*
|
||||
5b: 004e.*
|
||||
5c: 004f.*
|
||||
5d: 0050.*
|
||||
5e: 0051.*
|
||||
5f: 0052.*
|
||||
60: 0053.*
|
||||
61: 0054.*
|
||||
62: 0055.*
|
||||
63: 0056.*
|
||||
64: 0057.*
|
||||
65: 0058.*
|
||||
66: 0059.*
|
||||
67: 005a.*
|
||||
68: 005b.*
|
||||
69: 005c.*
|
||||
6a: 005d.*
|
||||
6b: 005e.*
|
||||
6c: 005f.*
|
||||
6d: 0060.*
|
||||
6e: 0061.*
|
||||
6f: 0062.*
|
||||
70: 0063.*
|
||||
71: 0064.*
|
||||
|
||||
00000072 <end>:
|
||||
72: 0100.*
|
|
@ -0,0 +1,39 @@
|
|||
* asg/eval test substitution symbols
|
||||
* .eval value, symbol
|
||||
* .asg "string", symbol
|
||||
* .asg string, symbol
|
||||
.global L1,L2,L3,newlabel,end
|
||||
.sslist ; list line substitutions
|
||||
.text
|
||||
.asg *ar0+, INC ; replace a complete operand
|
||||
.asg ar0, FP ; replace a sub-operand
|
||||
.asg "add #1,a", doit ; macro-style
|
||||
.asg newlabel, LABEL ; replace a label
|
||||
.asg .word 0, PSEUDO ; replace with a directive
|
||||
|
||||
L1: add #100,a
|
||||
L2: ld *FP+,a
|
||||
L3: ld INC,a
|
||||
.asg 0,L2
|
||||
LABEL: add #L2,a
|
||||
doit
|
||||
.asg 0, x
|
||||
.loop 5
|
||||
.eval x+1,x
|
||||
.word x
|
||||
.endloop
|
||||
PSEUDO
|
||||
|
||||
* Tests from 5.3.2
|
||||
.asg AR0,FP
|
||||
.asg *AR1+,Ind
|
||||
.asg *AR1+0b,Rc_Prop
|
||||
.asg "string",strng ; NOTE: """string""" not supported
|
||||
.asg "a,b,c",parms
|
||||
.asg 1,counter
|
||||
.loop 100
|
||||
.word counter
|
||||
.eval counter + 1, counter
|
||||
.endloop
|
||||
end: .word 0x100
|
||||
.end
|
|
@ -0,0 +1,103 @@
|
|||
#objdump: -d
|
||||
#name: c54x cons tests
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <binary>:
|
||||
0: 0003.*
|
||||
1: 0004.*
|
||||
|
||||
00000002 <octal>:
|
||||
2: 0009.*
|
||||
3: 000a.*
|
||||
4: 000b.*
|
||||
|
||||
00000005 <hex>:
|
||||
5: 000f.*
|
||||
6: 0010.*
|
||||
|
||||
00000007 <field>:
|
||||
7: 6440.*
|
||||
8: 0123.*
|
||||
9: 4000.*
|
||||
a: 0000.*
|
||||
b: 1234.*
|
||||
|
||||
0000000c <byte>:
|
||||
c: 00aa.*
|
||||
d: 00bb.*
|
||||
|
||||
0000000e <word>:
|
||||
e: 0ccc.*
|
||||
|
||||
0000000f <xlong>:
|
||||
f: 0eee.*
|
||||
10: efff.*
|
||||
...
|
||||
|
||||
00000012 <long>:
|
||||
12: eeee.*
|
||||
13: ffff.*
|
||||
|
||||
00000014 <int>:
|
||||
14: dddd.*
|
||||
|
||||
00000015 <xfloat>:
|
||||
15: 3fff.*
|
||||
16: ffac.*
|
||||
...
|
||||
|
||||
00000018 <float>:
|
||||
18: 3fff.*
|
||||
19: ffac.*
|
||||
|
||||
0000001a <string>:
|
||||
1a: 0061.*
|
||||
1b: 0062.*
|
||||
1c: 0063.*
|
||||
1d: 0064.*
|
||||
1e: 0061.*
|
||||
1f: 0062.*
|
||||
20: 0063.*
|
||||
21: 0064.*
|
||||
22: 0065.*
|
||||
23: 0066.*
|
||||
24: 0067.*
|
||||
25: 0030.*
|
||||
|
||||
00000026 <pstring>:
|
||||
26: 6162.*
|
||||
27: 6364.*
|
||||
28: 6162.*
|
||||
29: 6364.*
|
||||
2a: 6566.*
|
||||
2b: 6700.*
|
||||
|
||||
0000002c <DAT1>:
|
||||
2c: 0000.*
|
||||
2d: abcd.*
|
||||
2e: 0000.*
|
||||
2f: 0141.*
|
||||
30: 0000.*
|
||||
31: 0067.*
|
||||
32: 0000.*
|
||||
33: 006f.*
|
||||
|
||||
00000034 <xlong.0>:
|
||||
34: 0000.*
|
||||
35: 002c.*
|
||||
36: aabb.*
|
||||
37: ccdd.*
|
||||
|
||||
00000038 <DAT2>:
|
||||
38: 0000.*
|
||||
...
|
||||
|
||||
0000003a <DAT3>:
|
||||
3a: 1234.*
|
||||
3b: 5678.*
|
||||
3c: 0000.*
|
||||
3d: aabb.*
|
||||
3e: ccdd.*
|
|
@ -0,0 +1,38 @@
|
|||
*
|
||||
* Constants initialization
|
||||
* See also long.s, space.s, field.s
|
||||
*
|
||||
.global binary, octal, hex, field
|
||||
binary: .word 11b, 0100B
|
||||
octal: .word 011q, 12q, 013Q
|
||||
hex: .word 0Fh, 10H
|
||||
field: .field 3, 3
|
||||
.field 8, 6
|
||||
.field 16, 5
|
||||
.field 01234h,20
|
||||
.field 01234h,32
|
||||
.global byte, word, xlong, long, int
|
||||
byte: .byte 0AAh, 0BBh
|
||||
word: .word 0CCCh
|
||||
xlong: .xlong 0EEEEFFFh
|
||||
long: .long 0EEEEFFFFh
|
||||
int: .int 0DDDDh
|
||||
.global xfloat, float
|
||||
xfloat: .xfloat 1.99999
|
||||
float: .float 1.99999
|
||||
.global string, pstring
|
||||
string .string "abcd"
|
||||
.string "abc","defg"
|
||||
.string 36 + 12
|
||||
pstring .pstring "abcd"
|
||||
.pstring "abc","defg"
|
||||
|
||||
.global DAT1, DAT2, DAT3, DAT4
|
||||
DAT1: .long 0ABCDh, 'A' + 100h, 'g', 'o'
|
||||
xlong?: .xlong DAT1, 0AABBCCDDh
|
||||
DAT2: .word 0
|
||||
DAT3: .long 012345678h
|
||||
.word 0
|
||||
.xlong 0AABBCCDDh
|
||||
DAT4:
|
||||
.end
|
|
@ -0,0 +1,106 @@
|
|||
#as: -mcpu=548 -mfar-mode
|
||||
#objdump: -d -r
|
||||
#name: c54x cons tests, w/extended addressing
|
||||
#source: cons.s
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <binary>:
|
||||
0: 0003.*
|
||||
1: 0004.*
|
||||
|
||||
00000002 <octal>:
|
||||
2: 0009.*
|
||||
3: 000a.*
|
||||
4: 000b.*
|
||||
|
||||
00000005 <hex>:
|
||||
5: 000f.*
|
||||
6: 0010.*
|
||||
|
||||
00000007 <field>:
|
||||
7: 6440.*
|
||||
8: 0123.*
|
||||
9: 4000.*
|
||||
a: 0000.*
|
||||
b: 1234.*
|
||||
|
||||
0000000c <byte>:
|
||||
c: 00aa.*
|
||||
d: 00bb.*
|
||||
|
||||
0000000e <word>:
|
||||
e: 0ccc.*
|
||||
|
||||
0000000f <xlong>:
|
||||
f: 0eee.*
|
||||
10: efff.*
|
||||
...
|
||||
|
||||
00000012 <long>:
|
||||
12: eeee.*
|
||||
13: ffff.*
|
||||
|
||||
00000014 <int>:
|
||||
14: dddd.*
|
||||
|
||||
00000015 <xfloat>:
|
||||
15: 3fff.*
|
||||
16: ffac.*
|
||||
...
|
||||
|
||||
00000018 <float>:
|
||||
18: 3fff.*
|
||||
19: ffac.*
|
||||
|
||||
0000001a <string>:
|
||||
1a: 0061.*
|
||||
1b: 0062.*
|
||||
1c: 0063.*
|
||||
1d: 0064.*
|
||||
1e: 0061.*
|
||||
1f: 0062.*
|
||||
20: 0063.*
|
||||
21: 0064.*
|
||||
22: 0065.*
|
||||
23: 0066.*
|
||||
24: 0067.*
|
||||
25: 0030.*
|
||||
|
||||
00000026 <pstring>:
|
||||
26: 6162.*
|
||||
27: 6364.*
|
||||
28: 6162.*
|
||||
29: 6364.*
|
||||
2a: 6566.*
|
||||
2b: 6700.*
|
||||
|
||||
0000002c <DAT1>:
|
||||
2c: 0000.*
|
||||
2d: abcd.*
|
||||
2e: 0000.*
|
||||
2f: 0141.*
|
||||
30: 0000.*
|
||||
31: 0067.*
|
||||
32: 0000.*
|
||||
33: 006f.*
|
||||
|
||||
00000034 <xlong.0>:
|
||||
34: 0000.*
|
||||
.*34: ARELEXT.*
|
||||
35: 002c.*
|
||||
36: aabb.*
|
||||
37: ccdd.*
|
||||
|
||||
00000038 <DAT2>:
|
||||
38: 0000.*
|
||||
...
|
||||
|
||||
0000003a <DAT3>:
|
||||
3a: 1234.*
|
||||
3b: 5678.*
|
||||
3c: 0000.*
|
||||
3d: aabb.*
|
||||
3e: ccdd.*
|
|
@ -0,0 +1,56 @@
|
|||
#objdump: -d -r
|
||||
#name: c54x extended addressing
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: f062.*
|
||||
1: 0000.*
|
||||
.*1: RELEXTMS7.*
|
||||
2: f040.*
|
||||
3: 0000.*
|
||||
.*3: RELEXT16.*
|
||||
4: f4e2.*
|
||||
|
||||
00000005 <start>:
|
||||
5: f881.*
|
||||
6: 0080.*
|
||||
.*5: ARELEXT.*
|
||||
7: fa81.*
|
||||
8: 0080.*
|
||||
.*7: ARELEXT.*
|
||||
9: f495.*
|
||||
a: f495.*
|
||||
b: f4e6.*
|
||||
c: f6e6.*
|
||||
d: f495.*
|
||||
e: f495.*
|
||||
f: f4e7.*
|
||||
10: f7e7.*
|
||||
11: f495.*
|
||||
12: f495.*
|
||||
13: f981.*
|
||||
14: 0080.*
|
||||
.*13: ARELEXT.*
|
||||
15: fb81.*
|
||||
16: 0080.*
|
||||
.*15: ARELEXT.*
|
||||
17: f495.*
|
||||
18: f495.*
|
||||
19: f4e4.*
|
||||
1a: f6e4.*
|
||||
1b: f495.*
|
||||
1c: f495.*
|
||||
1d: f4e5.*
|
||||
1e: f6e5.*
|
||||
1f: f495.*
|
||||
20: f495.*
|
||||
...
|
||||
|
||||
00010080 <end>:
|
||||
10080: f881.*
|
||||
10081: 0080.*
|
||||
.*10080: ARELEXT.*
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
*
|
||||
* Extended addressing support
|
||||
*
|
||||
.version 548
|
||||
.far_mode
|
||||
.global F1, start, end
|
||||
; LDX pseudo-op
|
||||
ldx #F1,16,a ; load upper 8 bits of extended address
|
||||
or #F1,a,a ; load remaining bits
|
||||
bacc a
|
||||
; extended addressing functions
|
||||
start:
|
||||
fb end
|
||||
|
||||
fbd end
|
||||
nop
|
||||
nop
|
||||
|
||||
fbacc a
|
||||
fbaccd a
|
||||
nop
|
||||
nop
|
||||
fcala a
|
||||
fcalad b
|
||||
nop
|
||||
nop
|
||||
fcall end
|
||||
|
||||
fcalld end
|
||||
nop
|
||||
nop
|
||||
|
||||
fret
|
||||
fretd
|
||||
nop
|
||||
nop
|
||||
frete
|
||||
freted
|
||||
nop
|
||||
nop
|
||||
.space 16*0xFFFF
|
||||
.align 0x80
|
||||
end:
|
||||
fb end
|
||||
.end
|
|
@ -0,0 +1,30 @@
|
|||
#objdump: -d
|
||||
#name: c54x field directive
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <f1>:
|
||||
0: 2af0.*
|
||||
1: 5600.*
|
||||
|
||||
00000001 <f2>:
|
||||
1: 5600.*
|
||||
|
||||
00000002 <f4>:
|
||||
2: 0001.*
|
||||
|
||||
00000003 <f5>:
|
||||
3: 0000.*
|
||||
4: 4321.*
|
||||
|
||||
00000005 <f6>:
|
||||
5: 000f.*
|
||||
|
||||
00000006 <f7>:
|
||||
6: 6000.*
|
||||
7: 008a.*
|
||||
|
||||
00000007 <f8>:
|
||||
7: 008a.*
|
|
@ -0,0 +1,14 @@
|
|||
*
|
||||
* test .field directive
|
||||
*
|
||||
.global X
|
||||
.global f1,f2,f3,f4,f5,f6,f7,f8
|
||||
f1: .field 0ABCh, 14 ; f1=0x0
|
||||
f2: .field 0Ah, 5 ; should align to next word, f2=0x1
|
||||
f3: .field 0Ch, 4 ; should be packed in previous word, f3=0x1
|
||||
f4: .field f3 ; align at word 0x2
|
||||
f5: .field 04321h, 32 ;
|
||||
f6: .field 01111b ; default to 16-bit field
|
||||
f7: .field 3,3
|
||||
f8: .field 69,15 ; align at next word
|
||||
.end
|
|
@ -0,0 +1,5 @@
|
|||
IN_MLIB .macro AA,BB,CC
|
||||
ADD #AA,a
|
||||
ADD #BB,b
|
||||
ADD #CC,a
|
||||
.endm
|
|
@ -0,0 +1,74 @@
|
|||
#objdump: -d
|
||||
#name: c54x local labels
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <label1>:
|
||||
0: 1000.*
|
||||
1: 0800.*
|
||||
2: f843.*
|
||||
3: 0007.*
|
||||
4: 1000.*
|
||||
5: f073.*
|
||||
6: 0008.*
|
||||
|
||||
00000007 <\$1.*>:
|
||||
7: 1000.*
|
||||
|
||||
00000008 <\$2.*>:
|
||||
8: 0000.*
|
||||
9: f843.*
|
||||
a: 000c.*
|
||||
b: 8000.*
|
||||
|
||||
0000000c <\$1.*>:
|
||||
c: f495.*
|
||||
d: f495.*
|
||||
|
||||
0000000e <lab.*>:
|
||||
e: f000.*
|
||||
f: 0001.*
|
||||
10: f073.*
|
||||
11: 000e.*
|
||||
|
||||
00000012 <lab.*>:
|
||||
12: f845.*
|
||||
13: 0012.*
|
||||
|
||||
00000014 <lab.*>:
|
||||
14: f000.*
|
||||
15: 0003.*
|
||||
16: f073.*
|
||||
17: 0014.*
|
||||
|
||||
00000018 <lab.*>:
|
||||
18: f000.*
|
||||
19: 0004.*
|
||||
1a: f073.*
|
||||
1b: 0018.*
|
||||
|
||||
0000001c <after_macro>:
|
||||
1c: f073.*
|
||||
1d: 0014.*
|
||||
Disassembly of section new_sect:
|
||||
|
||||
00000000 <new_section>:
|
||||
0: f495.*
|
||||
|
||||
00000001 <lab.7>:
|
||||
1: f000.*
|
||||
2: 0005.*
|
||||
3: f495.*
|
||||
4: f495.*
|
||||
5: f073.*
|
||||
6: 0001.*
|
||||
|
||||
00000007 <lab.8>:
|
||||
7: f000.*
|
||||
8: 0006.*
|
||||
9: f495.*
|
||||
a: f495.*
|
||||
b: f073.*
|
||||
c: 0007.*
|
|
@ -0,0 +1,3 @@
|
|||
* simple include file to test local label scope
|
||||
lab? bc lab?,aeq
|
||||
* end
|
|
@ -0,0 +1,55 @@
|
|||
* local labels
|
||||
* two forms, $[0-9] and label? are allowed
|
||||
* Local labels are undefined/reset in one of four ways:
|
||||
* .newblock
|
||||
* changing sections
|
||||
* entering an include file
|
||||
* leaving an include file
|
||||
.global addra, addrb, addrc
|
||||
label1: ld addra,a
|
||||
sub addrb,a
|
||||
bc $1, alt ; generates frag!
|
||||
ld addrb, a
|
||||
b $2
|
||||
$1: ld addra,a
|
||||
$2 add addrc,a
|
||||
.newblock
|
||||
bc $1,alt
|
||||
stl a, addrc
|
||||
$1 nop
|
||||
|
||||
* #1, First definition of local label 'lab'
|
||||
nop
|
||||
lab? add #1,a ; reports as line 17?
|
||||
b lab?
|
||||
* #2, Included file also defines local label 'lab'
|
||||
.copy labels.inc
|
||||
* #3, Next definition; exit from .copy clears all locals
|
||||
lab? add #3,a ; reports as line 22?
|
||||
b lab?
|
||||
* #4, Next definition is within macro; supersedes previous definition while
|
||||
* within the macro
|
||||
mac .macro
|
||||
lab? add #4,a ; line 31?
|
||||
b lab?
|
||||
.endm
|
||||
* Macro invocation
|
||||
mac
|
||||
* This reference should resolve to definition #3
|
||||
after_macro:
|
||||
b lab?
|
||||
* Section change clears all definitions
|
||||
.sect new_section
|
||||
nop
|
||||
lab? add #5,a
|
||||
nop
|
||||
nop
|
||||
b lab?
|
||||
* Newblock directive clears local labels
|
||||
.newblock
|
||||
lab? add #6,a
|
||||
nop
|
||||
nop
|
||||
b lab?
|
||||
.end
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
#objdump: -d
|
||||
#name: c54x loop directive
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
...
|
||||
|
||||
00000001 <label>:
|
||||
1: 0000.*
|
||||
2: 0001.*
|
||||
3: 0002.*
|
||||
4: 0003.*
|
||||
5: 0004.*
|
||||
6: 0005.*
|
||||
7: 0007.*
|
|
@ -0,0 +1,18 @@
|
|||
* Test loop directive handling
|
||||
* .loop [well-defined expression]
|
||||
* .break [well-defined expression]
|
||||
* .endloop
|
||||
.global label
|
||||
.asg label,COEF
|
||||
.word 0
|
||||
.eval 0,x
|
||||
COEF .loop 10
|
||||
.word x
|
||||
.eval x+1,x
|
||||
.if x == 6
|
||||
.break
|
||||
.endif
|
||||
.break x == 6
|
||||
.endloop
|
||||
.word x+1
|
||||
.end
|
|
@ -0,0 +1,10 @@
|
|||
#objdump: -d
|
||||
#name: c54x LP device/instruction
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: f49f.*
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
.version 545lp
|
||||
rnd a
|
||||
.end
|
|
@ -0,0 +1,20 @@
|
|||
#objdump: -d
|
||||
#name: c54x macros
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: f000.*
|
||||
1: 0000.*
|
||||
2: f300.*
|
||||
3: 0000.*
|
||||
4: f000.*
|
||||
5: 0000.*
|
||||
6: 1000.*
|
||||
7: 0000.*
|
||||
8: 0000.*
|
||||
9: 8000.*
|
||||
a: f000.*
|
||||
b: 0064.*
|
|
@ -0,0 +1,40 @@
|
|||
* Macro test
|
||||
.sslist
|
||||
.text
|
||||
.global abc, def, ghi, adr
|
||||
|
||||
* Macro library; load and use a macro in macros.lib
|
||||
.mlib "macros.lib"
|
||||
|
||||
IN_MLIB abc,def,ghi
|
||||
|
||||
add3 .macro P1,P2,P3,ADDRP
|
||||
ld P1,a
|
||||
add P2,a
|
||||
add P3,a
|
||||
stl a,ADDRP
|
||||
.endm
|
||||
add3 abc, def, ghi, adr
|
||||
|
||||
* Forced substitution within a macro
|
||||
force .macro x
|
||||
.asg 0, x
|
||||
.loop 8
|
||||
AUX:x: .set x
|
||||
.eval x+1,x
|
||||
.endloop
|
||||
.endm
|
||||
force
|
||||
|
||||
* Subsripted substitution symbols
|
||||
ADDX .macro ABC
|
||||
.var TMP
|
||||
.asg :ABC(1):,TMP
|
||||
.if $symcmp(TMP,"#") == 0
|
||||
ADD ABC,A
|
||||
.else
|
||||
.emsg "Bad macro parameter 'ABC'"
|
||||
.endif
|
||||
.endm
|
||||
ADDX #100 ; ADD #100,A
|
||||
.end
|
|
@ -0,0 +1,12 @@
|
|||
* Subsripted substitution symbols
|
||||
ADDX .macro ABC
|
||||
.var TMP
|
||||
.asg :ABC(1):,TMP
|
||||
.if $symcmp(TMP,"#") == 0
|
||||
ADD ABC,A
|
||||
.else
|
||||
.emsg "Bad macro parameter 'ABC'"
|
||||
.endif
|
||||
.endm
|
||||
ADDX *AR1 ; should produce an error msg
|
||||
.end
|
|
@ -0,0 +1,7 @@
|
|||
!<arch>
|
||||
in_mlib.asm/ 934653484 500 100 100664 92 `
|
||||
IN_MLIB .macro AA,BB,CC
|
||||
ADD #AA,a
|
||||
ADD #BB,b
|
||||
ADD #CC,a
|
||||
.endm
|
|
@ -0,0 +1,58 @@
|
|||
#objdump: -d
|
||||
#name: c54x math builtins
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: 3fc9.*
|
||||
1: 0fd8.*
|
||||
...
|
||||
6: 3eed.*
|
||||
7: 6345.*
|
||||
8: 4000.*
|
||||
9: 0000.*
|
||||
a: 3f80.*
|
||||
b: 0000.*
|
||||
c: 3f80.*
|
||||
d: 0000.*
|
||||
e: 3f80.*
|
||||
f: 0000.*
|
||||
10: 0002.*
|
||||
11: fffe.*
|
||||
12: 402d.*
|
||||
13: f855.*
|
||||
14: 4020.*
|
||||
15: 0000.*
|
||||
16: 4040.*
|
||||
17: 0000.*
|
||||
18: 4000.*
|
||||
19: 0000.*
|
||||
1a: 0000.*
|
||||
1b: 0000.*
|
||||
1c: 4080.*
|
||||
...
|
||||
21: 0000.*
|
||||
22: 4000.*
|
||||
23: 0000.*
|
||||
24: 3f80.*
|
||||
25: 0000.*
|
||||
26: 4100.*
|
||||
27: 0000.*
|
||||
28: 40a0.*
|
||||
29: 0000.*
|
||||
2a: c0a0.*
|
||||
2b: 0000.*
|
||||
2c: ffff.*
|
||||
2d: 0000.*
|
||||
2e: 0001.*
|
||||
...
|
||||
33: 0000.*
|
||||
34: 3f80.*
|
||||
...
|
||||
39: 0000.*
|
||||
3a: bf80.*
|
||||
3b: 0000.*
|
||||
3c: 3f80.*
|
||||
...
|
|
@ -0,0 +1,37 @@
|
|||
*
|
||||
* Math built-in functions
|
||||
*
|
||||
.float $acos(0.0)
|
||||
.float $asin(0.0)
|
||||
.float $atan(0.0)
|
||||
.float $atan2(1.0,2.0)
|
||||
.float $ceil(1.5)
|
||||
.float $cosh(0.0)
|
||||
.float $cos(0.0)
|
||||
.float $cvf(1)
|
||||
.int $cvi(2.5)
|
||||
.int $cvi(-2.5)
|
||||
.float $exp(1.0)
|
||||
.float $fabs(-2.5)
|
||||
.float $floor(3.4)
|
||||
.float $fmod(10,4)
|
||||
.int $int(1.2)
|
||||
.float $ldexp(1,2)
|
||||
.float $log10(1.0)
|
||||
.float $log(1.0)
|
||||
.float $max(1.0,2.0)
|
||||
.float $min(1.0,2.0)
|
||||
.float $pow(2.0,3.0)
|
||||
.float $round(4.5)
|
||||
.float $round(-4.5)
|
||||
.int $sgn(-1.0)
|
||||
.int $sgn(0)
|
||||
.int $sgn(1)
|
||||
.float $sin(0.0)
|
||||
.float $sinh(0.0)
|
||||
.float $sqrt(1.0)
|
||||
.float $tan(0.0)
|
||||
.float $tanh(0.0)
|
||||
.float $trunc(-1.5)
|
||||
.float $trunc(1.5)
|
||||
.end
|
|
@ -0,0 +1,292 @@
|
|||
#objdump: -d
|
||||
#name: c54x opcode list
|
||||
|
||||
.*: file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <_opcodes>:
|
||||
0: e39a abdst \*ar3\+,\*ar4\+
|
||||
1: f485 abs a
|
||||
2: f585 abs a,b
|
||||
3: 0090 add \*ar0\+,a
|
||||
4: 0491 add \*ar1\+,ts,a
|
||||
5: 3c92 add \*ar2\+,16,a
|
||||
6: 6f93 add \*ar3\+,a,b
|
||||
7: 0d00
|
||||
8: 90a1 add \*ar4\+,1,a
|
||||
9: a09a add \*ar3\+,\*ar4\+,a
|
||||
a: f000 add #-32768,a
|
||||
b: 8000
|
||||
c: f160 add #0,16,a,b
|
||||
d: 0000
|
||||
e: f510 add a,-16,b
|
||||
f: f580 add a,asm,b
|
||||
10: 0690 addc \*ar0\+,a
|
||||
11: 6b91 addm #1,\*ar1\+
|
||||
12: 0001
|
||||
13: 0292 adds \*ar2\+,a
|
||||
14: 1893 and \*ar3\+,a
|
||||
15: f131 and #1,1,a,b
|
||||
16: 0001
|
||||
17: f163 and #1,16,a,b
|
||||
18: 0001
|
||||
19: f080 and a
|
||||
1a: 6890 andm #1,\*ar0\+
|
||||
1b: 0001
|
||||
1c: f073 b 11c <_opcodes_end>
|
||||
1d: 011c
|
||||
1e: f273 bd 11c <_opcodes_end>
|
||||
1f: 011c
|
||||
20: f495 nop
|
||||
21: f495 nop
|
||||
22: f4e2 bacc a
|
||||
23: f7e2 baccd b
|
||||
24: f495 nop
|
||||
25: f495 nop
|
||||
26: 6c91 banz 11c <_opcodes_end>,\*ar1\+
|
||||
27: 011c
|
||||
28: 6e92 banzd 11c <_opcodes_end>,\*ar2\+
|
||||
29: 011c
|
||||
2a: f495 nop
|
||||
2b: f495 nop
|
||||
2c: f875 bc 11c <_opcodes_end>,aeq, aov
|
||||
2d: 011c
|
||||
2e: fa3f bcd 11c <_opcodes_end>,tc, c, bio
|
||||
2f: 011c
|
||||
30: f495 nop
|
||||
31: f495 nop
|
||||
32: 9691 bit \*ar3\+,1
|
||||
33: 6194 bitf \*ar4\+,#-1
|
||||
34: ffff
|
||||
35: 3495 bitt \*ar5\+
|
||||
36: f4e3 cala a
|
||||
37: f7e3 calad b
|
||||
38: f495 nop
|
||||
39: f495 nop
|
||||
3a: f074 call 11c <_opcodes_end>
|
||||
3b: 011c
|
||||
3c: f274 calld 11c <_opcodes_end>
|
||||
3d: 011c
|
||||
3e: f495 nop
|
||||
3f: f495 nop
|
||||
40: f930 cc 11c <_opcodes_end>,tc
|
||||
41: 011c
|
||||
42: fb45 ccd 11c <_opcodes_end>,aeq
|
||||
43: 011c
|
||||
44: f495 nop
|
||||
45: f495 nop
|
||||
46: f693 cmpl b,a
|
||||
47: 6090 cmpm \*ar0\+,#1
|
||||
48: 0001
|
||||
49: f5a9 cmpr lt,ar1
|
||||
4a: 8e92 cmps a,\*ar2\+
|
||||
4b: 518b dadd \*ar3-,a,b
|
||||
4c: 5a8c dadst \*ar4-,a
|
||||
4d: 4d95 delay \*ar5\+
|
||||
4e: 568e dld \*ar6-,a
|
||||
4f: 598f drsub \*ar7-,b
|
||||
50: 5e88 dsadt \*ar0-,a
|
||||
51: 4e89 dst a,\*ar1-
|
||||
52: 558a dsub \*ar2-,b
|
||||
53: 5c8b dsubt \*ar3-,a
|
||||
54: f48e exp a
|
||||
55: e09a firs \*ar3\+,\*ar4\+,11c <_opcodes_end>
|
||||
56: 011c
|
||||
57: ee80 frame -128
|
||||
58: f6e1 idle 2
|
||||
59: f7cf intr 15
|
||||
5a: 1090 ld \*ar0\+,a
|
||||
5b: 1491 ld \*ar1\+,ts,a
|
||||
5c: 4492 ld \*ar2\+,16,a
|
||||
5d: 9491 ld \*ar3\+,1,a
|
||||
5e: 94a1 ld \*ar4\+,1,a
|
||||
5f: e901 ld #1,b
|
||||
60: f021 ld #32767,1,a
|
||||
61: 7fff
|
||||
62: f062 ld #32767,16,a
|
||||
63: 7fff
|
||||
64: f582 ld a,asm,b
|
||||
65: f541 ld a,1,b
|
||||
66: 3090 ld \*ar0\+,t
|
||||
67: 4691 ld \*ar1\+,dp
|
||||
68: ea02 ld #2,dp
|
||||
69: ed0f ld #15,asm
|
||||
6a: f4a7 ld #7,arp
|
||||
6b: 3292 ld \*ar2\+,asm
|
||||
6c: 4813 ldm ar3,a
|
||||
6d: a889 ld \*ar2\+,a || mac \*ar3\+,a
|
||||
6e: abab ld \*ar4\+,b || macr \*ar5\+,b
|
||||
6f: ac89 ld \*ar2\+,a || mas \*ar3\+,a
|
||||
70: afab ld \*ar4\+,b || masr \*ar5\+,b
|
||||
71: 1696 ldr \*ar6\+,a
|
||||
72: 1297 ldu \*ar7\+,a
|
||||
73: e19a lms \*ar3\+,\*ar4\+
|
||||
74: 4c90 ltd \*ar0\+
|
||||
75: 2891 mac \*ar1\+,a
|
||||
76: 2a92 macr \*ar2\+,a
|
||||
77: b189 mac \*ar2\+,\*ar3\+,a,b
|
||||
78: b5ab macr \*ar4\+,\*ar5\+,a,b
|
||||
79: f167 mac #1,a,b
|
||||
7a: 0001
|
||||
7b: 6490 mac \*ar0\+,#1,a
|
||||
7c: 0001
|
||||
7d: 3591 maca \*ar1\+,b
|
||||
7e: f588 maca t,a,b
|
||||
7f: 7a92 macd \*ar2\+,11c <_opcodes_end>,a
|
||||
80: 011c
|
||||
81: 7893 macp \*ar3\+,11c <_opcodes_end>,a
|
||||
82: 011c
|
||||
83: a6ab macsu \*ar4\+,\*ar5\+,a
|
||||
84: 6d96 mar \*ar6\+
|
||||
85: 2c97 mas \*ar7\+,a
|
||||
86: 2e90 masr \*ar0\+,a
|
||||
87: b99a mas \*ar3\+,\*ar4\+,a,b
|
||||
88: bd8b masr \*ar2\+,\*ar5\+,a,b
|
||||
89: 3396 masa \*ar6\+,b
|
||||
8a: f58a masa t,a,b
|
||||
8b: f48b masar t,a
|
||||
8c: f486 max a
|
||||
8d: f587 min b
|
||||
8e: 2097 mpy \*ar7\+,a
|
||||
8f: a59a mpy \*ar3\+,\*ar4\+,b
|
||||
90: 6280 mpy \*ar0,#1,a
|
||||
91: 0001
|
||||
92: f066 mpy #1,a
|
||||
93: 0001
|
||||
94: 3190 mpya \*ar0\+
|
||||
95: f58c mpya b
|
||||
96: 2591 mpyu \*ar1\+,b
|
||||
97: e589 mvdd \*ar2\+,\*ar3\+
|
||||
98: 7194 mvdk \*ar4\+,0 <_opcodes>
|
||||
99: 0000
|
||||
9a: 7215 mvdm 0 <_opcodes>,ar5
|
||||
9b: 0000
|
||||
9c: 7d96 mvdp \*ar6\+,11c <_opcodes_end>
|
||||
9d: 011c
|
||||
9e: 7097 mvkd 0 <_opcodes>,\*ar7\+
|
||||
9f: 0000
|
||||
a0: 7310 mvmd ar0,0 <_opcodes>
|
||||
a1: 0000
|
||||
a2: e712 mvmm ar1,ar2
|
||||
a3: 7c93 mvpd 11c <_opcodes_end>,\*ar3\+
|
||||
a4: 011c
|
||||
a5: f584 neg a,b
|
||||
a6: f495 nop
|
||||
a7: f48f norm a
|
||||
a8: 1b90 or \*ar0\+,b
|
||||
a9: f340 or #7,b
|
||||
aa: 0007
|
||||
ab: f364 or #1,16,b
|
||||
ac: 0001
|
||||
ad: f3a0 or b
|
||||
ae: 6991 orm #1,\*ar1\+
|
||||
af: 0001
|
||||
b0: 3692 poly \*ar2\+
|
||||
b1: 8b93 popd \*ar3\+
|
||||
b2: 8a14 popm ar4
|
||||
b3: 7495 portr pa0,\*ar5\+
|
||||
b4: 0000
|
||||
b5: 7596 portw \*ar6\+,pa0
|
||||
b6: 0000
|
||||
b7: 4b97 pshd \*ar7\+
|
||||
b8: 4a10 pshm ar0
|
||||
b9: fc44 rc aneq
|
||||
ba: fe46 rcd agt
|
||||
bb: 7e91 reada \*ar1\+
|
||||
bc: f7e0 reset
|
||||
bd: fc00 ret
|
||||
be: fe00 retd
|
||||
bf: f495 nop
|
||||
c0: f495 nop
|
||||
c1: f4eb rete
|
||||
c2: f6eb reted
|
||||
c3: f495 nop
|
||||
c4: f495 nop
|
||||
c5: f49b retf
|
||||
c6: f69b retfd
|
||||
c7: f491 rol a
|
||||
c8: f492 roltc a
|
||||
c9: f590 ror b
|
||||
ca: 4790 rpt \*ar0\+
|
||||
cb: f495 nop
|
||||
cc: ec20 rpt #32
|
||||
cd: f495 nop
|
||||
ce: f070 rpt #65535
|
||||
cf: ffff
|
||||
d0: f495 nop
|
||||
d1: f072 rptb 11b <_opcodes\+0x11b>
|
||||
d2: 011b
|
||||
d3: f495 nop
|
||||
d4: f272 rptbd 11b <_opcodes\+0x11b>
|
||||
d5: 011b
|
||||
d6: f495 nop
|
||||
d7: f495 nop
|
||||
d8: f071 rptz a,#32767
|
||||
d9: 7fff
|
||||
da: f495 nop
|
||||
db: f6bf rsbx st1,braf
|
||||
dc: 9e93 saccd a,\*ar3\+,alt
|
||||
dd: f483 sat a
|
||||
de: f56f sfta a,15,b
|
||||
df: f494 sftc a
|
||||
e0: f0ef sftl a,15
|
||||
e1: e289 sqdst \*ar2\+,\*ar3\+
|
||||
e2: 2794 squr \*ar4\+,b
|
||||
e3: f48d squr a,a
|
||||
e4: 3895 squra \*ar5\+,a
|
||||
e5: 3a96 squrs \*ar6\+,a
|
||||
e6: 9d87 srccd \*ar2\+,aleq
|
||||
e7: f7bf ssbx st1,braf
|
||||
e8: 8c90 st t,\*ar0\+
|
||||
e9: 8d91 st trn,\*ar1\+
|
||||
ea: 7692 st #32767,\*ar2\+
|
||||
eb: 7fff
|
||||
ec: 8293 sth a,\*ar3\+
|
||||
ed: 8694 sth a,asm,\*ar4\+
|
||||
ee: 9abf sth a,15,\*ar5\+
|
||||
ef: 6f96 sth a,-16,\*ar6\+
|
||||
f0: 0c70
|
||||
f1: 8097 stl a,\*ar7\+
|
||||
f2: 8490 stl a,asm,\*ar0\+
|
||||
f3: 6f91 stl a,15,\*ar1\+
|
||||
f4: 0c8f
|
||||
f5: 988f stl a,15,\*ar2\+
|
||||
f6: 8813 stlm a,ar3
|
||||
f7: 7714 stm #32767,ar4
|
||||
f8: 7fff
|
||||
f9: c1ab st a,\*ar5\+ || add \*ar4\+,b
|
||||
fa: c989 st a,\*ar3\+ || ld \*ar2\+,b
|
||||
fb: e4a9 st a,\*ar3\+ || ld \*ar4\+,t
|
||||
fc: d18b st a,\*ar5\+ || mac \*ar2\+,b
|
||||
fd: dda9 st a,\*ar3\+ || masr \*ar4\+,b
|
||||
fe: cda9 st a,\*ar3\+ || mpy \*ar4\+,b
|
||||
ff: c5a9 st a,\*ar3\+ || sub \*ar4\+,b
|
||||
100: 9cbd strcd \*ar5\+,beq
|
||||
101: 0890 sub \*ar0\+,a
|
||||
102: 0c91 sub \*ar1\+,ts,a
|
||||
103: 4192 sub \*ar2\+,16,a,b
|
||||
104: 6f93 sub \*ar3\+,a,b
|
||||
105: 0d20
|
||||
106: 92af sub \*ar4\+,15,a
|
||||
107: a3ba sub \*ar5\+,\*ar4\+,b
|
||||
108: f11f sub #1,15,a,b
|
||||
109: 0001
|
||||
10a: f161 sub #1,16,a,b
|
||||
10b: 0001
|
||||
10c: f530 sub a,-16,b
|
||||
10d: f581 sub a,asm,b
|
||||
10e: 0e90 subb \*ar0\+,a
|
||||
10f: 1e91 subc \*ar1\+,a
|
||||
110: 0a92 subs \*ar2\+,a
|
||||
111: f4cf trap 15
|
||||
112: 7f93 writa \*ar3\+
|
||||
113: fd70 xc 1,aov
|
||||
114: 1c94 xor \*ar4\+,a
|
||||
115: f050 xor #1,a
|
||||
116: 0001
|
||||
117: f065 xor #1,16,a
|
||||
118: 0001
|
||||
119: f1c1 xor a,1,b
|
||||
11a: 6a95 xorm #1,\*ar5\+
|
||||
11b: 0001
|
|
@ -0,0 +1,309 @@
|
|||
;; opcodes tests
|
||||
.text
|
||||
.mmregs
|
||||
.global X, Y, Z
|
||||
.global _opcodes, _opcodes_end
|
||||
.label _opcodes_load
|
||||
_opcodes:
|
||||
abdst *ar3+, *ar4+
|
||||
abs a
|
||||
abs a,b
|
||||
add *ar0+, a ; Smem, src
|
||||
add *ar1+, ts, a ; Smem, TS, src
|
||||
add *ar2+, 16, a ; Smem, 16, src [,dst]
|
||||
add *ar3+, a, b ; Smem [,SHIFT], src [,dst] (-16<=SHIFT<=15)
|
||||
|
||||
add *ar4+, 1, a ; Xmem, SHFT, src (0<=SHFT<=15)
|
||||
add *ar3+, *ar4+, a ; Xmem, Ymem, dst
|
||||
add #-32768, a ; #lk [,SHFT], src [,dst] (-32768<=lk<=32767)
|
||||
|
||||
add #0,16,a,b ; #lk, 16, src, [,dst]
|
||||
|
||||
add a,-16,b ; src [,SHIFT][,dst]
|
||||
add a,asm,b ; src, ASM [,dst]
|
||||
addc *ar0+,a
|
||||
addm #1,*ar1+
|
||||
|
||||
adds *ar2+,a
|
||||
and *ar3+,a ; Smem,src
|
||||
and #1,1,a,b ; #lk[,SHFT],src[,dst]
|
||||
|
||||
and #1,#16,a,b ; #lk,16,src[,dst]
|
||||
|
||||
and a ; src[,SHIFT][,dst]
|
||||
andm #1,*ar0+
|
||||
|
||||
b _opcodes_end
|
||||
|
||||
bd #_opcodes_end
|
||||
nop
|
||||
nop
|
||||
|
||||
bacc a
|
||||
baccd b
|
||||
nop
|
||||
nop
|
||||
|
||||
banz _opcodes_end,*ar1+
|
||||
|
||||
banzd _opcodes_end,*ar2+
|
||||
nop
|
||||
nop
|
||||
|
||||
bc _opcodes_end, AEQ,AOV
|
||||
|
||||
bcd _opcodes_end, BIO,C,TC
|
||||
nop
|
||||
nop
|
||||
|
||||
bit *ar3+,1
|
||||
bitf *ar4+,#-1
|
||||
|
||||
bitt *ar5+
|
||||
cala a
|
||||
calad b
|
||||
nop
|
||||
nop
|
||||
|
||||
call _opcodes_end
|
||||
|
||||
calld _opcodes_end
|
||||
nop
|
||||
nop
|
||||
|
||||
cc _opcodes_end, tc
|
||||
|
||||
ccd _opcodes_end, aeq
|
||||
nop
|
||||
nop
|
||||
|
||||
cmpl b,a
|
||||
cmpm *ar0+,#1
|
||||
|
||||
cmpr 1,ar1
|
||||
cmps a,*ar2+
|
||||
dadd *ar3-, a, b
|
||||
dadst *ar4-, a
|
||||
delay *ar5+
|
||||
dld *ar6-, a
|
||||
drsub *ar7-, b
|
||||
dsadt *ar0-, a
|
||||
dst a, *ar1-
|
||||
dsub *ar2-, b
|
||||
dsubt *ar3-, a
|
||||
exp a
|
||||
firs *ar3+,*ar4+,_opcodes_end
|
||||
|
||||
frame -128
|
||||
idle 2
|
||||
intr 15
|
||||
ld *ar0+,a ; Smem,dst
|
||||
ld *ar1+,ts,a ; Smem,TS,dst
|
||||
ld *ar2+,16,a ; Smem,16,dst
|
||||
ld *ar3+,1,a ; Smem[,SHIFT],dst
|
||||
|
||||
ld *ar4+,1,a ; Xmem,SHFT,dst
|
||||
ld #1,b ; #K,dst
|
||||
ld #32767,1,a ; #lk,[,SHFT],dst
|
||||
|
||||
ld #32767,16,a ; #lk,16,dst
|
||||
|
||||
ld a,asm,b ; src,ASM[,dst]
|
||||
ld a,1,b ; src[,SHIFT],dst
|
||||
ld *ar0+,t
|
||||
ld *ar1+,dp
|
||||
ld #_opcodes_end,dp ; FIXME try to print label on disasm
|
||||
; note: TI assembler doesn't shift
|
||||
; the address encoding.
|
||||
ld #15,asm
|
||||
ld #7,arp
|
||||
ld *ar2+,asm
|
||||
ldm ar3,a
|
||||
ld *ar2+,a || mac *ar3+,b ; single-line parallell
|
||||
ld *ar4+,b || macr *ar5+,a ; with optional DST_ specified
|
||||
ld *ar2+,a ; double-line parallel
|
||||
|| mas *ar3+
|
||||
ld *ar4+,b ; parallel spans
|
||||
; inserted line
|
||||
|| masr *ar5+
|
||||
ldr *ar6+,a
|
||||
ldu *ar7+,a
|
||||
lms *ar3+,*ar4+
|
||||
ltd *ar0+
|
||||
mac *ar1+,a
|
||||
macr *ar2+,a
|
||||
mac *ar2+,*ar3+,a,b
|
||||
macr *ar4+,*ar5+,a,b
|
||||
mac #1,a,b
|
||||
|
||||
mac *ar0+,#1,a
|
||||
|
||||
maca *ar1+ ; *ar6+,b (valid)
|
||||
maca t,a,b
|
||||
macd *ar2+,_opcodes_end,a
|
||||
|
||||
macp *ar3+,_opcodes_end,a
|
||||
|
||||
macsu *ar4+,*ar5+,a
|
||||
mar *ar6+
|
||||
mas *ar7+,a
|
||||
masr *ar0+,a
|
||||
mas *ar3+,*ar4+,a,b
|
||||
masr *ar2+,*ar5+,a,b
|
||||
masa *ar6+ ; *ar6+,b (valid)
|
||||
masa t,a,b
|
||||
masar t,a
|
||||
max a
|
||||
min b
|
||||
mpy *ar7+,a
|
||||
mpy *ar3+,*ar4+,b
|
||||
mpy *ar0,#1,a
|
||||
|
||||
mpy #1,a
|
||||
|
||||
mpya *ar0+
|
||||
mpya b
|
||||
mpyu *ar1+,b
|
||||
mvdd *ar2+,*ar3+
|
||||
mvdk *ar4+,X
|
||||
|
||||
mvdm X,ar5
|
||||
|
||||
mvdp *ar6+,_opcodes_end
|
||||
|
||||
mvkd X,*ar7+
|
||||
|
||||
mvmd ar0,X
|
||||
|
||||
mvmm ar1,ar2
|
||||
mvpd _opcodes_end,*ar3+
|
||||
|
||||
neg a,b
|
||||
|
||||
nop
|
||||
norm a
|
||||
or *ar0+,b
|
||||
or #(3+4),b
|
||||
|
||||
or #1,16,b
|
||||
|
||||
or b
|
||||
orm #1,*ar1+
|
||||
|
||||
poly *ar2+
|
||||
popd *ar3+
|
||||
popm ar4
|
||||
portr 0,*ar5+
|
||||
|
||||
portw *ar6+,0
|
||||
|
||||
pshd *ar7+
|
||||
pshm ar0
|
||||
rc ANEQ
|
||||
rcd AGT
|
||||
reada *ar1+
|
||||
reset
|
||||
ret
|
||||
retd
|
||||
nop
|
||||
nop
|
||||
rete
|
||||
reted
|
||||
nop
|
||||
nop
|
||||
retf
|
||||
retfd
|
||||
rol a
|
||||
roltc a
|
||||
ror b
|
||||
rpt *ar0+
|
||||
nop
|
||||
rpt #32
|
||||
nop
|
||||
rpt #65535
|
||||
nop
|
||||
rptb _opcodes_end-1
|
||||
nop
|
||||
rptbd _opcodes_end-1
|
||||
nop
|
||||
nop
|
||||
rptz a,#32767
|
||||
nop
|
||||
rsbx 1,15
|
||||
saccd a,*ar3+,ALT
|
||||
sat a
|
||||
sfta a,15,b
|
||||
sftc a
|
||||
sftl a,15
|
||||
sqdst *ar2+,*ar3+
|
||||
squr *ar4+,b
|
||||
squr a,a
|
||||
squra *ar5+,a
|
||||
squrs *ar6+,a
|
||||
srccd *ar2+,ALEQ
|
||||
ssbx 1,15
|
||||
st t,*ar0+
|
||||
st trn,*ar1+
|
||||
st #32767,*ar2+
|
||||
|
||||
sth a,*ar3+
|
||||
sth a,asm,*ar4+
|
||||
sth a,15,*ar5+
|
||||
sth a,-16,*ar6+
|
||||
|
||||
stl a,*ar7+
|
||||
stl a,asm,*ar0+
|
||||
stl a,15,*ar1+
|
||||
stl a,15,*ar2+
|
||||
|
||||
stlm a,ar3
|
||||
stm #32767,ar4
|
||||
|
||||
st a,*ar5+
|
||||
|| add *ar4+,b
|
||||
st a,*ar3+
|
||||
|| ld *ar2+,b
|
||||
st a,*ar3+
|
||||
|| ld *ar4+,t
|
||||
st a,*ar5+
|
||||
|| mac *ar2+,b
|
||||
st a,*ar3+
|
||||
|| masr *ar4+,b
|
||||
st a,*ar3+
|
||||
|| mpy *ar4+,b
|
||||
st a,*ar3+
|
||||
|| sub *ar4+,b
|
||||
strcd *ar5+,BEQ
|
||||
sub *ar0+,a
|
||||
sub *ar1+,ts,a
|
||||
sub *ar2+,16,a,b
|
||||
sub *ar3+,a,b
|
||||
|
||||
sub *ar4+,15,a
|
||||
sub *ar5+,*ar4+,b
|
||||
sub #1,15,a,b
|
||||
|
||||
sub #1,16,a,b
|
||||
|
||||
sub a,-16,b
|
||||
sub a,asm,b
|
||||
subb *ar0+,a
|
||||
subc *ar1+,a
|
||||
subs *ar2+,a
|
||||
trap 15
|
||||
writa *ar3+
|
||||
xc 1,AOV
|
||||
xor *ar4+,a
|
||||
xor #1,a
|
||||
|
||||
xor #1,16,a
|
||||
|
||||
xor a,1,b
|
||||
xorm #1,*ar5+
|
||||
_opcodes_end:
|
||||
.data
|
||||
X: .word 0
|
||||
Y: .word 1
|
||||
* .word Z
|
||||
.end
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
#objdump: -d --headers
|
||||
#name: c54x sections
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .text 0000001b 00000000 00000000 0000.... 2..0
|
||||
CONTENTS, ALLOC, LOAD, RELOC, CODE
|
||||
1 .data 00000007 00000000 00000000 0000.... 2..0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
2 .bss 00000014 00000000 00000000 0000.... 2..0
|
||||
ALLOC
|
||||
3 newvars 00000017 00000000 00000000 0000.... 2..1
|
||||
ALLOC, BLOCK
|
||||
4 vectors 00000002 00000000 00000000 0000.... 2..0
|
||||
CONTENTS, ALLOC, LOAD, CODE, BLOCK
|
||||
5 clink 00000002 00000000 00000000 0000.... 2..0
|
||||
CONTENTS, ALLOC, LOAD, CODE, CLINK
|
||||
6 blksect 00000002 00000000 00000000 0000.... 2..0
|
||||
CONTENTS, ALLOC, LOAD, CODE, BLOCK
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: 1234.*
|
||||
|
||||
00000001 <add>:
|
||||
1: 100f.*
|
||||
|
||||
00000002 <aloop>:
|
||||
2: f010.*
|
||||
3: 0001.*
|
||||
4: f842.*
|
||||
5: 0002.*
|
||||
|
||||
00000006 <mpy>:
|
||||
6: 110a.*
|
||||
|
||||
00000007 <mloop>:
|
||||
7: f166.*
|
||||
8: 000a.*
|
||||
9: f868.*
|
||||
a: 0007.*
|
||||
|
||||
0000000b <space>:
|
||||
...
|
||||
|
||||
00000012 <bes>:
|
||||
...
|
||||
|
||||
00000013 <spacep>:
|
||||
13: 000b.*
|
||||
|
||||
00000014 <besp>:
|
||||
14: 0012.*
|
||||
|
||||
00000015 <pk1>:
|
||||
...
|
||||
|
||||
00000016 <endpk1>:
|
||||
16: 0000.*
|
||||
...
|
||||
|
||||
00000018 <endpk2>:
|
||||
...
|
||||
|
||||
00000019 <pk3>:
|
||||
...
|
||||
|
||||
0000001a <endpk3>:
|
||||
...
|
||||
Disassembly of section vectors:
|
||||
|
||||
00000000 <vectors>:
|
||||
0: 0011.*
|
||||
1: 0033.*
|
||||
Disassembly of section clink:
|
||||
|
||||
00000000 <clink>:
|
||||
0: 0022.*
|
||||
1: 0044.*
|
||||
Disassembly of section blksect:
|
||||
|
||||
00000000 <blksect>:
|
||||
0: 1234.*
|
||||
1: 4321.*
|
|
@ -0,0 +1,72 @@
|
|||
*
|
||||
* Various sections directives
|
||||
* .bss, .data, .sect, .text, .usect
|
||||
* .align, .space, .bes
|
||||
*
|
||||
; default section (should be .text)
|
||||
.word 0x1234 ; this should be put in .text
|
||||
|
||||
; initialized data
|
||||
.data
|
||||
.global coeff
|
||||
coeff .word 011h,022h,033h
|
||||
|
||||
; uninitialized data
|
||||
.global B1, buffer
|
||||
.bss buffer, 10
|
||||
B1: .usect ".bss", 10 ; alocate 10 words
|
||||
|
||||
; more initialized data in .data
|
||||
.global ptr
|
||||
ptr .word 0123h
|
||||
|
||||
; .text section
|
||||
.text
|
||||
.global add, aloop
|
||||
add: ld 0fh,a
|
||||
aloop: sub #1,a
|
||||
bc aloop,ageq
|
||||
|
||||
; more initialized data into .data
|
||||
.data
|
||||
.global ivals
|
||||
ivals .word 0aah, 0bbh, 0cch
|
||||
|
||||
; define another section for more variables
|
||||
.global var2, inbuf, align2
|
||||
var2 .usect "newvars", 1 ; with quotes
|
||||
inbuf .usect newvars, 7, 1 ; w/o quotes, block 7 words
|
||||
align2 .usect newvars, 15, ,1 ; 15 words aligned
|
||||
|
||||
; more code
|
||||
.text
|
||||
.global mpy, mloop
|
||||
mpy: ld 0ah,b
|
||||
mloop: mpy #0ah,b
|
||||
bc mloop,bnov
|
||||
.global space, bes, spacep, besp
|
||||
space: .space 64 ; points to first word of block
|
||||
bes: .bes 64 ; points to last word of block
|
||||
spacep: .word space
|
||||
besp: .word bes
|
||||
.global pk1, pk2, pk3, endpk1, endpk2, endpk3
|
||||
pk1: .space 20
|
||||
endpk1: .space 12
|
||||
pk2: .bes 20
|
||||
endpk2 .bes 12
|
||||
pk3: .space 20
|
||||
endpk3: .bes 12
|
||||
; named initialized section (TI assembler marks this as DATA, not CODE)
|
||||
.sect "vectors"
|
||||
.word 011h, 033h
|
||||
|
||||
; named, initialized section, no quotes (TI assembler marks as DATA)
|
||||
.sect clink
|
||||
.clink ; mark section clink as STYP_CLINK
|
||||
.word 022h, 044h
|
||||
|
||||
.sect "blksect" ; (TI assembler marks this as DATA)
|
||||
.word 0x1234,0x4321
|
||||
.sblock "blksect", vectors ; set block flag on blksect and vectors
|
||||
|
||||
.end
|
|
@ -0,0 +1,16 @@
|
|||
#objdump: -d
|
||||
#name: c54x set/equ directive
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: 7711.*
|
||||
1: 0056.*
|
||||
2: f000.*
|
||||
3: 0035.*
|
||||
|
||||
00000004 <LABEL>:
|
||||
4: 000a.*
|
||||
5: 0035.*
|
|
@ -0,0 +1,13 @@
|
|||
* symbol .set value
|
||||
* symbol .equ value
|
||||
* These two are completely interchangeable
|
||||
.global AUX_R1, INDEX, LABEL, SYMTAB, NSYMS
|
||||
AUX_R1 .set AR1
|
||||
STM #56h, AUX_R1
|
||||
INDEX .equ 100/2 +3
|
||||
ADD #INDEX,A
|
||||
LABEL .word 10
|
||||
SYMTAB .set LABEL + 1
|
||||
NSYMS .set INDEX
|
||||
.word NSYMS
|
||||
.end
|
|
@ -0,0 +1,15 @@
|
|||
#objdump: -d
|
||||
#name: c54x struct/union directive
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: 0001.*
|
||||
1: 0002.*
|
||||
2: 8002.*
|
||||
3: 0104.*
|
||||
4: 0046.*
|
||||
5: f030.*
|
||||
6: 007f.*
|
|
@ -0,0 +1,44 @@
|
|||
* .struct
|
||||
* .union
|
||||
* .tag
|
||||
REAL_REC .struct ; stag = REAL_REC
|
||||
NUM .int ; NUM = 0
|
||||
DEN .int ; DEN = 1
|
||||
REAL_LEN .endstruct ; REAL_LEN = 2
|
||||
|
||||
add REAL + REAL_REC.DEN, a ; 000000 0001
|
||||
.bss REAL, REAL_LEN ; 000000 0000 (len = 2)
|
||||
|
||||
CPLX_REC .struct
|
||||
REALI .tag REAL_REC
|
||||
IMAGI .tag REAL_REC
|
||||
CPLX_LEN .endstruct
|
||||
; apply the CPLX_REC structure format to .bss var COMPLEX
|
||||
|
||||
.bss COMPLEX, CPLX_LEN ; 000002 0000 (len = 4)
|
||||
COMPLEX .tag CPLX_REC
|
||||
add COMPLEX.REALI, a ; 000001 0002
|
||||
stl a, COMPLEX.REALI ; 000002 8002
|
||||
add COMPLEX.IMAGI, b ; 000003 0104
|
||||
|
||||
; anonymous struct; symbols become global
|
||||
.struct
|
||||
X .int
|
||||
Y .int
|
||||
Z .int
|
||||
.endstruct
|
||||
|
||||
BIT_REC .struct
|
||||
STREAM .string 64 ;
|
||||
BIT7 .field 7 ; bit7 = 64
|
||||
BIT9 .field 9 ; bit9 = 64
|
||||
BIT10 .field 10 ; bit10 = 65
|
||||
X_INT .int ; x_int = 66
|
||||
BIT_LEN .endstruct ; bit_len = 67
|
||||
|
||||
.bss BITS, BIT_LEN ; 000006 0000 (len = 67)
|
||||
BITS .tag BIT_REC
|
||||
add BITS.BIT7,a ; 000004 0046
|
||||
and #007Fh, a ; 000005 f030
|
||||
; 000006 007f
|
||||
.end
|
|
@ -0,0 +1,39 @@
|
|||
#objdump: -d
|
||||
#name: c54x subsyms
|
||||
|
||||
.*: +file format .*c54x.*
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <.text>:
|
||||
0: 0018.*
|
||||
|
||||
00000001 <label>:
|
||||
1: 0005.*
|
||||
2: 0005.*
|
||||
3: 0006.*
|
||||
4: 0000.*
|
||||
5: 0002.*
|
||||
6: 0002.*
|
||||
7: 0000.*
|
||||
8: 0001.*
|
||||
9: 0000.*
|
||||
a: 0001.*
|
||||
b: 0001.*
|
||||
c: 0002.*
|
||||
d: 0003.*
|
||||
e: 0001.*
|
||||
f: 0001.*
|
||||
10: 0002.*
|
||||
11: 0003.*
|
||||
12: 0004.*
|
||||
13: 0005.*
|
||||
14: 0000.*
|
||||
15: 0000.*
|
||||
16: 0000.*
|
||||
17: 0001.*
|
||||
|
||||
00000018 <x>:
|
||||
18: 0001.*
|
||||
19: 0001.*
|
||||
...
|
|
@ -0,0 +1,55 @@
|
|||
*
|
||||
* String substitution symbols
|
||||
*
|
||||
; if no quotes, interpret as subsymbol
|
||||
; if quotes, interpret as string, and do forced substitution
|
||||
.sslist
|
||||
.asg value,SYMBOL
|
||||
.asg SYMBOL,SYMBOL1
|
||||
|
||||
.global label, x
|
||||
.word x
|
||||
|
||||
* Substitution symbol functions
|
||||
label: .word $symlen(SYMBOL) ; 5, substitutes string for symbol
|
||||
.word $symlen(":SYMBOL:") ; 5, forced substitution
|
||||
.word $symlen("SYMBOL") ; 6, uses string directly
|
||||
|
||||
.word $symcmp(SYMBOL,"value") ; 0
|
||||
|
||||
; requires 2nd arg to be a character; zero if not found
|
||||
.word $firstch(":SYMBOL:",'a') ; 2
|
||||
.word $lastch(SYMBOL,'a') ; 2
|
||||
|
||||
.word $isdefed(SYMBOL) ; 0 (value not in symtab)
|
||||
.word $isdefed("label") ; 1 (string contents in symtab)
|
||||
.word $isdefed("unknown") ; 0
|
||||
|
||||
.asg "1,2,3", list
|
||||
; both args must be identifiers
|
||||
.word $ismember(SYMBOL,list) ; 1
|
||||
.word SYMBOL ; now 1
|
||||
.word list ; now 2,3
|
||||
|
||||
.word $iscons("010b") ; 1
|
||||
.word $iscons("11111111B") ; 1
|
||||
.word $iscons("011") ; 2 (5 -- TI bug)
|
||||
.word $iscons("0x10") ; 3 (0 -- TI bug)
|
||||
.word $iscons("'a'") ; 4
|
||||
.word $iscons(SYMBOL) ; 5 ("1")
|
||||
.word $iscons("SYMBOL") ; 0
|
||||
|
||||
.word $isname(SYMBOL) ; 0
|
||||
|
||||
.word $isreg(SYMBOL) ; 0
|
||||
.word $isreg("AR0") ;
|
||||
; .word $isreg("AG") ; should be 0, but we always
|
||||
; use mmregs
|
||||
.mmregs
|
||||
x .word $isreg("AG") ; 1 if .mmregs, 0 otherwise
|
||||
tag .struct 10
|
||||
.word 1
|
||||
.endstruct
|
||||
.word $structsz(tag)
|
||||
.word $structacc(tag) ; this op is unspecified
|
||||
.end
|
|
@ -0,0 +1,10 @@
|
|||
*
|
||||
* String substitution symbol recursion
|
||||
*
|
||||
* Recursive substitution symbols
|
||||
; recursion should stop at x
|
||||
.asg "x",z
|
||||
.asg "z",y
|
||||
.asg "y",x
|
||||
add x, A ; add x, A
|
||||
.end
|
|
@ -0,0 +1,30 @@
|
|||
#
|
||||
# TI TMS320C54X tests.
|
||||
#
|
||||
if [istarget *c54x*-*-*] then {
|
||||
run_dump_test "address"
|
||||
run_dump_test "addrfar"
|
||||
run_dump_test "align"
|
||||
run_dump_test "asg"
|
||||
run_dump_test "cons"
|
||||
run_dump_test "consfar"
|
||||
run_dump_test "extaddr"
|
||||
run_dump_test "field"
|
||||
run_dump_test "labels"
|
||||
run_dump_test "loop"
|
||||
run_dump_test "lp"
|
||||
run_dump_test "macro"
|
||||
run_dump_test "math"
|
||||
run_dump_test "opcodes"
|
||||
run_dump_test "sections"
|
||||
run_dump_test "set"
|
||||
run_dump_test "struct"
|
||||
run_dump_test "subsym"
|
||||
|
||||
gas_test_error "macro1.s" "" "c54x macro argument manipulation"
|
||||
gas_test_error "subsym1.s" "" "c54x subsym recursion"
|
||||
|
||||
# The longest one, run it last
|
||||
run_dump_test "all-opcodes"
|
||||
}
|
||||
|
Loading…
Reference in New Issue