Memory check operation without pointers in NXC on NXT?
I am trying to write a memory test program for the NXT as I have several burned-out memory locations and would like to determine which NXTs are unusable. This program is designed to check every byte in memory for integrity:
- Allocating 64 bits to a linear feedback shift register randomizer
- Adding another byte to the memory pointer
- Writing random data to a selected memory location
- Checking the correctness of data reading.
However, after these attempts, I found that NXT does not actually support pointer operations. So I can't just loop over the pointer byte and read its location to check.
How do I iterate over indices in memory without pointers?
source to share
I think the problem is that you don't really get direct memory access in NBC / NXC or RobotC.
From what I know, both work on the NXT firmware emulator; so the bad memory address [es] may change from your programmatic point of view (assuming the emulator is running virtual memory).
For actually running bare metal, I would suggest using the NXTBINARY feature of John Hansen's modified firmware, as described here:
http://www.tau.ac.il/~stoledo/lego/nxt-native/
An improved fimware can be found at:
http://bricxcc.sourceforge.net/test_releases/
source to share