Author Topic: Hey world -gcolella  (Read 14014 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Hey world -gcolella
« Reply #15 on: February 08, 2011, 10:10:30 pm »
Well, to do some of the math functions, there is almost no difference in speed (like if you were to make your own floating point math routines, it would be similar to the OS codes). However, in almost all cases the speed increase is huge due in part to the fact that we usually don't use floating point numbers on the calc. Plus, we can draw directly to the screen to make sprites instead of using pixels and lines and stuff...

souvik1997

  • Guest
Re: Hey world -gcolella
« Reply #16 on: February 08, 2011, 10:13:51 pm »
And that BASIC is interpreted, while assembly is compiled.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Hey world -gcolella
« Reply #17 on: February 08, 2011, 10:18:46 pm »
Yeah... but I have been working on a code interpreter and interpreted code is about as fast as compiled code. It is actually all the parsing that slows BASIC down. Like for example, if you did sum({0,1,2,3,4,5} it has to convert all of those numbers that are separated by commas into 9 byte floating point numbers and it has to create a list temporarily that has those elements then it executes the sum( command. If they had made it "tokenize" the way it is done on an 89, the BASIC codes would be interpreted so much faster.

The downside is that tokenizing code for the first time may take a little while, but after that it no longer needs to tokenize (until the program is edited again). Also, tokenizing sometimes shrinks the program a little.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Hey world -gcolella
« Reply #18 on: February 10, 2011, 06:22:08 pm »
One major issue too is how much harder ASM is than TI-BASIC and Axe, due to TI-BASIC being closer to english than ASM. This is why there are so few ASM/Hex programmers compared to TI-BASIC and Axe. Basic is very slow, though, and data is large, so it effectively limits your freedom. We can do good BASIC games, though.

Welcome on the forums and I hope you enjoy your stay!

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Hey world -gcolella
« Reply #19 on: February 10, 2011, 06:24:29 pm »
Isn't the speed advantage huge? Especially on 83+'s, which I usually use now when I borrow from people (I lost my nSpire a little while ago)

It depends on what you're doing. The OS itself is written in ASM, so if you were to try doing the same things that the OS has to do to run BASIC, there'd be no significant improvement.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline gcolella

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +9/-0
    • View Profile
Re: Hey world -gcolella
« Reply #20 on: February 10, 2011, 06:42:43 pm »
I suppose, but for things like for loops and such that run so slowly, it seems like it would improve a lot.
Does anyone know of a routine that would let me make str->int? i would sanitize my input, it wouldn't have to deal with anything not a number. I could only find int->str googling.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Hey world -gcolella
« Reply #21 on: February 10, 2011, 06:44:13 pm »
In TI-BASIC? expr(Str1->A will convert a string into a number and store it in A. If you only want to convert part of the string, use the Sub( command as well.

In Axe, strings are already numbers. Just subtract E30 from the value pointed to by whatever pointer you're using.
« Last Edit: February 10, 2011, 06:46:08 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline gcolella

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 13
  • Rating: +9/-0
    • View Profile
Re: Hey world -gcolella
« Reply #22 on: February 10, 2011, 06:47:00 pm »
Well, that explains why I couldn't find a routine for it, it was self-explanatory. Thanks, I'm surprised it was that obvious and i didn't find it.

Ashbad

  • Guest
Re: Hey world -gcolella
« Reply #23 on: February 10, 2011, 07:39:56 pm »
ah, that's fine greg :)

can't believe I forgot about Expr() though O.o