Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
mikep wrote:On a ZX-24n it appears to poke the value into the variable rather than the address where the variable is pointing to
Thanks. It is interesting that the address/dereferencing code generated for RamPeek() is correct. Somehow we missed the problem for RamPoke(). A solution to the problem has been identified and tested preliminarily.
One way to work around the problem is to use a based variable:
Dim addr as UnsignedInteger
Dim msgWord as UnsignedInteger Based addr
addr = msgBuf.DataAddr
msgWord = &H11D7
A third option that may be useful if the message buffer lends itself to being described by a structure is to define a structure matching the message and then define a structure variable based on the address of the message buffer.
dkinzer wrote:[It is interesting that the address/dereferencing code generated for RamPeek() is correct. Somehow we missed the problem for RamPoke(). A solution to the problem has been identified and tested preliminarily.
Just to point out that all 3 variations have the problem.
dkinzer wrote:One way to work around the problem is to use a based variable: