Beispiel #1
0
void virtual_pop(asmjit::X86Assembler& a, MemoryMapper& m, T dst) {
	a.inc(REG_SP);
	a.mov(REG_TMP, 0x0100);
	// @CLEANUP TMP is rax, but we can't or with a larger register
	a.add(asmjit::x86::al, REG_SP);
	m.emitDynamicLoad(a, REG_TMP, dst);
}
Beispiel #2
0
bool LDAAbsXInstr::exp(asmjit::X86Assembler& a, MemoryMapper& m) {
	auto temp = asmjit::x86::rax;
	a.mov(temp, this->base);
	a.add(temp, REG_X);
	auto tmpPtr = asmjit::x86::byte_ptr(temp);

	{
		auto NotZero = a.newLabel();
		auto Exit = a.newLabel();
		a.cmp(tmpPtr, 0);
		a.jne(NotZero);
		// Value was 0
		a.bts(REG_S, S_ZERO);
		a.jmp(Exit);

		// Value was not 0
		a.bind(NotZero);
		a.btr(REG_S, S_ZERO);
		//No jmp required, just fall though

		a.bind(Exit);
	}

	a.mov(REG_A, tmpPtr);
	return true;
}
Beispiel #3
0
void virtual_push(asmjit::X86Assembler& a, MemoryMapper& m, T value) {
	a.mov(REG_TMP, 0x0100);
	// @CLEANUP TMP is rax, but we can't or with a larger register
	a.add(asmjit::x86::al, REG_SP);
	m.emitDynamicStore(a, REG_TMP, value);
	a.dec(REG_SP);
}