예제 #1
0
  /** Insert the assembler representation of the instruction into the output stream. */
  public void assembler(Assembler asm, Emit emit) {
    if (nullified()) emit.emit("nop ! ");

    emit.emit(Opcodes.getOp(this));
    emit.emit(getOperandSizeLabel());
    emit.emit('\t');

    emit.emit(asm.assembleRegister(reg));
  }
예제 #2
0
 public void assemble(Emit emit, String source, Enumeration<String> comments) {
   while (comments.hasMoreElements()) {
     emit.emit("\t# ");
     emit.emit(comments.nextElement());
     emit.endLine();
   }
   if (!nis) {
     emit.emit("\t# Instruction Scheduling");
     emit.endLine();
   }
   XyzAssembler asm = new XyzAssembler(this, source, !nis);
   asm.assemble(emit, dataAreas);
 }
예제 #3
0
  /** Insert the assembler representation of the instruction into the output stream. */
  public void assembler(Assembler asm, Emit emit) {
    if (nullified()) emit.emit("nop ! ");

    emit.emit(Opcodes.getOp(opcode));
    emit.emit('\t');
    emit.emit(asm.assembleRegister(rd));
    emit.emit(',');
    emit.emit("0x" + Integer.toHexString(cv));
    emit.emit(',');
    emit.emit("0x" + Integer.toHexString(cv2));
  }
예제 #4
0
 /** Insert the assembler representation of the instruction into the output stream. */
 public void assembler(Assembler gen, Emit emit) {
   emit.emit(Opcodes.getOp(this));
   emit.emit("\t%");
   if (opcode == Opcodes.RR) emit.emit(SparcGenerator.sRegs[rs1]);
   else emit.emit(SparcGenerator.pRegs[rs1]);
   emit.emit(',');
   emit.emit(gen.assembleRegister(rd));
 }
예제 #5
0
 /** Insert the assembler representation of the instruction into the output stream. */
 public void assembler(Assembler gen, Emit emit) {
   emit.emit(Opcodes.getOp(this));
   emit.emit(" 0(");
   emit.emit(gen.assembleRegister(ra));
   emit.emit(')');
 }
예제 #6
0
  public void assembler(Assembler asm, Emit emit) {
    emit.emit(Opcodes.getOp(this));
    emit.emit('\t');
    emit.emit(asm.assembleRegister(ra));
    emit.emit(',');

    if (displacement != null) {
      Displacement d = displacement;
      if (d instanceof OffsetDisplacement) {
        d = ((OffsetDisplacement) d).getBase();
      }
      if (d instanceof StackDisplacement) {
        long disp = displacement.getDisplacement();
        if (opcode == Opcodes.LDA) {
          emit.emit("0x");
          emit.emit(Long.toHexString(disp & 0xffff));
        } else {
          emit.emit("0x");
          emit.emit(Long.toHexString((disp >> 16) & 0xffff));
        }
      } else if (displacement.isNumeric()) {
        long disp = displacement.getDisplacement();
        emit.emit((disp << 48) >> 48);
      } else {
        emit.emit(displacement.assembler(asm));
      }
    }
    emit.emit('(');
    emit.emit(asm.assembleRegister(rb));
    emit.emit(')');

    if (displacement != null) {
      emit.emit(((AlphaAssembler) asm).relocationInfo(displacement, relocType));
    }
  }
예제 #7
0
 /** Insert the assembler representation of the instruction into the output stream. */
 public void assembler(Assembler gen, Emit emit) {
   emit.emit(Opcodes.getOp(this));
 }
예제 #8
0
 /** Assemble the delay slot instruction. */
 protected final void assembleDelay(Assembler asm, Emit emit) {
   emit.endLine();
   emit.emit('\t');
   if (delaySlot != null) delaySlot.assembler(asm, emit);
   else emit.emit("nop");
 }
예제 #9
0
 /** Insert the assembler representation of the instruction into the output stream. */
 public void assembler(Assembler asm, Emit emit) {
   emit.emit(Opcodes.getOp(this));
   emit.emit('\t');
   emit.emit(const22);
 }