I just want to be sure, but is there any chance at all a valid pointer addr could equal 0? Does the assembler/linker make sure that never happens?
No. A pointer address cannot be lower than the minimum address specified in the OS. Address 0 is an error in win 32. On my XP Sp3 the lowest address is 100000 hex.
sometimes, a pointer of 0 or NULL is used to indicate the absence of a value
for example, some functions will fill a POINT structure if you provide an address
if you pass a NULL value, it will omit that feature
other times - i may set a pointer to 0 to indicate that it isn't filled in, yet
otherwise.....
a pointer of 0 will undoubtedly get you a crash and a look at Dr Watson or a maybe a debugger :biggrin:
Couldn't it also depend on where he is in the program cycle. What about dd (0) in the program header. Then if a pointer is pointing to another it would be init with 0 or null to begin, so it could be garbage. Then as you were saying Dave it would fill it in with a valid address later on.
What about runtime pointer allocation on the fly? They could be set to a value such as 0 and then dynamically linked on the fly with a valid pointer. I guess it depends on what pointer you were looking at and when.