Jump to content
IGNORED

very strange problem


Marius

Recommended Posts

Hey.

 

Just a simple question... with almost impossible to explain.

 

I have something VERY strange going on.

 

I have three routines

 

Routine ONE is at $4500-$4931

Routine TWO is at $5000-$50FF

Routine THREE is at $7000-$73FF

 

 

Routine ONE ends with JMP $5000

 

This works... but Routine TWO does not work...

 

At the moment I was almost pulling my hair out of my head, I thought: ok let me check one more thing.

 

I changed the JMP $5000 thing in routine one into RTS

 

so after running routine ONE it returns to the D1: prompt of DOS

then i typed RUN $5000 to start routine TWO.

 

And believe it or not: Routine TWO works!

 

So now is my question:

 

What is the difference here?

What is a difference between

 

Working:

 

Routine 1:

<CODE>

RTS

typing RUN $5000 in DOS

 

Routine2:

runs fine.

 

Non Working:

 

Routine 1:

<CODE>

JMP $5000

 

Routine 2:

fails

 

I'm using several macro's from IOMAC.LIB in routine 1. I'm suspecting something going wrong there.

Is this perhaps something left behind on the STACK?

 

I Understand it is hard to follow this problem, since you don't have my source. I can't provide the source for two reasons: it is on real Mac/65 code... and pretty much, so I can't type that over. And second: it is a non documentated code (by me) so before someone understands what is happening we are ages further :D .... So I hope someone has already a bright idea.... THANKS!

 

Marius

Link to comment
Share on other sites

An how is the executable structured? Maybe you have init address after routine 1 so the others are not loaded yet and when you RTS back to DOS it will load the rest... or something like it.

 

Yeah, I think that´s the problem. Marius seems to use the given rows of the g2ftut I did. There is a ini main, which must be rewritten into run main, if he wants to load all in a run. (If I remember correct there is a hint in the tutorials source about that.)

Link to comment
Share on other sites

No it has nothing to do with init or selftest.

 

The routine is stored in memory, and completely loaded. I load the different parts in memory, and they are all there (double checked)

 

Routine 1 is using IOMAC.LIB .

 

IN routine one the user of the program is asked to give in a few filenames, with complete path.

this info is stored in a textbuffer.

 

Routine 2 is saving this info to a diskfile.

 

The problem is that running routine 2 from the dosprompt (run $5000) actually does save the file.

But at the end of routine 1 JMP $5000 does not have this effect.

 

First I thought there was a problem with a IOCB channel not closed. But that is not the issue. Everything is closed, and routine 2 is properly opening the channel again. Even tested with another IOCB channel. Same (negative) result.

 

I'm still investigating the issue. I was from home a few hours, so I'm fresh again... let's get back to Mac/65

 

Marius

 

p.s. it is not with graph2font ... this program is going to be a very handy tool for SIO2USB.

Link to comment
Share on other sites

Finally I found it!!!

 

The fact that it does work from dos but not directly from routine 1, is caused by a weakness in routine 2.

 

The X-register was not set at all in Routine 2. But I think X is changed by DOS and has probably the right value.

 

But... when it is called from routine 1, X has the wrong value, so that is why it is not working.

 

It took me a LOT of time, but now I found.

 

Thanks for any suggestion guys... phew... such a small and 'dumb' mistake... took me another day of my life!

 

Greetz

Marius

Link to comment
Share on other sites

That'll get you just about every time.

 

Another weird one was when you inadvertantly got dumped into Decimal mode and your interrupt code would start acting weird. They fixed that with the XL though but of course it's good practice to CLD yourself too.

 

The funniest was that it had worked right all the time for days. Till I changed routine1... so I fixed every possible thing in routine 1, because i was 100% sure routine 2 was ok....

 

But the fact that routine 2 did worked well, was based on LUCK. The Luck that the X register had the right value as soon as it was called.

 

The change in routine 1 made that X had another value, and boom routine 2 failed to work.

 

Hehe... you can overlook these things 10.000.000 times and you won't see it.

 

But now it is fixed.

And 100% created on real equipment. It gives me always a very special feeling when I create software on my real atari 8bit, without the use of crosscompilers or emulators. It was all on my 800xl, using ramdisk and spartados.

 

The result is a tool for sio2usb... the first beta is on the Atari age 8bit forum :D

 

But who owns such a device?

 

Marius

Link to comment
Share on other sites

The result is a tool for sio2usb... the first beta is on the Atari age 8bit forum :D

 

But who owns such a device?

 

Marius

I have one. So I sometimes have the chance to connect at least one machine temporarly and have it for testing some programs on real ;)

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