Author Topic: What am I doing wrong here?  (Read 27723 times)

0 Members and 3 Guests 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: What am I doing wrong here?
« Reply #45 on: February 26, 2011, 01:47:56 pm »
Is there a particular reason you need to use the fractional part? In BASIC that can be useful, but in assembly it usually isn't needed or can be worked around, I believe... Unless you are making a math program... :D

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: What am I doing wrong here?
« Reply #46 on: February 26, 2011, 02:06:50 pm »
I'm using the decimal point to make the math for creating and using the elements compact. But if I get rid of the decimal point by multiplying the list by 100, that'll put commands 7&8 out of commission & half of command 6.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: What am I doing wrong here?
« Reply #47 on: February 26, 2011, 02:10:32 pm »
Hmmm something doesnt sound right here.  Lists can only hold 14 digits, no matter where the decimal place is, multiplying by 100 should not make you lose any data at all.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: What am I doing wrong here?
« Reply #48 on: February 26, 2011, 02:15:42 pm »
But Axe doesn't allow anything >2^16-1.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

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: What am I doing wrong here?
« Reply #49 on: February 26, 2011, 02:25:50 pm »
So what is the fractional part being used for?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: What am I doing wrong here?
« Reply #50 on: February 26, 2011, 02:27:32 pm »
Hmmm no i see the problem now.  The problem is unfortunately that Axe can only hold a max of 4.5 digits, and he is using all 14.  In that case, you would have to write your own routine to extract each digit individually, since it sounds like you aren't looking for the whole number anyway?

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: What am I doing wrong here?
« Reply #51 on: February 26, 2011, 02:33:04 pm »
Well, I'm not using all the digits, just 5. I'm using the fpart for the y coordinates
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

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: What am I doing wrong here?
« Reply #52 on: February 26, 2011, 02:34:15 pm »
Ah, okay! Is this a carry over technique from TI-BASIC?

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: What am I doing wrong here?
« Reply #53 on: February 26, 2011, 02:43:25 pm »
Yes. The program that generates the list is writ in Basic.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: What am I doing wrong here?
« Reply #54 on: February 26, 2011, 02:44:27 pm »
Oh, I see.

The problem is that when you store as a floating-point number, it's always stored in scientific notation (such as 3.2x10^1 as opposed to 32). So when you read from the number, you can't just read the first two digits and expect them to be the two digits before the decimal point. Sure, it would work for 3.2*10^1 (since the 3 and 2 are both in front of the decimal), but it fails for numbers below 10, since there's only one digit before the decimal (reading the first two digits of 9.0*10^0 gives you 90, not 9.0).

The exponent in this case is stored in the second byte of the floating point number ($82 in your example). Take that value and subtract $80, and that'll be the number of digits before the decimal point. So 3.2*10^1 would be stored as 00 82 32 00 00 00 00 00 00, while 9.0*10^0 would be stored as 00 81 90 00 00 00 00 00 00.

Hope this helps.
« Last Edit: February 26, 2011, 02:44:38 pm by Deep Thought »




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: What am I doing wrong here?
« Reply #55 on: February 26, 2011, 02:48:00 pm »
Ah, okay. Well if you are working in Axe it is much easier to simply make a list that uses 2 separate elements. However, it is even better if you can find a way to store the coordinates as bytes. You will need an assembly program (like an Axe program) to store the data as bytes, but it is easier and faster for assembly programs to work with bytes instead of floating point numbers.

EDIT: Ninja'd (ish)

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: What am I doing wrong here?
« Reply #56 on: February 26, 2011, 03:01:59 pm »
*Sigh* So how do I create a persisting Appvar?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

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: What am I doing wrong here?
« Reply #57 on: February 26, 2011, 03:06:48 pm »
Sorree... I may be able to work out a hex code... would that be useful?

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: What am I doing wrong here?
« Reply #58 on: February 26, 2011, 03:15:28 pm »
Well, I need the ability to dymamically (that is such a cool word) lengthen and store to the Appvar whilst simultaneously making sure I don't scribble over anything.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: What am I doing wrong here?
« Reply #59 on: February 26, 2011, 03:17:12 pm »
*Sigh* So how do I create a persisting Appvar?

GetCalc("appvNAME",2) would create an appvar with two bytes.

You can't really dynamically change its size, but you can make a new appvar with a larger size and copy the bytes over.