1 #include <stdio.h> 2 #include <string.h> 3 #include "opcodes.h" 4 5 int main() 6 { 7 register long g asm("r7"); 8 register double f asm("f8"); 9 double f1; 10 11 memset(&f1, 0x0f, sizeof(double)); 12 f = f1; 13 g = 42; 14 printf("test LGDR\n\n"); 15 printf("before g = %ld\n", g); 16 printf("before f = %a\n", f); 17 printf("copy f to g\n"); 18 asm volatile ( LGDR(7,8) : "=d"(g) : "f"(f)); 19 printf("after g = %16.16lx\n", g); /* 0x0x0x0...... */ 20 printf("after f = %a\n", f); 21 22 printf("\ntest LDGR\n\n"); 23 f = 3.14; 24 printf("before g = %16.16lx\n", g); /* 0x0x0x0...... */ 25 printf("before f = %a\n", f); 26 printf("copy g to f\n"); 27 asm volatile ( LDGR(8,7) : "=f"(f) : "d"(g)); 28 printf("after g = %16.16lx\n", g); /* 0x0x0x0...... */ 29 printf("after f = %a\n", f); 30 31 return 0; 32 } 33 34