IO.FLINE doubts and emulation

Anything QL Software or Programming Related.
User avatar
chernandezba
ROM Dongle
Posts: 34
Joined: Thu Dec 15, 2016 7:10 pm

Re: IO.FLINE doubts and emulation

Postby chernandezba » Sat Dec 16, 2017 11:47 am

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 ?


----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://sourceforge.net/projects/zesarux/
User avatar
tofro
QL Wafer Drive
Posts: 1375
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: IO.FLINE doubts and emulation

Postby tofro » Sat Dec 16, 2017 11:48 am

#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


User avatar
tofro
QL Wafer Drive
Posts: 1375
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: IO.FLINE doubts and emulation

Postby tofro » Sat Dec 16, 2017 11:50 am

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.


User avatar
chernandezba
ROM Dongle
Posts: 34
Joined: Thu Dec 15, 2016 7:10 pm

Re: IO.FLINE doubts and emulation

Postby chernandezba » Sat Dec 16, 2017 12:53 pm

I've made it!!!

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



Thanks a lot !!

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


----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://sourceforge.net/projects/zesarux/

Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 1 guest