OpenCores
URL https://opencores.org/ocsvn/rf6809/rf6809/trunk

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [software/] [a09/] [a09.c] - Diff between revs 4 and 12

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 4 Rev 12
Line 2874... Line 2874...
      opsize = 4;
      opsize = 4;
    }
    }
  switch (opsize)
  switch (opsize)
    {
    {
    case 1:
    case 1:
      postbyte += (operand & 511);
      postbyte |= (operand & 511);
      opsize = 0;
      opsize = 0;
      break;
      break;
    case 2:
    case 2:
      postbyte += 0x808;
      postbyte |= 0x808;
      break;
      break;
    case 3:
    case 3:
      postbyte += 0x809;
      postbyte |= 0x809;
      break;
      break;
        case 4:
        case 4:
          postbyte += 0x80A;
          postbyte |= 0x80A;
          break;
          break;
    }
    }
  }
  }
else
else
  { /*pc relative*/
  { /*pc relative*/
Line 2905... Line 2905...
      if (toupper(*srcptr) == 'R')
      if (toupper(*srcptr) == 'R')
        srcptr++;
        srcptr++;
      }
      }
    }
    }
  mode++;
  mode++;
  postbyte += 0x80c;
  postbyte |= 0x80c;
  if (opsize == 1)
  if (opsize == 1)
    opsize = 2;
    opsize = 2;
  }
  }
}
}
 
 
Line 2922... Line 2922...
void scanoperands09(struct relocrecord *pp)
void scanoperands09(struct relocrecord *pp)
{
{
char c, *oldsrcptr, *ptr;
char c, *oldsrcptr, *ptr;
unsigned short accpost, h63 = 0;
unsigned short accpost, h63 = 0;
unsigned short isIndexed = 0;
unsigned short isIndexed = 0;
 
unsigned short indirect_byte = 0;
isFar = 0;
isFar = 0;
isPostIndexed = 0;
isPostIndexed = 0;
unknown = 0;
unknown = 0;
opsize = 0;
opsize = 0;
certain = 1;
certain = 1;
Line 2942... Line 2942...
          mode = ADRMODE_DBL_IND;
          mode = ADRMODE_DBL_IND;
          postbyte = 0x80F;
          postbyte = 0x80F;
  }
  }
  else
  else
          mode = ADRMODE_IND;
          mode = ADRMODE_IND;
 
    indirect_byte = 0x100;
  }
  }
switch (toupper(c))
switch (toupper(c))
  {
  {
  case 'D':
  case 'D':
    accpost = 0x80b;
    accpost = 0x80b;
Line 2959... Line 2960...
    else
    else
      {
      {
                  isIndexed = 1;
                  isIndexed = 1;
      if ((h63) && (!(dwOptions & OPTION_H63)))
      if ((h63) && (!(dwOptions & OPTION_H63)))
        error |= ERR_ILLEGAL_ADDR;
        error |= ERR_ILLEGAL_ADDR;
      postbyte = accpost;
      postbyte |= accpost;
      srcptr++;
      srcptr++;
      if (!scanindexreg())
      if (!scanindexreg())
        RESTORE
        RESTORE
      else
      else
        {
        {
Line 3061... Line 3062...
        {
        {
        if ((unsigned)operand >= 16777216)
        if ((unsigned)operand >= 16777216)
                      opsize = 4;
                      opsize = 4;
              else
              else
        if (unknown || !certain || dpsetting == -1 ||
        if (unknown || !certain || dpsetting == -1 ||
          (unsigned)(operand - dpsetting * 4096) >= 4096)
          (signed)(operand - dpsetting * 4096) >= 2048 ||
 
          (signed)(operand - dpsetting * 4096) < -2048)
          opsize = 3;
          opsize = 3;
        else
        else
          opsize = 2;
          opsize = 2;
        }
        }
      /*
      /*
Line 3116... Line 3118...
  skipspace();
  skipspace();
  if (*srcptr==',') {
  if (*srcptr==',') {
          srcptr++;
          srcptr++;
          isPostIndexed = 1;
          isPostIndexed = 1;
      scanindexed();    // scanindexed will reset the postbyte
      scanindexed();    // scanindexed will reset the postbyte
          postbyte |= 0x100;
          postbyte |= indirect_byte | 0x80;
  }
  }
  else {
  else {
          if (postbyte==0x90F || postbyte==0x80F)
          if (postbyte==0x90F || postbyte==0x80F)
                  opsize = 3;
                  opsize = 3;
      if (mode == ADRMODE_IND || mode==ADRMODE_DBL_IND)
      if (mode == ADRMODE_IND || mode==ADRMODE_DBL_IND)
Line 4281... Line 4283...
    putbyte((unsigned short)(co + 0x030));
    putbyte((unsigned short)(co + 0x030));
    break;
    break;
  default:
  default:
          if (isFar)
          if (isFar)
                  putbyte(0x015);
                  putbyte(0x015);
                if (isPostIndexed)
    if (isPostIndexed) {
                        putbyte(0x01B);
      //putbyte(0x01B);
 
      postbyte |= 0x80;
 
    }
    putbyte((unsigned short)(co + 0x020));
    putbyte((unsigned short)(co + 0x020));
  }
  }
doaddress(&p);
doaddress(&p);
}
}
 
 
Line 4355... Line 4359...
    break;
    break;
  default:
  default:
        if (isFar)
        if (isFar)
                putbyte(0x015);
                putbyte(0x015);
        if (isPostIndexed)
        if (isPostIndexed)
                putbyte(0x01B);
                //putbyte(0x01B);
    putbyte((unsigned short)(co + 0x020));
    putbyte((unsigned short)(co + 0x020));
    break;
    break;
 }
 }
doaddress(&p);
doaddress(&p);
}
}
Line 4393... Line 4397...
    putbyte((unsigned short)(co + 0x030));
    putbyte((unsigned short)(co + 0x030));
    break;
    break;
  default:
  default:
          if (isFar)
          if (isFar)
                  putbyte(0x015);
                  putbyte(0x015);
          if (isPostIndexed)
    if (isPostIndexed) {
                  putbyte(0x01B);
      //putbyte(0x01B);
 
      postbyte |= 0x80;
 
    }
    putbyte((unsigned short)(co + 0x020));
    putbyte((unsigned short)(co + 0x020));
    break;
    break;
 }
 }
doaddress(&p);
doaddress(&p);
}
}
Line 4433... Line 4439...
    putword((unsigned)(co + 0x030));
    putword((unsigned)(co + 0x030));
    break;
    break;
  default:
  default:
          if (isFar)
          if (isFar)
                  putbyte(0x015);
                  putbyte(0x015);
          if (isPostIndexed)
    if (isPostIndexed) {
                  putbyte(0x01B);
      //putbyte(0x01B);
 
      postbyte |= 0x80;
 
    }
    putword((unsigned)(co + 0x020));
    putword((unsigned)(co + 0x020));
 }
 }
doaddress(&p);
doaddress(&p);
}
}
 
 
Line 4517... Line 4525...
    putbyte((unsigned short)(co + 0x70));
    putbyte((unsigned short)(co + 0x70));
    break;
    break;
  default:
  default:
          if (isFar)
          if (isFar)
                  putbyte(0x015);
                  putbyte(0x015);
          if (isPostIndexed)
    if (isPostIndexed) {
                  putbyte(0x01B);
      //putbyte(0x01B);
 
      postbyte |= 0x80;
 
    }
    putbyte((unsigned short)(co + 0x60));
    putbyte((unsigned short)(co + 0x60));
    break;
    break;
  }
  }
doaddress(&p);
doaddress(&p);
}
}
Line 4567... Line 4577...
    putbyte((unsigned short)(co + 0x70));
    putbyte((unsigned short)(co + 0x70));
    break;
    break;
  default:
  default:
          if (isFar)
          if (isFar)
                  putbyte(0x15);
                  putbyte(0x15);
                if (isPostIndexed)
    if (isPostIndexed) {
                        putbyte(0x1B);
      //putbyte(0x1B);
 
      postbyte |= 0x80;
 
    }
    putbyte((unsigned short)(co + 0x60));
    putbyte((unsigned short)(co + 0x60));
    break;
    break;
  }
  }
doaddress(&p);
doaddress(&p);
}
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.