Jump to content

Photo

Line number 0


24 replies to this topic

#1 jrhodes ONLINE  

jrhodes

    Chopper Commander

  • 153 posts
  • RUN "CS1"

Posted Sat Jul 7, 2018 7:58 PM

I know under normal (noob) usage, it is not possible to use 0 as a line number in XB, but i know i have seen it used.

I see it in XB programs that use the BXB / VDPUtil routine.

So if you can not enter that line normally, or even delete it if it is there, how do you successfully get it there to begin with?

I am guessing this requires a few well-placed CALL LOAD's to the right locations, or is there some other way of tricking XB into letting you use that no-no number for your own use?


Edited by jrhodes, Sat Jul 7, 2018 9:30 PM.


#2 Retrospect OFFLINE  

Retrospect

    Stargunner

  • 1,057 posts
  • Location:Wakefield, England

Posted Sun Jul 8, 2018 8:30 AM

I'm not sure how they lodge a line 0 in any TI basic  / XB environment ... it's done on the ZX Spectrum somehow, quite common in the early 80's ...

 

So I thought I'd try and trick a TI99 emulator into loading some code that already had a line 0 present.

 

I used JS99er, found here; http://www.js99er.net/

 

And then opened another browser, and used this neat little webpage; http://nivelleringsl...u/ti994a_basic/

 

(This app is useful in an odd way, because it "forces" illegal code into the ti on loadup, things the parser simply wouldn't allow for, if trying to code to the ti natively)

 

The code is pictured here;

Attached File  Screenshot 2018-07-08 at 3.24.59 PM.png   198.34KB   3 downloads

 

EDIT: I couldn't give you the tester file itself as my chromebook won't zip anything as yet

 

We get mixed results from TI Basic and Extended Basic.  XB simply locks up and does fuzzy graphics then dies.

Ti Basic is much more curious .... it gives us a BAD NAME IN 1 ... so I tell it , LIST 1, and it lists nothing, only giving us one number; 

8346 .... that's it, just that, nothing more.  What does 8346 signify and why does the TI Basic interpreter do this instead of locking like XB?


Edited by Retrospect, Sun Jul 8, 2018 10:11 AM.


#3 RXB OFFLINE  

RXB

    River Patroller

  • 3,304 posts
  • Location:Vancouver, Washington, USA

Posted Sun Jul 8, 2018 11:10 AM

In order to have a Line Number Zero you have to change the pointers to the first executable line in XB or TI Basic to be Line Number One.



#4 InsaneMultitasker OFFLINE  

InsaneMultitasker

    River Patroller

  • 2,205 posts

Posted Sun Jul 8, 2018 1:29 PM

This doesn't really answer your question but every now and then while editing a program using the FCTN-8 (REDO) keypress and arrow keys, the line I edited would be saved as line 0.  I think it had to do with editing the same line number twice and in a specific sequence.  30 years ago I knew how to reproduce this but no longer; it certainly was annoying when you went to RUN your program and discovered a line 0 had appeared.



#5 OLD CS1 OFFLINE  

OLD CS1

    Technomancer

  • 5,504 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Sun Jul 8, 2018 1:57 PM

This doesn't really answer your question but every now and then while editing a program using the FCTN-8 (REDO) keypress and arrow keys, the line I edited would be saved as line 0.  I think it had to do with editing the same line number twice and in a specific sequence.  30 years ago I knew how to reproduce this but no longer; it certainly was annoying when you went to RUN your program and discovered a line 0 had appeared.

 

Is line 0 unusable or non-executable?


  • RXB likes this

#6 InsaneMultitasker OFFLINE  

InsaneMultitasker

    River Patroller

  • 2,205 posts

Posted Sun Jul 8, 2018 2:14 PM

 

Is line 0 unusable or non-executable?

 

Usable and executable, but not editable by standard means.  IIRC, I used an XB utility called Super Extended BASIC to remove line 0. I still have the joystick cable dongle for that program somewhere in my parts bin.



#7 retroclouds OFFLINE  

retroclouds

    Stargunner

  • 1,627 posts
  • Location:Germany

Posted Sun Jul 8, 2018 2:33 PM

 
Usable and executable, but not editable by standard means.  IIRC, I used an XB utility called Super Extended BASIC to remove line 0. I still have the joystick cable dongle for that program somewhere in my parts bin.


Joystick cable dongle? Can you give some details on that. Would be interesting to know how the protection was implemented.

#8 InsaneMultitasker OFFLINE  

InsaneMultitasker

    River Patroller

  • 2,205 posts

Posted Sun Jul 8, 2018 3:39 PM

Joystick cable dongle? Can you give some details on that. Would be interesting to know how the protection was implemented.

I think the dongle just held the UP direction active.  I seem to recall being able to defeat the protection using a joystick. The program came on disk with the dongle. I think it was called SXB, not to be confused with the super extended basic module. I have an idea where I put it and will check later tonight.

 

Edit:  The program is called SUPERBASIC by Steven Karasek, released in 1987.  I'll copy the files to a disk image and post into a new topic.  It has some pretty neat features, like resequencing sections of code, that I had forgotten about.


Edited by InsaneMultitasker, Sun Jul 8, 2018 3:59 PM.


#9 InsaneMultitasker OFFLINE  

InsaneMultitasker

    River Patroller

  • 2,205 posts

Posted Sun Jul 8, 2018 9:50 PM

I know under normal (noob) usage, it is not possible to use 0 as a line number in XB, but i know i have seen it used.

I see it in XB programs that use the BXB / VDPUtil routine.

So if you can not enter that line normally, or even delete it if it is there, how do you successfully get it there to begin with?

I am guessing this requires a few well-placed CALL LOAD's to the right locations, or is there some other way of tricking XB into letting you use that no-no number for your own use?

 

I found this in my email archives. It comes from Fredrick Ohrstrom, written July 30 2013.  I have not tested the routine.  Be sure to do a CALL INIT at the command prompt - only need to do this once.

----------------------------------------------------

 

The program can be simplified for this particular problem.
Enter this program and run it (and do not forget to do "CALL INIT" first to be able to do loads.)

1 REM
110 CALL PEEK(-31950,SL1,SL2)
120 SL=SL1*256+SL2-65539
130 CALL LOAD(SL,0,0)

Now line number 1 has changed into 0.
Change 130 into "CALL LOAD(SL,0,1)"
runt the program again, and line number 0 has changed into 1.

It works by fetching the address of the last byte of the line number table (Peek at 0x8332 = -31950) then convert the first two bytes into an address in decimal notation, and subtract 3 bytes to get the last chunk of four bytes in the line number table.

The first two bytes of the chunk are the line number (we are overwriting those) the second two bytes is the address of the actual line data (we do not change that....)

Oh, and the line number table is sorted in decreasing order, which means that the last entry is the first line in the basic program.

If you mess with the numbers of other lines, the basic interpreter can get very confused.



#10 RXB OFFLINE  

RXB

    River Patroller

  • 3,304 posts
  • Location:Vancouver, Washington, USA

Posted Sun Jul 8, 2018 10:17 PM

Guess I should put a option in RXB to create and edit Line Number 0 (Zero)



#11 sparkdrummer ONLINE  

sparkdrummer

    Dragonstomper

  • 940 posts
  • Status? I don't need no stinkin' status!
  • Location:Phoenix,Arizona

Posted Mon Jul 9, 2018 1:16 AM

Attached File  CHGE_TO_0.txt   1.54KB   21 downloads



#12 Casey OFFLINE  

Casey

    Moonsweeper

  • 292 posts

Posted Mon Jul 9, 2018 2:24 PM

The errata document for TI Extended BASIC documented how to make a line 0 (as they were preparing to release V110) - but it involved using REDO. If you have a FG99 or a Version 100 Extended BASIC module, you should be able to create a line 0, but as mentioned, you can’t edit it. You can RES the program and whatever line 0 was will become line 100 though. (That was TI’s solution I think to remove line 0 from the program).

#13 InsaneMultitasker OFFLINE  

InsaneMultitasker

    River Patroller

  • 2,205 posts

Posted Mon Jul 9, 2018 4:57 PM

Guess I should put a option in RXB to create and edit Line Number 0 (Zero)

Is there a reason that TI did not allow the use of line 0?  I'm guessing the value zero is used in some of the tables as an 'end of table' marker among other things. It would be nice if RXB could remove line 0 without needing to RES or use a utility.  I'm not sure creating it is such a good thing in normal circumstances, besides the novelty of doing something TI told us not to do  ;)



#14 RXB OFFLINE  

RXB

    River Patroller

  • 3,304 posts
  • Location:Vancouver, Washington, USA

Posted Mon Jul 9, 2018 8:26 PM

 

Is line 0 unusable or non-executable?

Sorry have to modify the XB ROMs in order to implement use of editing Line Number 0 (Zero)



#15 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 3,251 posts
  • Location:Eagan, MN, USA

Posted Tue Jul 10, 2018 5:42 AM

Would typing 0 then ENTER delete line 0? If not it would be a nice spot to put some "permanent" credits or other info :)



#16 Casey OFFLINE  

Casey

    Moonsweeper

  • 292 posts

Posted Tue Jul 10, 2018 9:09 AM

No, I actually tried this last night with V100 XB. You can create line 0 by doing this:

10 PRINT
10 <FCTN-X> (to edit)
<REDO>
Delete the line number 10

LIST gives you:
0 PRINT
10 PRINT

If you try to delete line 0 by entering its number, you get a * BAD LINE NUMBER error

However, you can RESEQUENCE the program and it will renumber line 0 to 100 and then it can be deleted.

#17 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 3,251 posts
  • Location:Eagan, MN, USA

Posted Tue Jul 10, 2018 10:26 AM

No, I actually tried this last night with V100 XB. You can create line 0 by doing this:

10 PRINT
10 <FCTN-X> (to edit)
<REDO>
Delete the line number 10

LIST gives you:
0 PRINT
10 PRINT

If you try to delete line 0 by entering its number, you get a * BAD LINE NUMBER error

However, you can RESEQUENCE the program and it will renumber line 0 to 100 and then it can be deleted.

 

Does not work in Classic 99 or js99er. Will give it a shot on the real thing tonight.



#18 Casey OFFLINE  

Casey

    Moonsweeper

  • 292 posts

Posted Tue Jul 10, 2018 10:45 AM

It will only do it if you have V100 Extended BASIC. MESS has this, but I have it also in my FG99 in my real TI. That’s where I was able to do it. They fixed this in V110 Extended BASIC, which I think is what is included in Classic99
  • RXB likes this

#19 RXB OFFLINE  

RXB

    River Patroller

  • 3,304 posts
  • Location:Vancouver, Washington, USA

Posted Tue Jul 10, 2018 6:55 PM

It will only do it if you have V100 Extended BASIC. MESS has this, but I have it also in my FG99 in my real TI. That’s where I was able to do it. They fixed this in V110 Extended BASIC, which I think is what is included in Classic99

Every Single version of XB are Version 110 or later you can use.

 

Version 100 had tons of errors and problems,

 

I have the XB VERSION 110 GPL SOURCE CODE in RXB and all kinds of patches were needed to fix version 100 Extended Basic.



#20 jrhodes ONLINE  

jrhodes

    Chopper Commander

  • Topic Starter
  • 153 posts
  • RUN "CS1"

Posted Tue Jul 10, 2018 7:41 PM

I seem to recall though there was something XB 100 allowed you to do that 110 does not, and at least 1 developer actually took advantage of this behavior.
Still, i kind of wish i could replace my TI's built-in basic with your RXB, it's just that much better.
Some day, i'll get around to using a physical copy of it on my real TI, until then, i have been slowly playing around with it under Classic99.
FinalGrom99 and RXB have to be 2 of the best additions to the TI scene ever.


Edited by jrhodes, Tue Jul 10, 2018 7:42 PM.

  • RXB likes this

#21 OLD CS1 OFFLINE  

OLD CS1

    Technomancer

  • 5,504 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Tue Jul 10, 2018 7:43 PM

v100 allowed for some recursion in SUBs. I recall in various readings that TI corrected this not by checking for harmful recursion but just disallowing recursion period in v110.



#22 InsaneMultitasker OFFLINE  

InsaneMultitasker

    River Patroller

  • 2,205 posts

Posted Tue Jul 10, 2018 9:15 PM

No, I actually tried this last night with V100 XB. You can create line 0 by doing this:

10 PRINT
10 <FCTN-X> (to edit)
<REDO>
Delete the line number 10

LIST gives you:
0 PRINT
10 PRINT

If you try to delete line 0 by entering its number, you get a * BAD LINE NUMBER error

However, you can RESEQUENCE the program and it will renumber line 0 to 100 and then it can be deleted.

 

Boy, this sure looks like the same sequence that used to bite me long ago.   I could swear my primary XB cartridge was not V100, so could there have been V110 carts that still contained this error?  I'll have to dig around in my box for the cartridge.  Thanks for sharing these steps.


  • RXB likes this

#23 Casey OFFLINE  

Casey

    Moonsweeper

  • 292 posts

Posted Wed Jul 11, 2018 8:26 AM

I actually had a black cased V110 Extended BASIC module years ago that allowed for recursive subprogram calls, but the beige V110 Extended BASIC I had at the time (and the one I have now) did not. It wouldn’t surprise me if there were revisions made that still return 110 from CALL VERSION.

#24 OLD CS1 OFFLINE  

OLD CS1

    Technomancer

  • 5,504 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Wed Jul 11, 2018 9:20 AM

I actually had a black cased V110 Extended BASIC module years ago that allowed for recursive subprogram calls, but the beige V110 Extended BASIC I had at the time (and the one I have now) did not. It wouldn’t surprise me if there were revisions made that still return 110 from CALL VERSION.

 

Attached File  tim-and-eric-mind-blown1.gif   4.37MB   3 downloads

(This is also a rather apt representation of what my headaches feel like.)



#25 InsaneMultitasker OFFLINE  

InsaneMultitasker

    River Patroller

  • 2,205 posts

Posted Wed Jul 11, 2018 6:22 PM

I actually had a black cased V110 Extended BASIC module years ago that allowed for recursive subprogram calls, but the beige V110 Extended BASIC I had at the time (and the one I have now) did not. It wouldn’t surprise me if there were revisions made that still return 110 from CALL VERSION.

 

I think I found my cartridge.  It is "unique" in that it is not in a case because long ago, my TI innards were hung from the back of my desk with a cable between the console chassis (housing the keyboard) and the rest hidden out of site.  In those days, I used the XB cart for everything, with Funnelweb as the workhorse.   I will try to test it this weekend.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users