* config/{tc-alpha.h, tc-arc.h, tc-d10v.h, tc-generic.h, tc-i960.h,
[deliverable/binutils-gdb.git] / gas / config / tc-tic80.c
1 /* tc-tic80.c -- Assemble for the TI TMS320C80 (MV)
2 Copyright (C) 1996 Free Software Foundation, Inc.
3
4 This file is part of GAS, the GNU Assembler.
5
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA. */
20
21 #include "as.h"
22 #include "opcode/tic80.h"
23
24 #define internal_error(what) \
25 as_fatal("internal error:%s:%d: %s\n",__FILE__,__LINE__,what)
26 #define internal_error_a(what,arg) \
27 as_fatal("internal error:%s:%d: %s %d\n",__FILE__,__LINE__,what,arg)
28
29 \f
30 /* Generic assembler global variables which must be defined by all targets. */
31
32 /* Characters which always start a comment. */
33 const char comment_chars[] = ";";
34
35 /* Characters which start a comment at the beginning of a line. */
36 const char line_comment_chars[] = ";*";
37
38 /* Characters which may be used to separate multiple commands on a single
39 line. The semicolon is such a character by default and should not be
40 explicitly listed. */
41 const char line_separator_chars[] = "";
42
43 /* Characters which are used to indicate an exponent in a floating
44 point number. */
45 const char EXP_CHARS[] = "eE";
46
47 /* Characters which mean that a number is a floating point constant,
48 as in 0d1.0. */
49 const char FLT_CHARS[] = "dD";
50
51 /* This table describes all the machine specific pseudo-ops the assembler
52 has to support. The fields are:
53
54 pseudo-op name without dot
55 function to call to execute this pseudo-op
56 integer arg to pass to the function */
57
58 const pseudo_typeS md_pseudo_table[] =
59 {
60 {"word", cons, 4}, /* FIXME: Should this be machine independent? */
61 { NULL, NULL, 0 }
62 };
63
64 /* Opcode hash table. */
65 static struct hash_control *tic80_hash;
66
67 static struct tic80_opcode * find_opcode PARAMS ((struct tic80_opcode *, expressionS []));
68 static void build_insn PARAMS ((struct tic80_opcode *, expressionS *));
69 static int get_operands PARAMS ((expressionS exp[]));
70 static int const_overflow PARAMS ((unsigned long num, int bits, int flags));
71
72 \f
73 int
74 md_estimate_size_before_relax (fragP, segment_type)
75 fragS *fragP;
76 segT segment_type;
77 {
78 internal_error ("Relaxation is a luxury we can't afford");
79 return (-1);
80 }
81
82 /* We have no need to default values of symbols. */
83
84 /* ARGSUSED */
85 symbolS *
86 md_undefined_symbol (name)
87 char *name;
88 {
89 return 0;
90 }
91
92 /* Turn a string in input_line_pointer into a floating point constant of type
93 type, and store the appropriate bytes in *litP. The number of LITTLENUMS
94 emitted is stored in *sizeP . An error message is returned, or NULL on OK.
95 */
96
97 #define MAX_LITTLENUMS 4
98
99 char *
100 md_atof (type, litP, sizeP)
101 int type;
102 char *litP;
103 int *sizeP;
104 {
105 int prec;
106 LITTLENUM_TYPE words[MAX_LITTLENUMS];
107 LITTLENUM_TYPE *wordP;
108 char *t;
109 char *atof_ieee ();
110
111 switch (type)
112 {
113 case 'f':
114 case 'F':
115 case 's':
116 case 'S':
117 prec = 2;
118 break;
119
120 case 'd':
121 case 'D':
122 case 'r':
123 case 'R':
124 prec = 4;
125 break;
126
127 default:
128 *sizeP = 0;
129 return "bad call to md_atof ()";
130 }
131
132 t = atof_ieee (input_line_pointer, type, words);
133 if (t)
134 {
135 input_line_pointer = t;
136 }
137
138 *sizeP = prec * sizeof (LITTLENUM_TYPE);
139
140 for (wordP = words; prec--;)
141 {
142 md_number_to_chars (litP, (valueT) (*wordP++), sizeof (LITTLENUM_TYPE));
143 litP += sizeof (LITTLENUM_TYPE);
144 }
145 return (NULL);
146 }
147
148 /* Check to see if the constant value in NUM will fit in a field of
149 width BITS if it has flags FLAGS. */
150
151 static int
152 const_overflow (num, bits, flags)
153 unsigned long num;
154 int bits;
155 int flags;
156 {
157 long min, max;
158 int retval = 0;
159
160 /* Only need to check fields less than 32 bits wide */
161 if (bits < 32)
162 if (flags & TIC80_OPERAND_SIGNED)
163 {
164 max = (1 << (bits - 1)) - 1;
165 min = - (1 << (bits - 1));
166 retval = ((long) num > max) || ((long) num < min);
167 }
168 else
169 {
170 max = (1 << bits) - 1;
171 min = 0;
172 retval = (num > max) || (num < min);
173 }
174 return (retval);
175 }
176
177 /* get_operands() parses a string of operands and fills in a passed array of
178 expressions in EXP.
179
180 Note that we use O_absent expressions to record additional information
181 about the previous non-O_absent expression, such as ":m" or ":s"
182 modifiers or register numbers enclosed in parens like "(r10)".
183
184 Returns the number of expressions that were placed in EXP.
185
186 */
187
188 static int
189 get_operands (exp)
190 expressionS exp[];
191 {
192 char *p = input_line_pointer;
193 int numexp = 0;
194 int mflag = 0;
195 int sflag = 0;
196 int parens = 0;
197
198 while (*p)
199 {
200 /* Skip leading whitespace */
201 while (*p == ' ' || *p == '\t' || *p == ',')
202 {
203 p++;
204 }
205
206 /* Check to see if we have any operands left to parse */
207 if (*p == 0 || *p == '\n' || *p == '\r')
208 {
209 break;
210 }
211
212 /* Notice scaling or direct memory operand modifiers and save them in
213 an O_absent expression after the expression that they modify. */
214
215 if (*p == ':')
216 {
217 p++;
218 exp[numexp].X_op = O_absent;
219 if (*p == 'm')
220 {
221 p++;
222 exp[numexp].X_add_number = TIC80_OPERAND_M_SI | TIC80_OPERAND_M_LI;
223 }
224 else if (*p == 's')
225 {
226 p++;
227 exp[numexp].X_add_number = TIC80_OPERAND_SCALED;
228 }
229 else
230 {
231 as_bad ("':' not followed by 'm' or 's'");
232 }
233 numexp++;
234 continue;
235 }
236
237 /* Handle leading '(' on operands that use them, by recording that we
238 have entered a paren nesting level and then continuing. We complain
239 about multiple nesting. */
240
241 if (*p == '(')
242 {
243 if (++parens != 1)
244 {
245 as_bad ("paren nesting");
246 }
247 p++;
248 continue;
249 }
250
251 /* Handle trailing ')' on operands that use them, by reducing the
252 nesting level and then continuing. We complain if there were too
253 many closures. */
254
255 if (*p == ')')
256 {
257 /* Record that we have left a paren group and continue */
258 if (--parens < 0)
259 {
260 as_bad ("mismatched parenthesis");
261 }
262 p++;
263 continue;
264 }
265
266 /* Begin operand parsing at the current scan point. */
267
268 input_line_pointer = p;
269 expression (&exp[numexp]);
270
271 if (exp[numexp].X_op == O_illegal)
272 {
273 as_bad ("illegal operand");
274 }
275 else if (exp[numexp].X_op == O_absent)
276 {
277 as_bad ("missing operand");
278 }
279
280 numexp++;
281 p = input_line_pointer;
282 }
283
284 if (parens)
285 {
286 exp[numexp].X_op = O_absent;
287 exp[numexp++].X_add_number = TIC80_OPERAND_PARENS;
288 }
289
290 /* Mark the end of the valid operands with an illegal expression. */
291 exp[numexp].X_op = O_illegal;
292
293 return (numexp);
294 }
295
296 /* find_opcode() gets a pointer to the entry in the opcode table that
297 matches the instruction being assembled, or returns NULL if no such match
298 is found.
299
300 First it parses all the operands and save them as expressions. Note that
301 we use O_absent expressions to record additional information about the
302 previous non-O_absent expression, such as ":m" or ":s" modifiers or
303 register numbers enclosed in parens like "(r10)".
304
305 It then looks at all opcodes with the same name and uses the operands to
306 choose the correct opcode. */
307
308 static struct tic80_opcode *
309 find_opcode (opcode, myops)
310 struct tic80_opcode *opcode;
311 expressionS myops[];
312 {
313 int numexp; /* Number of expressions from parsing operands */
314 int expi; /* Index of current expression to match */
315 int opi; /* Index of current operand to match */
316 int match = 0; /* Set to 1 when an operand match is found */
317 struct tic80_opcode *opc = opcode; /* Pointer to current opcode table entry */
318 const struct tic80_opcode *end; /* Pointer to end of opcode table */
319
320 /* First parse all the operands so we only have to do it once. There may
321 be more expressions generated than there are operands. */
322
323 numexp = get_operands (myops);
324
325 /* For each opcode with the same name, try to match it against the parsed
326 operands. */
327
328 end = tic80_opcodes + tic80_num_opcodes;
329 while (!match && (opc < end) && (strcmp (opc -> name, opcode -> name) == 0))
330 {
331 /* Start off assuming a match. If we find a mismatch, then this is
332 reset and the operand/expr matching loop terminates with match
333 equal to zero, which allows us to try the next opcode. */
334
335 match = 1;
336
337 /* For each expression, try to match it against the current operand
338 for the current opcode. Upon any mismatch, we abandon further
339 matching for the current opcode table entry. */
340
341 for (expi = 0, opi = -1; (expi < numexp) && match; expi++)
342 {
343 int bits, flags, X_op, num;
344
345 X_op = myops[expi].X_op;
346 num = myops[expi].X_add_number;
347 if (X_op != O_absent)
348 {
349 /* The O_absent expressions apply to the previously seen
350 operand, so only increment the operand index when the
351 current expression needs to be matched against the next
352 operand. */
353 opi++;
354 }
355 flags = tic80_operands[opc -> operands[opi]].flags;
356 bits = tic80_operands[opc -> operands[opi]].bits;
357
358 switch (X_op)
359 {
360 case O_register:
361 /* Also check that registers that are supposed to be even actually
362 are even. */
363 if (((flags & TIC80_OPERAND_GPR) != (num & TIC80_OPERAND_GPR)) ||
364 ((flags & TIC80_OPERAND_FPA) != (num & TIC80_OPERAND_FPA)) ||
365 ((flags & TIC80_OPERAND_CR) != (num & TIC80_OPERAND_CR)) ||
366 ((flags & TIC80_OPERAND_EVEN) && (num & 1)) ||
367 const_overflow (num & ~TIC80_OPERAND_MASK, bits, flags))
368 {
369 match = 0;
370 }
371 break;
372 case O_constant:
373 if ((flags & TIC80_OPERAND_ENDMASK) && (num == 32))
374 {
375 /* Endmask values of 0 and 32 give identical results */
376 num = 0;
377 }
378 if ((flags & (TIC80_OPERAND_FPA | TIC80_OPERAND_GPR)) ||
379 const_overflow (num, bits, flags))
380 {
381 match = 0;
382 }
383 break;
384 case O_illegal:
385 case O_absent:
386 case O_symbol:
387 case O_symbol_rva:
388 case O_big:
389 case O_uminus:
390 case O_bit_not:
391 case O_logical_not:
392 case O_multiply:
393 case O_divide:
394 case O_modulus:
395 case O_left_shift:
396 case O_right_shift:
397 case O_bit_inclusive_or:
398 case O_bit_or_not:
399 case O_bit_exclusive_or:
400 case O_bit_and:
401 case O_add:
402 case O_subtract:
403 case O_eq:
404 case O_ne:
405 case O_lt:
406 case O_le:
407 case O_ge:
408 case O_gt:
409 case O_logical_and:
410 case O_logical_or:
411 case O_max:
412 default:
413 internal_error_a ("unhandled expression type", X_op);
414 }
415 }
416 if (!match)
417 {
418 opc++;
419 }
420 }
421
422 return (match ? opc : NULL);
423
424 #if 0
425
426 /* Now search the opcode table table for one with operands that
427 matches what we've got. */
428
429 while (!match)
430 {
431 match = 1;
432 for (i = 0; opcode -> operands[i]; i++)
433 {
434 int flags = tic80_operands[opcode->operands[i]].flags;
435 int X_op = myops[i].X_op;
436 int num = myops[i].X_add_number;
437
438 if (X_op == 0)
439 {
440 match = 0;
441 break;
442 }
443
444 if (flags & (TIC80_OPERAND_GPR | TIC80_OPERAND_FPA | TIC80_OPERAND_CR))
445 {
446 if ((X_op != O_register) ||
447 ((flags & TIC80_OPERAND_GPR) != (num & TIC80_OPERAND_GPR)) ||
448 ((flags & TIC80_OPERAND_FPA) != (num & TIC80_OPERAND_FPA)) ||
449 ((flags & TIC80_OPERAND_CR) != (num & TIC80_OPERAND_CR)))
450 {
451 match=0;
452 break;
453 }
454 }
455
456 if (((flags & TIC80_OPERAND_MINUS) && ((X_op != O_absent) || (num != TIC80_OPERAND_MINUS))) ||
457 ((flags & TIC80_OPERAND_PLUS) && ((X_op != O_absent) || (num != TIC80_OPERAND_PLUS))) ||
458 ((flags & TIC80_OPERAND_ATMINUS) && ((X_op != O_absent) || (num != TIC80_OPERAND_ATMINUS))) ||
459 ((flags & TIC80_OPERAND_ATPAR) && ((X_op != O_absent) || (num != TIC80_OPERAND_ATPAR))) ||
460 ((flags & TIC80_OPERAND_ATSIGN) && ((X_op != O_absent) || (num != TIC80_OPERAND_ATSIGN))))
461 {
462 match=0;
463 break;
464 }
465 }
466 /* we're only done if the operands matched so far AND there
467 are no more to check */
468 if (match && myops[i].X_op==0)
469 break;
470 else
471 match = 0;
472
473 next_opcode = opcode+1;
474 if (next_opcode->opcode == 0)
475 break;
476 if (strcmp(next_opcode->name, opcode->name))
477 break;
478 opcode = next_opcode;
479 }
480
481 if (!match)
482 {
483 as_bad ("bad opcode or operands");
484 return (0);
485 }
486
487 /* Check that all registers that are required to be even are. */
488 /* Also, if any operands were marked as registers, but were really symbols */
489 /* fix that here. */
490 for (i=0; opcode->operands[i]; i++)
491 {
492 if ((tic80_operands[opcode->operands[i]].flags & TIC80_OPERAND_EVEN) &&
493 (myops[i].X_add_number & 1))
494 as_fatal ("Register number must be EVEN");
495 if (myops[i].X_op == O_register)
496 {
497 if (!(tic80_operands[opcode->operands[i]].flags & TIC80_OPERAND_REG))
498 {
499 myops[i].X_op = O_symbol;
500 myops[i].X_add_symbol = symbol_find_or_make ((char *)myops[i].X_op_symbol);
501 myops[i].X_add_number = 0;
502 myops[i].X_op_symbol = NULL;
503 }
504 }
505 }
506
507 #endif
508 }
509
510 /* build_insn takes a pointer to the opcode entry in the opcode table
511 and the array of operand expressions and writes out the instruction. */
512
513 static void
514 build_insn (opcode, opers)
515 struct tic80_opcode *opcode;
516 expressionS *opers;
517 {
518 int expi; /* Index of current expression to match */
519 int opi; /* Index of current operand to match */
520 unsigned long insn[2]; /* Instruction and long immediate (if any) */
521 int extended = 0; /* Nonzero if instruction is 8 bytes */
522 char *f; /* Temporary pointer to output location */
523
524 /* Start with the raw opcode bits from the opcode table. */
525 insn[0] = opcode -> opcode;
526
527 /* For each operand expression, insert the appropriate bits into the
528 instruction . */
529 for (expi = 0, opi = -1; opers[expi].X_op != O_illegal; expi++)
530 {
531 int bits, shift, flags, X_op, num;
532
533 X_op = opers[expi].X_op;
534 num = opers[expi].X_add_number;
535 if (X_op != O_absent)
536 {
537 /* The O_absent expressions apply to the previously seen
538 operand, so only increment the operand index when the
539 current expression needs to be matched against the next
540 operand. */
541 opi++;
542 }
543 else
544 {
545 /* Found a modifier that applies to the previously
546 seen operand, so handle it. */
547 switch (opers[expi].X_add_number)
548 {
549 case TIC80_OPERAND_M_SI | TIC80_OPERAND_M_LI:
550 internal_error_a ("unhandled operand modifier", opers[expi].X_add_number);
551 break;
552 case TIC80_OPERAND_SCALED:
553 internal_error_a ("unhandled operand modifier", opers[expi].X_add_number);
554 break;
555 case TIC80_OPERAND_PARENS:
556 internal_error_a ("unhandled operand modifier", opers[expi].X_add_number);
557 break;
558 default:
559 internal_error_a ("unhandled operand modifier", opers[expi].X_add_number);
560 break;
561 }
562 }
563 flags = tic80_operands[opcode -> operands[opi]].flags;
564 bits = tic80_operands[opcode -> operands[opi]].bits;
565 shift = tic80_operands[opcode -> operands[opi]].shift;
566
567 switch (X_op)
568 {
569 case O_register:
570 num &= ~TIC80_OPERAND_MASK;
571 insn[0] = insn[0] | (num << shift);
572 break;
573 case O_constant:
574 if ((flags & TIC80_OPERAND_ENDMASK) && (num == 32))
575 {
576 /* Endmask values of 0 and 32 give identical results */
577 num = 0;
578 }
579 /* Mask off upper bits, just it case it is signed and is negative */
580 if (bits < 32)
581 {
582 num &= (1 << bits) - 1;
583 insn[0] = insn[0] | (num << shift);
584 }
585 else
586 {
587 extended++;
588 insn[1] = num;
589 }
590 break;
591 case O_illegal:
592 case O_absent:
593 case O_symbol:
594 case O_symbol_rva:
595 case O_big:
596 case O_uminus:
597 case O_bit_not:
598 case O_logical_not:
599 case O_multiply:
600 case O_divide:
601 case O_modulus:
602 case O_left_shift:
603 case O_right_shift:
604 case O_bit_inclusive_or:
605 case O_bit_or_not:
606 case O_bit_exclusive_or:
607 case O_bit_and:
608 case O_add:
609 case O_subtract:
610 case O_eq:
611 case O_ne:
612 case O_lt:
613 case O_le:
614 case O_ge:
615 case O_gt:
616 case O_logical_and:
617 case O_logical_or:
618 case O_max:
619 default:
620 internal_error_a ("unhandled expression", X_op);
621 break;
622 }
623 }
624
625 /* Write out the instruction, either 4 or 8 bytes. */
626
627 f = frag_more (4);
628 md_number_to_chars (f, insn[0], 4);
629 if (extended)
630 {
631 f = frag_more (4);
632 md_number_to_chars (f, insn[1], 4);
633 }
634 }
635
636 /* This is the main entry point for the machine-dependent assembler. Gas
637 calls this function for each input line which does not contain a
638 pseudoop.
639
640 STR points to a NULL terminated machine dependent instruction. This
641 function is supposed to emit the frags/bytes it assembles to. */
642
643 void
644 md_assemble (str)
645 char *str;
646 {
647 char *scan;
648 unsigned char *input_line_save;
649 struct tic80_opcode *opcode;
650 expressionS myops[16];
651 unsigned long insn;
652
653 /* Ensure there is something there to assemble. */
654 assert (str);
655
656 /* Drop any leading whitespace. */
657 while (isspace (*str))
658 {
659 str++;
660 }
661
662 /* Isolate the mnemonic from the rest of the string by finding the first
663 whitespace character and zapping it to a null byte. */
664 for (scan = str; *scan != '\000' && !isspace (*scan); scan++) {;}
665 if (*scan != '\000')
666 {
667 *scan++ = '\000';
668 }
669
670 /* Try to find this mnemonic in the hash table */
671 if ((opcode = (struct tic80_opcode *) hash_find (tic80_hash, str)) == NULL)
672 {
673 as_bad ("Invalid mnemonic: '%s'", str);
674 return;
675 }
676
677 str = scan;
678 while (isspace (*scan))
679 {
680 scan++;
681 }
682
683 input_line_save = input_line_pointer;
684 input_line_pointer = str;
685
686 opcode = find_opcode (opcode, myops);
687 if (opcode == NULL)
688 {
689 as_bad ("Invalid operands: '%s'", input_line_save);
690 }
691
692 input_line_pointer = input_line_save;
693 build_insn (opcode, myops);
694 }
695
696 /* This function is called once at the start of assembly, after the command
697 line arguments have been parsed and all the machine independent
698 initializations have been completed.
699
700 It should set up all the tables, etc., that the machine dependent part of
701 the assembler will need. */
702
703 void
704 md_begin ()
705 {
706 char *prev_name = "";
707 register const struct tic80_opcode *op;
708 register const struct tic80_opcode *op_end;
709 const struct predefined_symbol *pdsp;
710
711 tic80_hash = hash_new ();
712
713 /* Insert unique names into hash table. The TIc80 instruction set
714 has many identical opcode names that have different opcodes based
715 on the operands. This hash table then provides a quick index to
716 the first opcode with a particular name in the opcode table. */
717
718 op_end = tic80_opcodes + tic80_num_opcodes;
719 for (op = tic80_opcodes; op < op_end; op++)
720 {
721 if (strcmp (prev_name, op -> name) != 0)
722 {
723 prev_name = (char *) op -> name;
724 hash_insert (tic80_hash, op -> name, (char *) op);
725 }
726 }
727
728 /* Insert the predefined symbols into the symbol table. We use symbol_create
729 rather than symbol_new so that these symbols don't end up in the object
730 files' symbol table. Note that the values of the predefined symbols include
731 some upper bits that distinguish the type of the symbol (register, bitnum,
732 condition code, etc) and these bits must be masked away before actually
733 inserting the values into the instruction stream. For registers we put
734 these bits in the symbol table since we use them later and there is no
735 question that they aren't part of the register number. For constants we
736 can't do that since the constant can be any value, so they are masked off
737 before putting them into the symbol table. */
738
739 pdsp = NULL;
740 while ((pdsp = tic80_next_predefined_symbol (pdsp)) != NULL)
741 {
742 segT segment;
743 valueT valu;
744 int symtype;
745
746 symtype = PDS_VALUE (pdsp) & TIC80_OPERAND_MASK;
747 switch (symtype)
748 {
749 case TIC80_OPERAND_GPR:
750 case TIC80_OPERAND_FPA:
751 case TIC80_OPERAND_CR:
752 segment = reg_section;
753 valu = PDS_VALUE (pdsp);
754 break;
755 case TIC80_OPERAND_CC:
756 case TIC80_OPERAND_BITNUM:
757 segment = absolute_section;
758 valu = PDS_VALUE (pdsp) & ~TIC80_OPERAND_MASK;
759 break;
760 default:
761 internal_error_a ("unhandled predefined symbol bits", symtype);
762 break;
763 }
764 symbol_table_insert (symbol_create (PDS_NAME (pdsp), segment, valu,
765 &zero_address_frag));
766 }
767 }
768
769 \f
770
771 /* The assembler adds md_shortopts to the string passed to getopt. */
772
773 CONST char *md_shortopts = "";
774
775 /* The assembler adds md_longopts to the machine independent long options
776 that are passed to getopt. */
777
778 struct option md_longopts[] = {
779 {NULL, no_argument, NULL, 0}
780 };
781
782 size_t md_longopts_size = sizeof(md_longopts);
783
784 /* The md_parse_option function will be called whenever getopt returns an
785 unrecognized code, presumably indicating a special code value which
786 appears in md_longopts for machine specific command line options. */
787
788 int
789 md_parse_option (c, arg)
790 int c;
791 char *arg;
792 {
793 return (0);
794 }
795
796 /* The md_show_usage function will be called whenever a usage message is
797 printed. It should print a description of the machine specific options
798 found in md_longopts. */
799
800 void
801 md_show_usage (stream)
802 FILE *stream;
803 {
804 }
805
806 \f
807 /* Attempt to simplify or even eliminate a fixup. The return value is
808 ignored; perhaps it was once meaningful, but now it is historical.
809 To indicate that a fixup has been eliminated, set fixP->fx_done.
810 */
811
812 void
813 md_apply_fix (fixP, val)
814 fixS *fixP;
815 long val;
816 {
817 internal_error ("md_apply_fix() not implemented yet");
818 abort ();
819 }
820
821 \f
822 /* Functions concerning relocs. */
823
824 /* The location from which a PC relative jump should be calculated,
825 given a PC relative reloc. */
826
827 long
828 md_pcrel_from (fixP)
829 fixS *fixP;
830 {
831 internal_error ("md_pcrel_from() not implemented yet");
832 abort ();
833 }
834
835 /*
836 * Called after relax() is finished.
837 * In: Address of frag.
838 * fr_type == rs_machine_dependent.
839 * fr_subtype is what the address relaxed to.
840 *
841 * Out: Any fixSs and constants are set up.
842 * Caller will turn frag into a ".space 0".
843 */
844
845 void
846 md_convert_frag (headers, seg, fragP)
847 object_headers *headers;
848 segT seg;
849 fragS *fragP;
850 {
851 internal_error ("md_convert_frag() not implemented yet");
852 abort ();
853 }
854
855 \f
856 /*ARGSUSED*/
857 void
858 tc_coff_symbol_emit_hook (ignore)
859 symbolS *ignore;
860 {
861 }
862
863 #if defined OBJ_COFF
864
865 short
866 tc_coff_fix2rtype (fixP)
867 fixS *fixP;
868 {
869 internal_error ("tc_coff_fix2rtype() not implemented yet");
870 abort ();
871 }
872
873 #endif /* OBJ_COFF */
874
875 /* end of tc-tic80.c */
This page took 0.047576 seconds and 5 git commands to generate.