All pastes #2122602 Raw Edit

Anonymous

public text v1 · immutable
#2122602 ·published 2012-02-29 03:18 UTC
rendered paste body
	using namespace Gen;
	Gen::ARMXEmitter emit(m_compiledCode);
	static u32 value = 0;
	static u32 pointer = (u32)&value;
	Operand2 tmp(pointer);
	Operand2 tmp2(pointer >> 16);
	Operand2 tmp8(0x256);
	emit.MOVW(R10, tmp);
	emit.MOVT(R10, tmp2);
	emit.MOVW(R9, tmp8);
	emit.STR(R10, R9, 0);
	
	emit.MOV(_PC, _LR);
	((void (*)())(void*)m_compiledCode)();
	printf("Value: %d\n", value);