Jump to content

Photo

PRINT CHR$(14913) prints "A"


4 replies to this topic

#1 Ed in SoDak OFFLINE  

Ed in SoDak

    Moonsweeper

  • 414 posts
  • Location:Black Hills of South Dakota

Posted Thu Mar 8, 2018 7:46 PM

Just a quirk of the TI99/4A I'm sure, but thought it interesting, though hardly useful. If you redefine A, it will show up at 14913 the same as CHR$(65). I was messing around and discovered the character set is repeated over and over as you increase the character numbers on upwards, till at some point around 32000 it scrambled part of my line of code I had written to enter and display it.

 

Attempting to redefine char# 14913 or any number other than the usual results in an error. But changing #65 redefines all the repeating A characters wherever they may be, and there's many duplicated character sets as you keep looking.

 

OK, I'm bored, how else to explain? :)

-Ed


Edited by Ed in SoDak, Thu Mar 8, 2018 7:50 PM.


#2 Schmitzi OFFLINE  

Schmitzi

    River Patroller

  • 4,376 posts
  • ToXiC
  • Location:Germany

Posted Thu Mar 8, 2018 8:23 PM

is it playground phantom RAM ? ;)



#3 Ed in SoDak OFFLINE  

Ed in SoDak

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Black Hills of South Dakota

Posted Thu Mar 8, 2018 8:40 PM

Must be, and I don't even have Playground. I saw something digging in my sandbox out in the yard, then a scratching noise beneath the floor under my TI. Should I worry? :skull:

-Ed



#4 Lee Stewart ONLINE  

Lee Stewart

    River Patroller

  • 3,765 posts
  • Location:Silver Run, Maryland

Posted Thu Mar 8, 2018 10:02 PM

Just a quirk of the TI99/4A I'm sure, but thought it interesting, though hardly useful. If you redefine A, it will show up at 14913 the same as CHR$(65). I was messing around and discovered the character set is repeated over and over as you increase the character numbers on upwards, till at some point around 32000 it scrambled part of my line of code I had written to enter and display it.

 

Attempting to redefine char# 14913 or any number other than the usual results in an error. But changing #65 redefines all the repeating A characters wherever they may be, and there's many duplicated character sets as you keep looking.

 

OK, I'm bored, how else to explain? :)

-Ed

 

I suspect the highest number you managed to get ‘A’ to print was 32577.  CHR$() will only accept 16-bit positive integers (0 – 32767).  Anything else (after rounding) will generate an error message.  Though the manual does not say it, I am pretty sure CHR$() only processes the least significant byte (LSB)—making the value processed, 0 – 255.  This would be the explanation for the cyclic printing of ‘A’.  The highest such value that results in an LSB of 65 is 32577.

 

I am not sure how to explain the corruption of your line of code, however.

 

...lee



#5 Ed in SoDak OFFLINE  

Ed in SoDak

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Black Hills of South Dakota

Posted Fri Mar 9, 2018 12:31 AM

Thanks Lee, your explanation makes sense. The T/S1000 has several ghosts of the ROM due to incomplete RAM addressing, I thought it may have been something like what happens on that machine. But the LSB truncating is the likely scenario.

 

My "program" was essentially one line of code that used a for/next loop to incrementally display chr$(n). I just kept upping the start/end numbers and running again. After reading your reply, I wasn't able to quickly replicate the scrambled bit of my program line. When it happened the first time around, I was just picking higher numbers out of the air and not really noting what numbers I'd typed when the entered code listing went a bit screwy..

 

It changed the CALL CLEAR in the program line 30 with the for/next loop to a portion of line 20 in my little experiment that wasn't being run since I commented line 20 out with an ! exclamation point. Simply editing the line 30 corrected it and I was able to run it again.

 

Trying to replicate this error, I came across the error report, but the code was not scrambled as before.

 

Like I said odd, but useless. At first I lept to the conclusion I had discovered "hidden" charsets, but doubted that, so I wrote this code to see if I could redefine these high character numbers. You cannot redefine them, they only display or print. No redeeming value to having that "ability."

 

-Ed


Edited by Ed in SoDak, Fri Mar 9, 2018 12:37 AM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users