check if memory is accessible

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

Best Regards, Rakesh UV

Reply to
rakesh uv
Loading thread data ...

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

Reply to
donald

What do you0 mean by "accessible" ?

-Michael

Reply to
Michael Schnell

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

Reply to
Janaka

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.