Firstly, I'd like to say that developing with PureBasic is fantastic experience!
Thank You!
I have discovered an oddity that may be a bug, or perhaps just needs better documentation
in the user manual.
I was using PeekB to view the contents of memory and was confused with all of the $FF
values that were in the memory.
When I changed from PeekB to PeekA, the memory was displayed correctly.
Here is a test program to show what I mean.
Code: Select all
; PeekA vs PeekB printed as a hex value
; when I run this program with the line 1 then PeekB results in negative
; numbers being printed out. This is expected
; when I run this program with line 2 then PeekB results in $FF for all byte values
; greater than $7F ( 128 decimal ). This was not expected and caused confusion
Dim some_array.b(255)
Define *p = @some_array(0)
For i = 0 To 255
some_array(i) = i
;Line 1
Debug "PeekA(" + Str(i) + ") = " + Str(PeekA(*p+i)) + " , but PeekB(" + Str(i) + ") = " + Str(PeekB(*p+i))
; Line 2
;Debug "PeekA(" + Str(i) + ") = " + RSet( Hex(PeekA(*p+i)), 2, "0" ) + " , but PeekB(" + Str(i) + ") = " + RSet( Hex(PeekB(*p+i)), 2, "0" )
Next
// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)