Beispiel #1
0
  /**
   * Generate a String representation of a Displacement that can be used by the assembly code
   * generater.
   */
  public String assembleDisp(Assembler asm, Displacement disp, int ftn) {
    if (ftn == SparcGenerator.FT_NONE) return disp.assembler(asm);

    StringBuffer buf = new StringBuffer(SparcGenerator.ftns[ftn]);
    buf.append('(');
    buf.append(disp.assembler(asm));
    buf.append(')');
    return buf.toString();
  }
Beispiel #2
0
 /**
  * Generate a String representation of a Displacement that can be used by the assembly code
  * generater.
  */
 public String assembleDisp(Assembler asm, Displacement disp, int ftn, boolean macosx) {
   if (ftn == PPCGenerator.FT_NONE) {
     String dispString = disp.assembler(asm);
     if (dispString == "") return "0";
     else return dispString;
   }
   if (macosx) {
     StringBuffer buf = new StringBuffer("");
     buf.append(PPCGenerator.ftnsMacosx[ftn]);
     buf.append('(');
     buf.append(disp.assembler(asm));
     buf.append(')');
     return buf.toString();
   }
   StringBuffer buf = new StringBuffer("");
   buf.append(disp.assembler(asm));
   buf.append('@');
   buf.append(PPCGenerator.ftnsLinux[ftn]);
   return buf.toString();
 }