I want to verify my stw actually wrote to a memory location using C.
I know I could use a load word to read it(as long as I didn't use the same register it was written to?), but what's the equivalent syntax that would work in C?
I want to verify my stw actually wrote to a memory location using C.
I know I could use a load word to read it(as long as I didn't use the same register it was written to?), but what's the equivalent syntax that would work in C?
You can read from an arbitrary memory address like this:
volatile uint64_t * const addr = (volatile uint64_t * const) 0x12345678;
printf("%llx\n",*addr);
Replace uint64_t with the word size of your system.
This will need to be run in the same program as your assembly routine which does the stw, so that you are writing/reading the same virtual address in the same virtual address space.