Marius Posted February 18, 2011 Share Posted February 18, 2011 Hi. It has been years ago I have been using Turbo Basic XL 1.5. I'm more a Mac/65 user, but I wanted to try some things out in TurboBasic. What is the memory address to jump to, to get back in turbobasic (without losing my program?) With mem.sav on the disk, I guess everything is stored. Run Cartridge doesn't work ofcourse.... (I can remember I once adapted DOS 2.5 to let Run Cartridge return to Turbo Basic) but that was somewhere in 1988, and now it is 2011, and I have NO idea where I left that disk, AND I have no idea what memory address I used for that) Thanks for any help! Marius Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 18, 2011 Share Posted February 18, 2011 (edited) You can just press RESET can't you and return to TBasic? In that case, $E474. Getting a program such as that to live with DOS is a little tricky. My guess would be that it uses CASINI (2,3) with bit 1 set in BOOTFLG (9). The CASINI routine could temporarily steal the DOS vector ($A,B). The OS will always jump through that vector if no cartridge is present or Basic isn't enabled, by default it will go to SelfTest, it's up to DOS or a loaded program to set it otherwise. Once it has control, the program could set it back to it's previous value so DOS can still be called. An alternate method might be to leave Basic enabled and use a CASINI routine to disable the Basic ROM. In theory, the OS should then call the ROM-based INIT routine for the Basic ROM, but the RUN vector it calls will be the RAM-based one if you switch out Basic ROM with your CASINI routine. It should be easy enough to work out how TBasic does it's stuff. Edited February 18, 2011 by Rybags Quote Link to comment Share on other sites More sharing options...
Marius Posted February 18, 2011 Author Share Posted February 18, 2011 You can just press RESET can't you and return to TBasic? In that case, $E474. Reset = Returning to DOS I found with SuperPacker that the startaddress = $6000 That works fine. But program = gone. Is there an address available to JMP to, and the Basic Program stays in memory? I thought I had that in the past... but I might remember that wrong. Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 18, 2011 Share Posted February 18, 2011 A third method could be to just use CASINI as mentioned before, but not return to the OS. The CASINI routine could do the remainder of the required stuff, ie - call DOSINI ($C,D) if bit 0 of BOOTFLG is set. Doing it that way, you don't need to tamper with DOSVEC. Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 18, 2011 Share Posted February 18, 2011 (edited) I found with SuperPacker that the startaddress = $6000 That works fine. But program = gone. Is there an address available to JMP to, and the Basic Program stays in memory? The way many languages determine if an implied "NEW" is required is to check the WARM flag ( 8 ). If it's zero, then it assumes that it's the first-time init call so will coldstart the language. In normal operation you don't call the init routine until the user presses RESET, at which time the WARM flag will have value $FF. So maybe try setting that location to $FF before doing the RUN $6000. Of course on a real machine it's a bit hard to just set a RAM location to what you want. You could create a short file that does it. e.g. load DOS, press RESET, then Binary Save start/end 8,8, RUN address $6000. Edited February 18, 2011 by Rybags Quote Link to comment Share on other sites More sharing options...
Marius Posted February 18, 2011 Author Share Posted February 18, 2011 Of course on a real machine it's a bit hard to just set a RAM location to what you want. Well... I have "the BlackBox" and with that device it is easy. But unfortunately it didn't work. Perhaps I should not type DOS in TurboBasic hehe Thanks for all your help. Dos 2.5 has a very strange way of 'run cartridge' ... it is setting the VBI adresses and that's it. It is not doing a JMP $a000 or something like that. I was hoping it would do a JMP $a000, so it would be easy to hack DOS 2.5 to leave easily to turbobasic by typing B in the menu. Well I will study your solution with Cas INI. But not now. It is not THAT important. Greetz M. Quote Link to comment Share on other sites More sharing options...
Marius Posted February 18, 2011 Author Share Posted February 18, 2011 Well... I found on a PAGE 6 (new Atari User) disk a tool that does almost the same as my solution back in the late 80's. I will post the tool soon here in the thread, but now it is bed time. Greetz M. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted February 18, 2011 Share Posted February 18, 2011 $6000 must be part of the TB loader code which puts the executable under the OS ROM. None of the resident part of TB (that I'm aware of) resides at $6000, so by jumping to that address I suspect you're re-executing the initialization code (which just happens not to have been overwritten by your basic program), which is in turn resets all the pointers and effectively executes a "NEW" statement. TB might "unhook" itself irreversibly upon an exit to DOS. In any case, inspecting the Reset trap will surely reveal the answer. I seem to recall the low RAM part of TB residing between $1F00 and $2xxx, and the rest, of course, is normally between $C000-$FFF9. Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 18, 2011 Share Posted February 18, 2011 Running a trace in Altirra might reveal what's needed. Quote Link to comment Share on other sites More sharing options...
Roydea6 Posted February 18, 2011 Share Posted February 18, 2011 I found an Atr of DOS 2.5 with Turbobasic as an autorun.sys, and the DOS version return to Turbobasic with the B key. TURBOBASIC ENHACEMENT BY RAPHAEL JAMES ESPINO DOS25TB - Bkey.ATR Quote Link to comment Share on other sites More sharing options...
+therealbountybob Posted February 19, 2011 Share Posted February 19, 2011 Well... I found on a PAGE 6 (new Atari User) disk a tool that does almost the same as my solution back in the late 80's. I will post the tool soon here in the thread, but now it is bed time. Greetz M. You can sometimes use run at address 2080 to return to Turbo BASIC from DOS, but the Enhanced DOS 2.5 patch is on Page 6 Magazine disk #77 - Run the Turbo BASIC program DOSENH.TB, it creates a file called ENHDOS - Binary Load this from DOS and then write the DOS files to your disk Note: this DOS must not be used with Atari BASIC. It needs the MEM.SAV file to be available. Is there a website/blog for Turbo BASIC anywhere If not why not :!: Quote Link to comment Share on other sites More sharing options...
+MrFish Posted February 21, 2011 Share Posted February 21, 2011 I found on a PAGE 6 (new Atari User) disk a tool that does almost the same as my solution back in the late 80's. I will post the tool soon here in the thread, but now it is bed time. You can sometimes use run at address 2080 to return to Turbo BASIC from DOS, but the Enhanced DOS 2.5 patch is on Page 6 Magazine disk #77 - Run the Turbo BASIC program DOSENH.TB, it creates a file called ENHDOS - Binary Load this from DOS and then write the DOS files to your disk Note: this DOS must not be used with Atari BASIC. It needs the MEM.SAV file to be available. Is there a website/blog for Turbo BASIC anywhere If not why not Carsten S. has a section in his Wiki, but there isn't much info there at this point. Yes, there should be a better repository available on the web, as TBXL is still used quite a bit among BASICs. Quote Link to comment Share on other sites More sharing options...
Marius Posted February 21, 2011 Author Share Posted February 21, 2011 The ATR included in this Thread, is the tool I meant yes. Back in the days I created such a thing myself, but this one is BETTER and looks neat. Thanks for providing it here, now I don't have to dig it up hehe. I'm not a BASIC programmer anymore. Since I discovered Mac/65 in 1994 I'm very happy with Assembler. It is versatile language. But....... When I started this thread I wanted to create something to test, and I was not motivated enough to write all kind of new routines in Mac/65, so I thought: why not... use basic. I missed a hany way of creating procedures and I could not remember the line numbers to GOSUB too in Atari Basic. So I grabbed TurboBasic. Well... I have to say: It's an impressive Basic. It's definately better, and it is worth a try for sure. To write test-routines it's perfect for me. I have now a turbobasic 'disk' on my harddisk. Unfortunately this 'back to basic' option is for Dos 2.5, so no harddisk support, but it's not that important. Thanks! Marius Quote Link to comment Share on other sites More sharing options...
+MrFish Posted February 21, 2011 Share Posted February 21, 2011 Here's some files that might be useful for others. They are the syntax defs for "Turbo BASIC" and "PL65", as well as several other related config files, for coding in "Crimson Edit" (popular freeware text editor): Crimson Edit - Turbo BASIC Config.zip Crimson Edit - PL65 Config.zip Quote Link to comment Share on other sites More sharing options...
+CharlieChaplin Posted March 1, 2011 Share Posted March 1, 2011 (edited) Afaik, in Turbo-DOS XL/XE by Reitershan (and probably other DOS versions) one can set a back-adress, the adress where DOS jumps when the "cart." gets activated via CAR command or option B from the menu. For TB XL this back adress is $2080, you could use other back adresses for many other programs... -Andreas Koch. Edited March 1, 2011 by CharlieChaplin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.