Virtual Variables do NOT require indirect access.

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
User avatar
TomC
Posts: 69
Joined: Mon Apr 24, 2017 9:00 pm
Location: Detroit/Palo Alto, USA/Third Stone

Virtual Variables do NOT require indirect access.

Post by TomC »

Perhaps I've missed details of an update, but I can access GrMod and RefLCD WITHOUT using indirection.

I first did this accidentally, but then verified it!

The current .pdf file [3.14]still shows indirection is required, yet the help file [2018-08-31] on the DM42 does not mention the indirection requirement.

TomC
TomC
DM42:00068/03961, DM41X:
Geoff Quickfall
Posts: 328
Joined: Wed May 24, 2017 10:44 pm
Location: Vancouver Canada
Contact:

Re: Virtual Variables do NOT require indirect access.

Post by Geoff Quickfall »

Hi TomC

Not being ignored but I too must have missed the missive!

Geoff
User avatar
TomC
Posts: 69
Joined: Mon Apr 24, 2017 9:00 pm
Location: Detroit/Palo Alto, USA/Third Stone

Re: Virtual Variables do NOT require indirect access.

Post by TomC »

Geoff:

Awwww....tnx for the special attention!!!

I'm not sure when/if this was announced, but I stumbled into it! Makes the code much simpler/less cumbersome/does not 'waste' any memories!

TomC
TomC
DM42:00068/03961, DM41X:
keithdalby
Posts: 564
Joined: Mon Apr 24, 2017 8:38 pm

Re: Virtual Variables do NOT require indirect access.

Post by keithdalby »

I recall seeing the instruction to use indirect access from the start, not bothering and just using names directly, and it working. Always wondered what the fuss about I direct access was about when it always seemed to work for me.

Unless I'm remembering wrong.
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Virtual Variables do NOT require indirect access.

Post by grsbanks »

Of course direct access is possible. It just uses up a lot more memory and it's harder to enter a program.

STO "RefLCD" uses 8 bytes and takes ages (comparatively) to type because you can't create a real variable "RefLCD" to have it ready in a menu.

STO IND 00 uses 2 bytes and is much easier to type.

It's also much less prone to error if the name of the variable is stored in one location.

Of course, it doesn't make that much sense if you're only going to refer to the virtual variable once in your program. You're not going to save any time or space because you still have to enter the string "RefLCD" and store it in a register.

That's the only reason I used indirect access in programs I've provided. I thought people would realize that.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
Rmollov
Posts: 37
Joined: Wed May 03, 2017 7:55 pm
Location: Sydney, Australia

Re: Virtual Variables do NOT require indirect access.

Post by Rmollov »

grsbanks wrote:
Sun Oct 06, 2019 9:11 am
That's the only reason I used indirect access in programs I've provided. I thought people would realize that.
I don't see anyone suggesting otherwise. As for the memory savings given the size of DM42's memory and typical program size 4 bytes a call is hardly a big deal. Otherwise I agree it's a lot more convenient to use indirect addressing.

Regards,
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Virtual Variables do NOT require indirect access.

Post by grsbanks »

TomC wrote:
Mon Sep 30, 2019 1:33 am
The current .pdf file [3.14]still shows indirection is required, yet the help file [2018-08-31] on the DM42 does not mention the indirection requirement.
Could you point me to the PDF in question and the part where it says that indirection is required? This is incorrect, as you found out for yourself, and should be corrected.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
Post Reply