Author Topic: numbers over 255^2  (Read 7583 times)

0 Members and 1 Guest are viewing this topic.

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: numbers over 255^2
« Reply #15 on: June 08, 2010, 11:56:38 pm »
In SUper Mario world, I think when screwing with lives they displayed in hex or with weird chars. Same for damage overflow in Final Fantasy 7.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: numbers over 255^2
« Reply #16 on: June 09, 2010, 12:20:25 am »
You can always display them manually...

This displays the 32-bit number in the location Str1, but destroys the number afterwards. (range of 0 to 4,294,967,295)

Lets Make Str1 hold 9000*9000 = 81,000,000  In Hex, that's 4D3F640.

Code: [Select]
:[04D3F640]->Str1
:
:For(D,0,9)
:0->A
:For(B,0,3)
:A*256+{Str1+B}->C^10->A
:C/10->{Str1+B}
:End
:Output(15-D,0,A+'0'▶Frac)
:End
:Disp i

Of course, you can extend this to any arbitrary length.

Please don't ask me how this works.  I looked up the algorithm on the learn z80 in 28 days tutorial.  I kind of see why it might work, but I don't really know it enough to explain.


could you explain this for me anyone?
:A*256+{Str1+B}->C^10->A
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________