int a_align(Opx *o) { long data; data = expeval(gOperand[0], NULL).value; DoingDc = TRUE; gSzChar = 'B'; switch(CurrentArea) { case CODE_AREA: while(ProgramCounter.byte) emitb(0xff); if (ProgramCounter.val % data) { while(ProgramCounter.val % data) emitw(0xffffffff); } break; case DATA_AREA: while(DataCounter.byte) emitb(0xff); if (DataCounter.val % data) { while(DataCounter.val % data) emitw(0xffffffff); } break; case BSS_AREA: while(BSSCounter.byte) emitb(0xff); if (BSSCounter.val % data) { while(BSSCounter.val % data) emitw(0xffffffff); } break; } DoingDc = FALSE; return (TRUE); }
int a_imm(Opx *o) { int op = o->oc; int data; if (is102) { if (gOperand[0][1]=='<') data = expeval(&gOperand[0][2], NULL).value; else if (gOperand[0][1]=='>') data = expeval(&gOperand[0][2], NULL).value >> 16; else data = expeval(&gOperand[0][1], NULL).value; if (data > -32768 && data < 32767) emitw(op | ((data & 0xffff) << 16)); else { emitw(op | 0x80000000); emitw(data); } }
void Assem_x86::emitImm( const Operand &o,int size ) { if( size<4 && o.immLabel.size() ) throw Ex( "immediate value cannot by a label" ); switch( size ) { case 1: emit( o.imm ); return; case 2: emitw( o.imm ); return; case 4: a_reloc( o.immLabel ); emitd( o.imm ); return; } }
void Assem_x86::emitd( int n ) { emitw( n ); emitw( n>>16 ); }