From 8d9cd6b19b78f2a0cd3df40b52b13062e72e41b7 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 24 Apr 2003 12:36:08 +0000 Subject: Add support for h8300hn and h8300sn --- gas/ChangeLog | 7 +++++++ gas/app.c | 2 +- gas/config/tc-h8300.c | 31 +++++++++++++++++++++++++++++++ gas/config/tc-h8300.h | 3 ++- gas/doc/c-h8300.texi | 19 +++++++++++++++++-- 5 files changed, 58 insertions(+), 4 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index fde70ed..285877d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2003-04-24 Dhananjay Deshpande + + * config/tc-h8300.c (Nmode, h8300hnmode, h8300snmode): New. + (md_pseudo_table): Add h8300hn, h8300sn. + * config/tc-h8300.h (COFF_MAGIC): Handle h8300hn, h8300sn. + * doc/c-h8300.texi : Add documentation for new machine directives. + 2003-04-24 Nick Clifton * config/tc-ppc.c (ppc_symbol_chars): Define. diff --git a/gas/app.c b/gas/app.c index 57bc808..b1e5f4c 100644 --- a/gas/app.c +++ b/gas/app.c @@ -27,7 +27,7 @@ pair. This needs better error-handling. */ #include -#include "as.h" /* For BAD_CASE() only */ +#include "as.h" /* For BAD_CASE() only. */ #if (__STDC__ != 1) #ifndef const diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c index 21051e0..037a84c 100644 --- a/gas/config/tc-h8300.c +++ b/gas/config/tc-h8300.c @@ -42,10 +42,13 @@ void cons PARAMS ((int)); void sbranch PARAMS ((int)); void h8300hmode PARAMS ((int)); void h8300smode PARAMS ((int)); +void h8300hnmode PARAMS ((int)); +void h8300snmode PARAMS ((int)); static void pint PARAMS ((int)); int Hmode; int Smode; +int Nmode; #define PSIZE (Hmode ? L_32 : L_16) #define DMODE (L_16) @@ -89,6 +92,32 @@ h8300smode (arg) } void +h8300hnmode (arg) + int arg ATTRIBUTE_UNUSED; +{ + Hmode = 1; + Smode = 0; + Nmode = 1; +#ifdef BFD_ASSEMBLER + if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300hn)) + as_warn (_("could not set architecture and machine")); +#endif +} + +void +h8300snmode (arg) + int arg ATTRIBUTE_UNUSED; +{ + Smode = 1; + Hmode = 1; + Nmode = 1; +#ifdef BFD_ASSEMBLER + if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300sn)) + as_warn (_("could not set architecture and machine")); +#endif +} + +void sbranch (size) int size; { @@ -111,7 +140,9 @@ pint (arg) const pseudo_typeS md_pseudo_table[] = { {"h8300h", h8300hmode, 0}, + {"h8300hn", h8300hnmode, 0}, {"h8300s", h8300smode, 0}, + {"h8300sn", h8300snmode, 0}, {"sbranch", sbranch, L_8}, {"lbranch", sbranch, L_16}, diff --git a/gas/config/tc-h8300.h b/gas/config/tc-h8300.h index 2da3f66..e09e506 100644 --- a/gas/config/tc-h8300.h +++ b/gas/config/tc-h8300.h @@ -45,7 +45,7 @@ struct internal_reloc; #define TC_COFF_FIX2RTYPE(fixP) abort (); #define BFD_ARCH bfd_arch_h8300 -#define COFF_MAGIC ( Smode ? 0x8302 : Hmode ? 0x8301 : 0x8300) +#define COFF_MAGIC ( Smode && Nmode ? 0x8304 : Hmode && Nmode ? 0x8303 : Smode ? 0x8302 : Hmode ? 0x8301 : 0x8300) #define TC_COUNT_RELOC(x) (1) #define IGNORE_NONSTANDARD_ESCAPES @@ -92,5 +92,6 @@ extern void tc_reloc_mangle extern int Hmode; extern int Smode; +extern int Nmode; #define md_operand(x) diff --git a/gas/doc/c-h8300.texi b/gas/doc/c-h8300.texi index cf3c213..4ea8383 100644 --- a/gas/doc/c-h8300.texi +++ b/gas/doc/c-h8300.texi @@ -134,8 +134,8 @@ with other development tools. @cindex machine directives, H8/300 (none) @cindex @code{word} directive, H8/300 @cindex @code{int} directive, H8/300 -@code{@value{AS}} has only one machine-dependent directive for the -H8/300: +@code{@value{AS}} has the following machine-dependent directives for +the H8/300: @table @code @cindex H8/300H, assembling for @@ -143,6 +143,21 @@ H8/300: Recognize and emit additional instructions for the H8/300H variant, and also make @code{.int} emit 32-bit numbers rather than the usual (16-bit) for the H8/300 family. + +@item .h8300s +Recognize and emit additional instructions for the H8S variant, and +also make @code{.int} emit 32-bit numbers rather than the usual (16-bit) +for the H8/300 family. + +@item .h8300hn +Recognize and emit additional instructions for the H8/300H variant in +normal mode, and also make @code{.int} emit 32-bit numbers rather than +the usual (16-bit) for the H8/300 family. + +@item .h8300sn +Recognize and emit additional instructions for the H8S variant in +normal mode, and also make @code{.int} emit 32-bit numbers rather than +the usual (16-bit) for the H8/300 family. @end table On the H8/300 family (including the H8/300H) @samp{.word} directives -- cgit v1.1