Jump to content
IGNORED

BASIC Wedge Autorun.sys calls illegal instruction when going to DOS


Recommended Posts

Hi all,

  For funzies, I tried to work on the wedge commands from here:

 

https://www.atariarchives.org/c3ba/page174.php

 

  The problem is that when you move from BASIC to DOS, the Atari hits an illegal opcode 9C24. I can't seem to figure out *why*.

 

I used Altirra 4.0 (Windows) and Atari800MacX and get the same result.

(I have an 800 and XL, just find it easier to do this on an emulator)

This happens on both the .asm and .bas files.

I tried it on DOS 2.0S on an Atari 800 and 800 XL emulator. Same result.

 

I haven't really paid much attention to Autorun.sys since it was always something that was created for me, not *by* me. I found that after BASIC loads, the contents of Autorun.sys loads into location $1F00. When switching to DOS, DOS itself seems to take up the space in $1F00, as Altirra showed me. It's right after DOS loads that the problem starts which makes me wonder if there's something stale happening.

If I used the KILL wedge and then go to DOS, the problem goes away. This makes me wonder if the handler is trying to pull from a memory location that is now overwritten by DOS. I haven't investigated it yet, but I did find a C9 24 in approximately the same location where the Autorun.sys binary was. It's not 9C24 but it was the closest I could find.

Stack trace didn't help.

Starting the disc without BASIC causes the same issue. It seems like this code is BASIC-dependent, and not written to not load if BASIC wasn't found.

One other thing which may or may not be relevant, is that the code seems to modify itself at INIT to hold the DOSINIT location so that the KILL command can restore the locations. However, Altirra shows that the memory is *not* updated with 0C0D like I'd expect.

 

Anyway, this was just bugging me today and I thought maybe someone could find out why this is breaking.

 

Edited by Starman
Link to comment
Share on other sites

It's not broken, you are just trying to use it wrong.

In order to go to DOS, you must first KILL the wedge and it's just the nature of the beast.

If your wish is to go back and forth often between BASIC and DOS then you might need to write a .BAS file that will load and invoke autorun.sys file again after you have entered BASIC by doing a DOS Run at address command (to get you back in BASIC) and then do Run"d1:startme.bas"

 

The way it works is a bit off, going to DOS should first KILL the wedge automagically.

And getting back into BASIC with the wedge active again shouldn't be a typing contest either.

Link to comment
Share on other sites

To be fair, there's nothing in the article saying the the illegal opcode would happen if you try and use DOS while the wedge is installed.

 

Like I said, I did this for fun (Christmas break boredom), so I just wanted to see if it would work because it looked interesting. I can write something that auto-kills the wedge when going to DOS, but re-loading it automatically when typing "B" to go to the cart is more of a challenge, I think. Maybe someone can fix it. For science.

  • Like 1
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...