Jump to content
IGNORED

Line number 0


jrhodes

Recommended Posts

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
  • Like 2
Link to comment
Share on other sites

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://nivelleringslikaren.eu/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;

post-34058-0-10125100-1531060036_thumb.png

 

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

  • Like 1
Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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
  • Like 3
Link to comment
Share on other sites

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.

  • Like 4
Link to comment
Share on other sites

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).

  • Like 1
Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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
  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

post-27864-0-66703600-1531321963.gif

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

  • Like 1
Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...