Jump to content

Photo

Running E/A #5 from Extended BASIC loader

Extended BASIC Assembly

7 replies to this topic

#1 adamantyr OFFLINE  

adamantyr

    Stargunner

  • 1,177 posts

Posted Tue Nov 14, 2017 12:03 AM

Hey guys. Need some help with this one...

 

In particular, this one is focused on the internals of Extended BASIC, So I know we have some guru's around here on the subject. (Hey Rich!) I'm disappointed that the TI Tech pages fail to have any memory dumps or extensive exploration of the Extended BASIC cartridge.

 

I forget where I got it from, but I found this method long ago to execute the start of an EA option #5 program through Extended BASIC:

100 F$="DSK1.PROG" :: ON ERROR 200
110 CALL INIT :: CALL LOAD(8196,251,214) :: CALL LINK("OPT5",F$)
200 PRINT "DEVICE ERROR!":"CORRECT AND PRESS A KEY"
210 CALL KEY(0,K,S) :: IF S=0 THEN 210 ELSE RETURN 100

Clearly it's linking to some subprogram that's part of Extended BASIC's initializations called OPT5... I'm not sure why it's loading >FBD6 to >2004, but I presume it's over-writing a utility vector of some kind, the value there upon INIT is >4000 initially.

 

Anyway, this method works fine with most option 5 programs, but fails with my CRPG loader.... Probably because I'm placing my load program in low memory. I have it at the >3000 mark, so it should be preserving the part of low RAM it needs, but it still fails and just cycles endlessly.

 

Can anyone describe exactly what the above routine is doing, and if there's anything I can do to make it work? I could see the XB utility only working in high memory, so I suppose in that case I'll just have to embed the assembly code using SYSTEX and execute it directly...



#2 RXB OFFLINE  

RXB

    River Patroller

  • 2,812 posts
  • Location:Vancouver, Washington, USA

Posted Tue Nov 14, 2017 4:48 AM

Well RXB GPL source code is the Extended Basic sources if you go and delete all the RXB sections (I always label them) you could have a XB original source.

 

Also now we have the XB ROM source code too.

 

So this request for a dump of XB confused me?


Edited by RXB, Tue Nov 14, 2017 4:54 AM.


#3 senior_falcon OFFLINE  

senior_falcon

    Dragonstomper

  • 951 posts
  • Location:Lansing, NY, USA

Posted Tue Nov 14, 2017 6:30 AM

Hey guys. Need some help with this one...

 

In particular, this one is focused on the internals of Extended BASIC, So I know we have some guru's around here on the subject. (Hey Rich!) I'm disappointed that the TI Tech pages fail to have any memory dumps or extensive exploration of the Extended BASIC cartridge.

 

I forget where I got it from, but I found this method long ago to execute the start of an EA option #5 program through Extended BASIC:

100 F$="DSK1.PROG" :: ON ERROR 200
110 CALL INIT :: CALL LOAD(8196,251,214) :: CALL LINK("OPT5",F$)
200 PRINT "DEVICE ERROR!":"CORRECT AND PRESS A KEY"
210 CALL KEY(0,K,S) :: IF S=0 THEN 210 ELSE RETURN 100

Clearly it's linking to some subprogram that's part of Extended BASIC's initializations called OPT5... I'm not sure why it's loading >FBD6 to >2004, but I presume it's over-writing a utility vector of some kind, the value there upon INIT is >4000 initially.

 

Anyway, this method works fine with most option 5 programs, but fails with my CRPG loader.... Probably because I'm placing my load program in low memory. I have it at the >3000 mark, so it should be preserving the part of low RAM it needs, but it still fails and just cycles endlessly.

 

Can anyone describe exactly what the above routine is doing, and if there's anything I can do to make it work? I could see the XB utility only working in high memory, so I suppose in that case I'll just have to embed the assembly code using SYSTEX and execute it directly...

There is more to this XB program than meets the eye.  What you don't see is the embedded assembly routine.  CALL LOAD(8196,251,214) tells the CALL LINK routine that the subprogram name table starts at >FBD6 and if you look there using Classic99's debugger you should see OPT5, two spaces and the address where OPT5 starts.  I'm guessing it copies assembly code from high memory into low memory and then runs it from there, but it also is possible that the assembly code runs directly from high memory. 

 

Getting this to work for you would be tricky.  You'd probably have to disassemble the code to see what it does and then jigger things so it is loaded and run from a location that does not disrupt your own code.  It might be easier to just rewrite the code.



#4 RXB OFFLINE  

RXB

    River Patroller

  • 2,812 posts
  • Location:Vancouver, Washington, USA

Posted Tue Nov 14, 2017 7:15 AM

With so many XB versions and only a few that can run anything even C or Assembly EA5 or EA3 I recommend you pick a updated XB cart like RXB or another similar XB with these features.

 

RXB 2017 will have CALL EA("DSK.VOLUMENAME.FILENAME") that will see if the file is EA3 or EA5 and automatically load the proper version.

(I will use a section of RXB CALL CAT that looks for the file attributes and decide what loader to use.)

(I should mention "DSK#.FILENAME" will also work.) 

 

RXB 2017 will also have CALL XB("DSK.VOLUMENAME.FILENAME",1) this will run XB programs and does a CALL FILES(1), NEW then RUN "DSK.VOLUMENAME.FILENAME"

Yes you can finally have CALL FILES(0) if you want or up to CALL FILES(15) of course the XB program could only be 1 line long.



#5 adamantyr OFFLINE  

adamantyr

    Stargunner

  • Topic Starter
  • 1,177 posts

Posted Tue Nov 14, 2017 11:06 AM

There is more to this XB program than meets the eye.  What you don't see is the embedded assembly routine.  CALL LOAD(8196,251,214) tells the CALL LINK routine that the subprogram name table starts at >FBD6 and if you look there using Classic99's debugger you should see OPT5, two spaces and the address where OPT5 starts.  I'm guessing it copies assembly code from high memory into low memory and then runs it from there, but it also is possible that the assembly code runs directly from high memory. 

 

Getting this to work for you would be tricky.  You'd probably have to disassemble the code to see what it does and then jigger things so it is loaded and run from a location that does not disrupt your own code.  It might be easier to just rewrite the code.

 

Yeah, I did look in the debugger and there is nothing at that address at all following the INIT or the LOAD command. Nor can I find any trace of an OPT5 label anywhere in memory or in the Extended BASIC binaries.



#6 RXB OFFLINE  

RXB

    River Patroller

  • 2,812 posts
  • Location:Vancouver, Washington, USA

Posted Tue Nov 14, 2017 11:15 AM

 

Yeah, I did look in the debugger and there is nothing at that address at all following the INIT or the LOAD command. Nor can I find any trace of an OPT5 label anywhere in memory or in the Extended BASIC binaries.

LOL that is a sign that someone loaded it and saved it with XB using SAVE "DSK1.PGM" so the Syntax part was not copied.



#7 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,829 posts
  • HarmlessLion
  • Location:BUR

Posted Tue Nov 14, 2017 11:26 AM

I have an EA#5 loader for XB that was based on the Scratchpad loader a group of us collaborated on over at Yahoo a few years ago. Our belief is that it should load darn near anything (that EA can), as it has no 32k memory constraints at all (once the first DSRLNK call is made, it's running from scratchpad). You can give it a try: http://harmlesslion....software/loader

 

Source is included :)


Edited by Tursi, Tue Nov 14, 2017 11:35 AM.


#8 adamantyr OFFLINE  

adamantyr

    Stargunner

  • Topic Starter
  • 1,177 posts

Posted Tue Nov 14, 2017 11:38 AM

I have an EA#5 loader for XB that was based on the Scratchpad loader a group of us collaborated on over at Yahoo a few years ago. Our belief is that it should load darn near anything (that EA can), as it has no 32k memory constraints at all (once the first DSRLNK call is made, it's running from scratchpad). You can give it a try: http://harmlesslion....software/loader

 

Source is included :)

 

Precisely what I was looking for, thanks! :)

 

P.S. Worked like a charm too!







Also tagged with one or more of these keywords: Extended BASIC, Assembly

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users