check if memory is accessible

Dec 24, 2007 3 Replies

Hi, Does there exist an assembly instruction to check if a particular memory is accessible



Best Regards, Rakesh UV


Yes, two are required.

Write a 0x00 to the memory location, then Read it back and see if it is 0x00.

You can also Write/Read other values to the location as see if you get the same value to read back.

By the way, which assembly instructions are you trying to use ??

donald

What do you0 mean by "accessible" ?

-Michael

Simple answer is NO. Complicated answer is it depends. Depending on the processor and the setup of registers, you can try to access a particular memory address and see whether you get an "Memory abort" type exception. If you do get an exception that means that the address cannot be accessed with the method (Read/write/word/byte) you used. If you don't care whether you destroy what ever is in that memory location you can use Donald's solution. But be careful of writing to memory mapped register areas or memory mapped other device areas as it could be permanent. Cheers and Happy new year! Janaka

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required