#include "libsys.h"

int non_aligned_load(UINT32* pMem)
{
	UINT32 result;
	__asm__
	(
		"li     $t0, 0x01234567\n"
		"li     $t1, 0x89ABCDEF\n"
		"sw     $t0, 0(%[pMem])\n"
		"sw     $t1, 64(%[pMem])\n"
		"lw     %[val], 0(%[pMem])\n"
		"lw     %[val], 64(%[pMem])\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"nop\n"
		"li     %[val], 0x55555555\n"
		"lw     %[val], 0(%[pMem])\n"
		"lwl    %[val], 65(%[pMem])\n"
		: [val] "=r" (result)
		: [pMem] "r" (pMem)
	);
	return result;
}

int main()
{
	int buf[256], res, i;

	res = non_aligned_load(buf);

	return res;

}
