Apparently, on an actual calculator, I seem to be unable to store over 9,999 characters to a string, even though the actual limit is over 50,000 or something; that limit can be reached with CEmu. I did this code all from the home screen, and the result was this:


Code:

999→dim(L₁
Fill(1.00000001|E10+1.000000001|E10[i],L₁
toString(Ans)→Str1
Str1+Str1→Str1
Str1+Str1→Str1
Str1+Str1→Str1
Str1+Str1→Str1

On CEmu, I can get around this:
Interesting... Also, how did you get the custom RAM cleared screen?
Don't mind the name, lol. I used the CERMASTR tool earlier for a custom name. It's featured in one of the Last Millennial's videos.
SM84CE wrote:
Interesting... Also, how did you get the custom RAM cleared screen?

Yes, you can change it in the calc's memory...
As for the strings, your code will generate WAYYY more than 9999 characters

Code:
999→dim(L₁
Fill(1.00000001|E10+1.000000001|E10[i],L₁
toString(Ans)→Str1 //28972 characters
Str1+Str1→Str1 //57944 characters
Str1+Str1→Str1 //115888 characters
Str1+Str1→Str1 //231776 characters
Str1+Str1→Str1 //463552 characters

I think 9999 might be the limit for ICE, but definitely not the OS. I think the limit for the OS is probably one memory page which is 64k.
EDIT: After asking around, the page size is only an issue with the older z80s, but the size field of strings wasn't changed and is still 2 bytes long, which means that the limit is still 64k.
Update: you only have to do the Str1+Str1>>Str1 thing twice. I listed it a lot to show that I kept doing that to cause this error. This behaviour happened on CEmu too.


Looks like the limit on CEmu is 65,536 chara's; 9,999 on the actual hardware. Those are my estimates.
Can't reproduce, only get a memory error on both hardware and CEmu. (OS 5.2.1, 5.3.0.0037)
The TI-84 Plus CE does not have pages in its address space. The flash chip does have physical sectors, but that's another matter.

The OS does not have a limit of 65536 characters for strings. BASIC strings are token strings, and have no concept of characters directly. Each token can be one or two bytes. The limit for strings is 65535 bytes. This limit comes from the older Z80 models, which use a 16-bit size field. The size is stored in bytes, not characters. Otherwise, moving a string variable around in memory would require the OS to parse the whole string to figure out its actual size.

The OS might error out on strings larger than 9999 bytes tokens due to an old routine being limited to that. I haven't actually tested this, though. On the Z80 models, a string larger than 10ish K was impossible due to limited RAM.
Maybe it's due to CEmu having dynamic RAM unlike a physical calculator. What I mean is CEmu might add more RAM to the OS if it fills up. That's what I found out on my ROM on CEmu.

That's probably why strings on CEmu can be larger.

When I said characters earlier, I meant bytes. It's just, I didn't use any 2-byte characters when I made the long strings.

I also found out that on CEmu, storing over 64 KB to a string actually causes the string itself to roll over back to 0 bytes.
No, CEmu can't do that. The OS itself would be utter confused by such trickery. It depends on RAM being the right size.

If the string's length does "roll over" back to 0 bytes, then you've just leaked 64 K of RAM. The memory management routines have no way of figuring out that there's now a giant gap in RAM.
No, the issue is that you somehow mucked up your OS on your calculator at some point. A clearing of all archive and re-installation of the OS will show you that it will behave exactly the same as CEmu.
MateoConLechuga wrote:
No, the issue is that you somehow mucked up your OS on your calculator at some point. A clearing of all archive and re-installation of the OS will show you that it will behave exactly the same as CEmu.

Honestly, you're probably right.
Actually, I've seen this bug before, appending Ans (as a string) to itself several times on the homescreen.
This will rarely crash, but it has in the past.
This might have something to do with the boot code being 5.3.1, but the OS minimum being changed to 5.3.0?
I know you probably did this because your calc's name is custom Razz

But seriously, would TI ever in a million years consider what would happen in this scenario? Rolling Eyes
Ohh, good point. My boot code is 5.1.5.0014, yet it is running 5.3.0. But then it would not make sense because CEmu is using my hardware's dumped ROM; the boot codes and the OS would be identical. Yet CEmu can make strings up to 64 KB while on my actual calculator, I can only make less than 10 KB.
I kept doing Str1+Str1->Str1 on my calculator. When Str1 become more then 32Kb and i did it again, and Str1 became 11 bytes long (aka empty). No crash.
c4ooo wrote:
I kept doing Str1+Str1->Str1 on my calculator. When Str1 become more then 32Kb and i did it again, and Str1 became 11 bytes long (aka empty). No crash.

Maybe on the CE if you have more than 64K of RAM available, the field storing the actual length of the string overflows...
Update: i realized that on actual hardware (5.1.4; 5.3.0), running a program that continually stores strings with over 10,000 tokens does not cause a volatile error and lets the string overflow past 64 KB.

I had 4822 characters in a string, then I doubled it inside the program rather than the homescreen (code was Str7+Str7>>Str7:length(Str7)) and no crash!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement