Internal variable format

STOS programming section.

Moderator: troed

Post Reply
darklight
Posts: 3
Joined: Sun May 31, 2020 1:46 pm

Internal variable format

Post by darklight »

Hey all,

If I were running a STOS program, and I can peek at memory using say Steem's debug memory browser, how could I locate & view the value of say a integer / number variable?

From the STOS manual:
Note that any numbers you type into STOS Basic are converted into a special
internal format. When you list your program, these numbers are expanded back
into their original form.
So it sounds like numbers are compressed I guess to save space. Is the format of these variables known?

Would it make a difference if the program was compiled?
User avatar
exxos
Site Admin
Site Admin
Posts: 23491
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Internal variable format

Post by exxos »

A = VARPTR(B)

Edit
Are you talking about variables in ram or the bas file ?
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
darklight
Posts: 3
Joined: Sun May 31, 2020 1:46 pm

Re: Internal variable format

Post by darklight »

Yes in RAM, I'm running someone else's program, I don't have access to the source code.
User avatar
exxos
Site Admin
Site Admin
Posts: 23491
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Internal variable format

Post by exxos »

I don't think its possible to find variables in RAM which are outside of the running program.. Steem de-bugger is probably the only way to see whats in RAM.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
darklight
Posts: 3
Joined: Sun May 31, 2020 1:46 pm

Re: Internal variable format

Post by darklight »

Yes, I am talking about using Steems debugger to peek and poke (not STOS commands!) into the program. I've actually made a bit of progress, I've figured out where the program is stored in memory, and where the variable values are (thanks for the VARPTR tip - yes they are at that location :) ).

Not sure if it is of any use to anyone. I'm just trying to figure out how to hack a game really.

The sad thing is, it looks like when STOS is compiled, the variable names are lost, and its much much harder to 'browse' the variables in memory and understand what you are looking at.

I'll continue investigating.
Post Reply

Return to “STOS”