Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@790 cc03376c-175c-47c8-b038-4cd826a8556b
47 lines
668 B
C
47 lines
668 B
C
#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;
|
|
|
|
}
|