Jump to content
Sign in to follow this  
--- Ω ---

TI Extended BASIC (Stuff)

Recommended Posts

Using Classic99's debugger and Rich's source code I found the XB code where the stack pointers are set. At Grom >690B the code is BF240958 BD6E24 BDA3886E or in human-speak:

DST >0958,@>8324 Initialize base of value stack

DST @>8324,@>836E Initialize value stack pointer

DST @>836E,[email protected]>0388 Initialize pointer in VDP too

You can see that the XB cart is hard coded to always set the stack to be >0958.


By making a minor change to the grom code at >690B the programmer can have the ability to reserve VDP ram by changing the base of the value stack.

DST [email protected]>0958,@>8324

This code copies the value stored in V0958 into >8324. If the value at >0958 is >095A then the stack space is as large as it can be: just 2 bytes less than standard XB.


To try this out in Classic 99:

Press 2 for Extended BASIC

Edit>Debugger

Press F1 to freeze the program

Where the cursor is flashing:

G690B=BD apply \

G690D=A9 apply Choose yes when asked to modify grom

G690E=58 apply /

V0958=09 apply

V0959=58 apply


Press F1 to unfreeze XB. Now any value you put at V0958 will change the stack pointer and reserve vdp memory. Try putting >1820 into V0958 and now VDP ram from >095A to >181F is reserved - XB will not touch it. (XB256 and Missing Link use this technique but with an interrupt routine so they will work with a standard XB cartridge.)


If you wanted to permanently modify XB you would need to change the grom code as above and add 5 bytes of code early in XB startup to put >095A into V0958. (DST >095A,[email protected]>0958)


Other than that nothing else should be needed. Since anyone using this would be programming in assembly anyway, there is really no need for a new CALL. It is simple enough to write an assembly subroutine such as CALL LINK("RESVDP",6176) to change the value at V0958.

Edited by senior_falcon
  • Like 7

Share this post


Link to post
Share on other sites

RXB 2018 now has CALL VDPSTACK(address) so you can move the VDP STACK to a desired location.

Share this post


Link to post
Share on other sites

I just discovered this possibility that might be useful in a certain situation.

You can not only use RUN inside a program in combination with some FILE to load another file.

You can also use RUN inside a program with a certain Program Line.
The difference to a GOTO with the same Program Line is that all variables are reintialized.

 

Extended Basic


100 A=1
110 RUN 130
120 B=2
130 C=3
140 PRINT "A : ":A;" REINITIALIZED BY RUN"
150 PRINT "B : ":B;" SKIPPED LIKE WITH GOTO"
160 PRINT "C : ":C

 

RUN leads to the following output

 

A :

 0  REINITIALIZED BY RUN
B :
 0  SKIPPED LIKE WITH GOTO
C :
 3

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

RXB 2019 also has CALL PLOAD(B,"DSK1.PNAME") 

for example you could load into memory at >B000 new lines to an XB program while running a XB program.

As long as that new section does not have any new variables or strings not initialized or commands not checked by prescan it should work fine.

 

Thus you could replace 4K of lines in a program and page in as many as you want from a running program.

(Without needing RUN that would erase all variables values.)

 

Of course you have to carefully construct the XB program so the boundary lies exactly at >B000 but a REM line can pad it to proper size.

  • Like 1

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...