I've been experimenting with pointers to display the memory contents (bytes) at any arbitraty address. The problem is that I seem to be limited to certain ranges in memory. Ie, when my program tries to read from a certain address, the program will silently crash and exit. Does anyone know about the limitations with memory access?
Here's my example program. Scroll through memory with keys q, a ,w, s, e, d, r, f, t, g at varying speeds. Change "max" and "min" variables, and above address 1191932 and below 48790 (on my computer) it crashes. However other isolated areas of memory seem to work also.
sync on
sync rate 0
Ptr as DWORD
Ptr=1190932
range = 32
Rem max and min addresses
max as dword = 1191932
min as dword = 48790
ink RGB(102,204,0),0
do
cls
if inkey$()="a" then inc ptr, 1
if inkey$()="q" then dec ptr, 1
if inkey$()="s" then inc ptr, 10
if inkey$()="w" then dec ptr, 10
if inkey$()="d" then inc ptr, 100
if inkey$()="e" then dec ptr, 100
if inkey$()="f" then inc ptr, 1000
if inkey$()="r" then dec ptr, 1000
if inkey$()="g" then inc ptr, 10000
if inkey$()="t" then dec ptr, 10000
if max-ptr-1<=range then ptr = max-range-1
if ptr-min-1<=range then ptr = min+range+1
Rem Draw "Scrollbar" on left side of screen
p = 50+(643.000/(max-min))*(ptr-min)
box 10,p,20,p+10
line 10,50,20,50
line 10,764,20,764
Rem Read memory contents of addresses within the range
y=50
for i=ptr-range to ptr + range
if i>min and i<max
x as byte = *i
text 20,y,"Address: " + str$(i) + " Value: " + str$(x)
endif
inc y,10
next i
sync
loop