aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1998-11-12 18:55:57 +0000
committerNick Clifton <nickc@redhat.com>1998-11-12 18:55:57 +0000
commit5ed0e368c68e29254e12e74ae1223f683e23582b (patch)
tree2f76bca370f0fa5ff856d9fceddd64c7756781d9 /gas
parent78cec885d79dd24fb2ee05e4076688045fc7e908 (diff)
downloadgdb-5ed0e368c68e29254e12e74ae1223f683e23582b.zip
gdb-5ed0e368c68e29254e12e74ae1223f683e23582b.tar.gz
gdb-5ed0e368c68e29254e12e74ae1223f683e23582b.tar.bz2
Add code to support FR30 instrucitons which contain a colon in their mnemonic
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-fr30.c62
-rw-r--r--gas/config/tc-fr30.h11
3 files changed, 80 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index fc774fb..7b95694 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+Thu Nov 12 10:54:16 1998 Nick Clifton <nickc@cygnus.com>
+
+ * config/tc-fr30.c (fr30_is_label_start): New function: Handle
+ FR30 instructions which contain a colon in the mnemonic.
+
+ * config/tc-fr30.h (TC_START_LABEL): Define this macro.
+
start-sanitize-fr30
Wed Nov 11 09:58:21 1998 Nick Clifton <nickc@cygnus.com>
diff --git a/gas/config/tc-fr30.c b/gas/config/tc-fr30.c
index accb3895f..50cb233 100644
--- a/gas/config/tc-fr30.c
+++ b/gas/config/tc-fr30.c
@@ -557,3 +557,65 @@ md_atof (type, litP, sizeP)
return 0;
}
+/* Determines if the symbol starting at START and ending in
+ a colon that was at the location pointed to by INPUT_LINE_POINTER
+ (but which has now been replaced bu a NUL) is in fact an
+ LDI:8, LDI:20 or LDI:32 instruction. If it is, then it
+ restores the colon, adbvances INPUT_LINE_POINTER to the real end
+ of the instruction/symbol, and returns the character that really
+ terminated the symbol. Otherwise it returns 0. */
+char
+fr30_is_label_start (start)
+ char * start;
+{
+ char * i_l_p = input_line_pointer;
+ char c;
+
+ /* Check to see if the symbol parsed so far is 'ldi' */
+ if ( (start[0] != 'l' && start[0] != 'L')
+ || (start[1] != 'd' && start[1] != 'D')
+ || (start[2] != 'i' && start[2] != 'I')
+ || start[3] != 0)
+ return 0;
+
+ /* Check to see if the text following the colon is '8' */
+ if (i_l_p[1] == '8' && (i_l_p[2] == ' ' || i_l_p[2] == '\t'))
+ {
+ /* Restore the colon, and advance input_line_pointer to
+ the end of the new symbol. */
+ * i_l_p = ':';
+ input_line_pointer += 2;
+ c = * input_line_pointer;
+ * input_line_pointer = 0;
+
+ return c;
+ }
+
+ /* Check to see if the text following the colon is '20' */
+ if (i_l_p[1] == '2' && i_l_p[2] =='0' && (i_l_p[3] == ' ' || i_l_p[3] == '\t'))
+ {
+ /* Restore the colon, and advance input_line_pointer to
+ the end of the new symbol. */
+ * i_l_p = ':';
+ input_line_pointer += 3;
+ c = * input_line_pointer;
+ * input_line_pointer = 0;
+
+ return c;
+ }
+
+ /* Check to see if the text following the colon is '32' */
+ if (i_l_p[1] == '3' && i_l_p[2] =='2' && (i_l_p[3] == ' ' || i_l_p[3] == '\t'))
+ {
+ /* Restore the colon, and advance input_line_pointer to
+ the end of the new symbol. */
+ * i_l_p = ':';
+ input_line_pointer += 3;
+ c = * input_line_pointer;
+ * input_line_pointer = 0;
+
+ return c;
+ }
+
+ return 0;
+}
diff --git a/gas/config/tc-fr30.h b/gas/config/tc-fr30.h
index 55cb736..87be397 100644
--- a/gas/config/tc-fr30.h
+++ b/gas/config/tc-fr30.h
@@ -73,3 +73,14 @@ extern long md_pcrel_from_section PARAMS ((struct fix *, segT));
#define TC_GENERIC_RELAX_TABLE md_relax_table
extern const struct relax_type md_relax_table[];
+/* We need a special version of the TC_START_LABEL macro so that we
+ allow the LDI:8, LDI:20 and LDI:32 instructions to be parsed as
+ such. Note - in a HORRIBLE HACK, we make use of the knowledge that
+ this marco is only ever evaluated in one place (read_a_source_file
+ in read.c) where we can access the local variable 's' - the start
+ of the symbol that was terminated by 'character'. Also we need to
+ be able to change the contents of the local variable 'c' which is
+ passed to this macro as 'character'. */
+#define TC_START_LABEL(character, i_l_p) \
+ ((character) != ':' ? 0 : (character = fr30_is_label_start (s)) ? 0 : ((character = ':'), 1))
+extern char fr30_is_label_start PARAMS ((char *));