Author Topic: Writing to variables or executing a basic program  (Read 3284 times)

0 Members and 1 Guest are viewing this topic.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Writing to variables or executing a basic program
« on: January 05, 2011, 10:34:58 am »
hi,

im going to work on a complete science/ maths suite and i was wondering how to write to variables and/or executing a basic program from a compiled one.

as for the variables,  just
Code: [Select]
getcalc("varA",18)->A
8->A
doesnt work.

who can help me out?
I'm not a nerd but I pretend:

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: Writing to variables or executing a basic program
« Reply #1 on: January 05, 2011, 11:30:35 am »
I don't think we can executing a TI-Basic program without make an interpreter in axe.

But we can easy change bytes of calculator's variables (pic, GDB, appvar, Str,...)
Code: [Select]
:getcalc("appvarA",1)->A
:.I create 1 byte in my appvar "A"
:Copy(8,A,1)
:.I copy number 8 in the only byte of my appvar
« Last Edit: January 05, 2011, 11:31:15 am by kindermoumoute »
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Writing to variables or executing a basic program
« Reply #2 on: January 05, 2011, 11:33:46 am »
I don't think we can executing a TI-Basic program without make an interpreter in axe.

But we can easy change bytes of calculator's variables (pic, GDB, appvar, Str,...)
Code: [Select]
:getcalc("appvarA",1)->A
:.I create 1 byte in my appvar "A"
:Copy(8,A,1)
:.I copy number 8 in the only byte of my appvar
You could use the OS's one, but that would require knowledge of how to clean up your program in a way that running the basic program wont kill your calc due to interference between the two. Or you could use DCS's runprog routine.

Also I believe he is wanting to know how to manipulate Real variables (ie: A,B,C,D,Ans)
/e

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Writing to variables or executing a basic program
« Reply #3 on: January 05, 2011, 01:31:14 pm »
First of all, if you do a getcalc with a real variable you should always subtract 2 from the pointer since reals don't have size bytes in front; the size is ALWAYS 9 bytes.

Code: [Select]
GetCalc("varA",9)-2->A
Secondly, real numbers are floats, not integers, you have to manipulate them with float{} like this:

Code: [Select]
float{A}->B
8->float{A}

Running BASIC programs sounds like it could be done with a bcall, but I don't know of any.
« Last Edit: January 05, 2011, 01:33:27 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Writing to variables or executing a basic program
« Reply #4 on: January 05, 2011, 02:01:00 pm »
There are a number of bcalls to execute commands. So, you could go through command by command, and execute it all. However, you would need to figure out how many args the command takes, because there are different bcalls for different numbers of args. I'm not sure if it returns how many bytes the command was though, so you might have to figure out that as well.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Writing to variables or executing a basic program
« Reply #5 on: January 05, 2011, 02:09:57 pm »
DCS will let you run any DCS compatible program (BASIC included) and return to your program. I don't know how nice this will play with AXE programs though due to storage location of variables an such.
/e

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Writing to variables or executing a basic program
« Reply #6 on: January 05, 2011, 02:14:22 pm »
Yea, but what if the end user doesn't have DCS? (It is a lot of mem you know)
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Writing to variables or executing a basic program
« Reply #7 on: January 05, 2011, 02:16:25 pm »
(Yes I do know, it's worth it though :p)
Well then they can't run it. But right now that's the best method for ease of programming. Although maybe AXE should have a RunProg command/routine too :p
/e

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Writing to variables or executing a basic program
« Reply #8 on: January 05, 2011, 02:21:58 pm »
Yea, probably. Will you suggest? I'm at school, CAD1.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results: