Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:43 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: Peeking a scalar variable, what's going on here?

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 04:10pm 15 May 2021
Copy link to clipboard 
Print this post

Hi folks,

I suspect I'm being an idiot, but why is this not working:

> list "foo.bas"
Option Base 0
Option Explicit On
Option Default None

Dim a%(1)
a%(0) = &hAABBCCDD
Print Hex$(Peek(Var a%(), 0))
Dim a_addr% = Peek(VarAddr a%())
Print Hex$(a_addr%)
Print Hex$(Peek(Byte a_addr%))

Print

Dim b%
b% = &hAABBCCDD
Print Hex$(Peek(Var b%, 0))
Dim b_addr% = Peek(VarAddr b%)
Print Hex$(b_addr%)
Print Hex$(Peek(Byte b_addr%))

> run "foo.bas"
DD
3003FF00
DD

DD
3800E178
Error in line 19: Address


a_addr% is obviously the address of the storage for the first element of a%(), but what is b_addr% and why can't it be PEEKed ?

Best wishes,

Tom
Edited 2021-05-16 02:10 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 04:42pm 15 May 2021
Copy link to clipboard 
Print this post

Hi Tom,
it's working for me. Instead of your error, I got DD...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 04:53pm 15 May 2021
Copy link to clipboard 
Print this post

  jirsoft said  Hi Tom,
it's working for me. Instead of your error, I got DD...


That's what I had expected.

What firmware version are you running?

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 06:37pm 15 May 2021
Copy link to clipboard 
Print this post

Fixed in b33 just posted
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 06:37pm 15 May 2021
Copy link to clipboard 
Print this post

  matherp said  Fixed in b33 just posted


Thank you.
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025