Пример #1
0
static void emitDump(asmjit::X86Assembler& a) {
	a.push(asmjit::x86::r10);
	a.push(asmjit::x86::r11);

	a.mov(asmjit::x86::dil, REG_A);
	a.mov(asmjit::x86::sil, REG_X);
	a.mov(asmjit::x86::dl, REG_Y);
	a.mov(asmjit::x86::cl, REG_S);
	a.call((uint64_t)&dump);

	a.pop(asmjit::x86::r11);
	a.pop(asmjit::x86::r10);
}
Пример #2
0
bool BITZeroP::exp(asmjit::X86Assembler& a, MemoryMapper& m) {
	m.emitLoad(a, operand, asmjit::x86::al);
	// @COMPLETENESS: We should check and set the S_ flags here before the and
	a.push(asmjit::x86::rax);

	a.and_(asmjit::x86::al, REG_A);
	auto Zero = a.newLabel();
	auto Exit = a.newLabel();
	a.jz(Zero);

	//Not zero
	a.btr(REG_S, S_ZERO);
	a.jmp(Exit);
	a.bind(Zero);
	a.bts(REG_S, S_ZERO);
	a.bind(Exit);

	a.pop(asmjit::x86::rax);

	{
		a.btr(REG_S, S_OVERFLOW);
		a.bt(asmjit::x86::al, 6);
		auto End = a.newLabel();
		a.jnc(End);
		a.bts(REG_S, S_OVERFLOW);
		a.bind(End);
	}

	{
		a.btr(REG_S, S_NEGATIVE);
		a.bt(asmjit::x86::al, 7);
		auto End = a.newLabel();
		a.jnc(End);
		a.bts(REG_S, S_NEGATIVE);
		a.bind(End);
	}
	return true;
}