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: 58
Joined: Mon Apr 24, 2017 7:00 pm
Location: Detroit/Palo Alto, USA/Third Stone

Virtual Variables do NOT require indirect access.

Post by TomC » Sun Sep 29, 2019 11:33 pm

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

Geoff Quickfall
Posts: 214
Joined: Wed May 24, 2017 8:44 pm
Location: Vancouver Canada
Contact:

Re: Virtual Variables do NOT require indirect access.

Post by Geoff Quickfall » Fri Oct 04, 2019 1:13 am

Hi TomC

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

Geoff

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

Re: Virtual Variables do NOT require indirect access.

Post by TomC » Fri Oct 04, 2019 4:47 pm

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

keithdalby
Posts: 543
Joined: Mon Apr 24, 2017 6:38 pm

Re: Virtual Variables do NOT require indirect access.

Post by keithdalby » Sat Oct 05, 2019 4:52 am

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: 856
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK
Contact:

Re: Virtual Variables do NOT require indirect access.

Post by grsbanks » Sun Oct 06, 2019 7:11 am

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.
Not SwissMicros staff, just an enthusiast.

Rmollov
Posts: 25
Joined: Wed May 03, 2017 5:55 pm
Location: Sydney, Australia

Re: Virtual Variables do NOT require indirect access.

Post by Rmollov » Tue Oct 08, 2019 1:20 pm

grsbanks wrote:
Sun Oct 06, 2019 7: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: 856
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK
Contact:

Re: Virtual Variables do NOT require indirect access.

Post by grsbanks » Wed Oct 09, 2019 8:54 am

TomC wrote:
Sun Sep 29, 2019 11:33 pm
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.
Not SwissMicros staff, just an enthusiast.

Post Reply