Back to index

cell-binutils  2.17cvs20070401
Defines | Functions
tc-z80.h File Reference

Go to the source code of this file.

Defines

#define TARGET_ARCH   bfd_arch_z80
#define BFD_ARCH   TARGET_ARCH
#define COFF_MAGIC   0x5A80
#define TARGET_MACH   0
#define TARGET_BYTES_BIG_ENDIAN   0
#define ONLY_STANDARD_ESCAPES
#define md_operand(x)
#define md_number_to_chars   number_to_chars_littleendian
#define TC_COUNT_RELOC(x)   1
#define TC_COFF_FIX2RTYPE(fixP)   tc_coff_fix2rtype (fixP)
#define md_convert_frag(b, s, f)   as_fatal ("convert_frag called\n")
#define md_estimate_size_before_relax(f, s)   (as_fatal (_("estimate_size_before_relax called")), 1)
#define md_end   z80_md_end
#define md_start_line_hook()   { if (z80_start_line_hook ()) continue; }
#define TC_CONS_FIX_NEW   z80_cons_fix_new
#define WORKING_DOT_WORD
#define EXTERN_FORCE_RELOC   0
#define MD_APPLY_SYM_VALUE(FIX)   0
#define LISTING_WORD_SIZE   2
#define O_SINGLE_EQ   O_eq
#define DOLLAR_DOT
#define DOLLAR_AMBIGU   1
#define LOCAL_LABELS_FB   1
#define LITERAL_PREFIXPERCENT_BIN
#define NUMBERS_WITH_SUFFIX   1
#define NO_PSEUDO_DOT   1
#define SINGLE_QUOTE_STRINGS
#define NO_STRING_ESCAPES
#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR)   (P2VAR) = 0

Functions

void z80_md_end (void)
int z80_start_line_hook (void)
void z80_cons_fix_new (fragS *, int, int, expressionS *)

Define Documentation

#define BFD_ARCH   TARGET_ARCH

Definition at line 27 of file tc-z80.h.

#define COFF_MAGIC   0x5A80

Definition at line 28 of file tc-z80.h.

#define DOLLAR_AMBIGU   1

Definition at line 86 of file tc-z80.h.

#define DOLLAR_DOT

Definition at line 85 of file tc-z80.h.

#define EXTERN_FORCE_RELOC   0

Definition at line 74 of file tc-z80.h.

#define LISTING_WORD_SIZE   2

Definition at line 79 of file tc-z80.h.

Definition at line 88 of file tc-z80.h.

#define LOCAL_LABELS_FB   1

Definition at line 87 of file tc-z80.h.

#define MD_APPLY_SYM_VALUE (   FIX)    0

Definition at line 77 of file tc-z80.h.

#define md_convert_frag (   b,
  s,
  f 
)    as_fatal ("convert_frag called\n")

Definition at line 51 of file tc-z80.h.

#define md_end   z80_md_end

Definition at line 56 of file tc-z80.h.

#define md_estimate_size_before_relax (   f,
  s 
)    (as_fatal (_("estimate_size_before_relax called")), 1)

Definition at line 52 of file tc-z80.h.

Definition at line 46 of file tc-z80.h.

#define md_operand (   x)

Definition at line 39 of file tc-z80.h.

#define md_start_line_hook ( )    { if (z80_start_line_hook ()) continue; }

Definition at line 57 of file tc-z80.h.

#define NO_PSEUDO_DOT   1

Definition at line 90 of file tc-z80.h.

Definition at line 94 of file tc-z80.h.

#define NUMBERS_WITH_SUFFIX   1

Definition at line 89 of file tc-z80.h.

#define O_SINGLE_EQ   O_eq

Definition at line 82 of file tc-z80.h.

Definition at line 34 of file tc-z80.h.

Definition at line 93 of file tc-z80.h.

#define TARGET_ARCH   bfd_arch_z80

Definition at line 26 of file tc-z80.h.

#define TARGET_BYTES_BIG_ENDIAN   0

Definition at line 30 of file tc-z80.h.

#define TARGET_MACH   0

Definition at line 29 of file tc-z80.h.

#define TC_COFF_FIX2RTYPE (   fixP)    tc_coff_fix2rtype (fixP)

Definition at line 50 of file tc-z80.h.

Definition at line 58 of file tc-z80.h.

#define TC_COUNT_RELOC (   x)    1

Definition at line 48 of file tc-z80.h.

#define TC_IMPLICIT_LCOMM_ALIGNMENT (   SIZE,
  P2VAR 
)    (P2VAR) = 0

Definition at line 103 of file tc-z80.h.

Definition at line 64 of file tc-z80.h.


Function Documentation

void z80_cons_fix_new ( fragS *  ,
int  ,
int  ,
expressionS  
)

Definition at line 659 of file tc-z80.c.

{
  bfd_reloc_code_real_type r[4] =
    {
      BFD_RELOC_8,
      BFD_RELOC_16,
      BFD_RELOC_24,
      BFD_RELOC_32
    };

  if (nbytes < 1 || nbytes > 4) 
    {
      as_bad (_("unsupported BFD relocation size %u"), nbytes);
    }
  else
    {
      fix_new_exp (frag_p, offset, nbytes, exp, 0, r[nbytes-1]);
    }
}

Here is the call graph for this function:

void z80_md_end ( void  )

Definition at line 181 of file tc-z80.c.

{
  int mach_type;

  if (ins_used & (INS_UNPORT | INS_R800))
    ins_used |= INS_UNDOC;

  switch (ins_used)
    {
    case INS_Z80:
      mach_type = bfd_mach_z80strict;
      break;
    case INS_Z80|INS_UNDOC:
      mach_type = bfd_mach_z80;
      break;
    case INS_Z80|INS_UNDOC|INS_UNPORT:
      mach_type = bfd_mach_z80full;
      break;
    case INS_Z80|INS_UNDOC|INS_R800:
      mach_type = bfd_mach_r800;
      break;
    default:
      mach_type = 0;
    }

  bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach_type);
}

Definition at line 220 of file tc-z80.c.

{
  char *p, quote;
  char buf[4];

  /* Convert one character constants.  */
  for (p = input_line_pointer; *p && *p != '\n'; ++p)
    {
      switch (*p)
       {
       case '\'':
         if (p[1] != 0 && p[1] != '\'' && p[2] == '\'')
           {
             snprintf (buf, 4, "%3d", (unsigned char)p[1]);
             *p++ = buf[0];
             *p++ = buf[1];
             *p++ = buf[2];
             break;
           }
       case '"':
         for (quote = *p++; quote != *p && '\n' != *p; ++p)
           /* No escapes.  */ ;
         if (quote != *p)
           {
             as_bad (_("-- unterminated string"));
             ignore_rest_of_line ();
             return 1;
           }
         break;
       }
    }
  /* Check for <label>[:] [.](EQU|DEFL) <value>.  */
  if (is_name_beginner (*input_line_pointer))
    {
      char c, *rest, *line_start;
      int len;
      symbolS * symbolP;

      line_start = input_line_pointer;
      LISTING_NEWLINE ();
      if (ignore_input ())
       return 0;

      c = get_symbol_end ();
      rest = input_line_pointer + 1;

      if (*rest == ':')
       ++rest;
      if (*rest == ' ' || *rest == '\t')
       ++rest;
      if (*rest == '.')
       ++rest;
      if (strncasecmp (rest, "EQU", 3) == 0)
       len = 3;
      else if (strncasecmp (rest, "DEFL", 4) == 0)
       len = 4;
      else
       len = 0;
      if (len && (rest[len] == ' ' || rest[len] == '\t'))
       {
         /* Handle assignment here.  */
         input_line_pointer = rest + len;
         if (line_start[-1] == '\n')
           bump_line_counters ();
         /* Most Z80 assemblers require the first definition of a
             label to use "EQU" and redefinitions to have "DEFL".  */
         if (len == 3 && (symbolP = symbol_find (line_start)) != NULL) 
           {
             if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
              as_bad (_("symbol `%s' is already defined"), line_start);
           }
         equals (line_start, 1);
         return 1;
       }
      else
       {
         /* Restore line and pointer.  */
         *input_line_pointer = c;
         input_line_pointer = line_start;
       }
    }
  return 0;
}

Here is the call graph for this function: