We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm just learning assembly code, trying to do the following, but it doesn't work. Why? Thanks.
register uint32 c[] = { 0, 0, 0, 0 }; register uint32 a[] = { 2, 5, 7, 9 }; register uint32 b[] = { 3, 3, 4, 5 }; __asm__ __volatile__( "ADD %0.2d, %1.2d, %2.2d;" : "=w" (c) // output : "w" (a) // input , "w" (b) // input ); for(auto i = 0; i < (sizeof(c)/sizeof(c[0])); ++i) { printf("%s a(%d) + b(%d) = c(%d)\n", __FUNCTION__, a[i], b[i], c[i]); //TODO: remove all printf's }
Moved to the Compilers forum
Hello, what are you expecting?
I made an example file based on your source. and got the following error, which is due to the 'register' qualifier, forcing the arrays to be stored in internal registers.
> error: address of register variable requested
Regards, Ronan