Page 2 of 2

Re: IO.FLINE doubts and emulation

Posted: Sat Dec 16, 2017 11:47 am
by chernandezba
By the way, what should be the value for register A1 after returning from IO.FLINE?
If I return a 9 byte line, A1 return value should be input value A1+9 ?

Re: IO.FLINE doubts and emulation

Posted: Sat Dec 16, 2017 11:48 am
by tofro
#1 You don't seem to be tracing TRAP #4 - you should, although do don't need to emulate anything here. I'd expect a TRAP #4 to happen before the IO.FLINE traps. Also, in all of your logs, you should dump a6, as this might be part of the address after a TRAP #4
chernandezba wrote: Paranoid: Trap 3. D0=02H A0=00000020H A1=00000100H A6=0003F268H PC=0032AH is :
Paranoid: Trap 3: IO.FLINE. fetch a line of bytes
This one looks pretty reasonable - (a6,a1) is $3f368, a reasonable buffer address to load something to, also somewhat aligns with what we see in the MT.ALBAS trap.

In the next line, it's starting to get weird:
chernandezba wrote: Paranoid: IO.FLINE. Channel ID=32 Base of buffer A1=00000100H A3=0003FFF0H A6=00028000H
Paranoid: Returning IO.FLINE from our microdrive channel without error
Why did a6 suddenly change to $28000? If your trap emulation really changed something at $28000 + $100, you most probably already killed the system (explaining why you receive some trash as the channel name later on).

I guess your problem occurs exactly between those two traces and would start to investigate there.

Tobias

Re: IO.FLINE doubts and emulation

Posted: Sat Dec 16, 2017 11:50 am
by tofro
chernandezba wrote:By the way, what should be the value for register A1 after returning from IO.FLINE?
If I return a 9 byte line, A1 return value should be input value A1+9 ?
Exactly. Irrespectively of whether you had a buffer address relative to A6 or not, you should increment a1 by the number of bytes put into the buffer.

Re: IO.FLINE doubts and emulation

Posted: Sat Dec 16, 2017 12:53 pm
by chernandezba
I've made it!!!

I was geting an incorrect value for A6, correct value was 0003F368H

https://youtu.be/jh_5qZWvlBU[/youtube]

Thanks a lot !!

P.D. Seems the video is not shown. here is the link https://youtu.be/jh_5qZWvlBU

Re: IO.FLINE doubts and emulation

Posted: Sat Dec 16, 2017 1:04 pm
by martyn_hill
Very nice - well done!