#include <stdio.h>
int main(int argc, char **argv)
{
union { long x; int y[2]; } longvar;
longvar.x = -1;
printf("%08X %08X %ld\n",longvar.y[0],longvar.y[1],longvar.x);
__asm__ __volatile__ ("slr %0,%0" : "+d" (longvar.x) : : "cc");
printf("%08X %08X %ld\n",longvar.y[0],longvar.y[1],longvar.x);
__asm__ __volatile__ ("slgr %0,%0" : "+d" (longvar.x) : : "cc");
printf("%08X %08X %ld\n",longvar.y[0],longvar.y[1],longvar.x);
}
FFFFFFFF FFFFFFFF -1
FFFFFFFF 00000000 -4294967296
00000000 00000000 0
Previous slide | Next slide | Back to first slide | View graphic version |