Page 12 of 13
Re: MDV Low Level Routines
Posted: Mon Sep 12, 2016 1:06 pm
by mk79
That's the problem with only optimizing snippets. Depending on how "bad" is defined the instruction is allowed or not. In case of PC relative it's only valid as a source, true.
New offer:
Code: Select all
lea bad(pc),a1
movea.l (a1),a0
move.b d7,(a0)+
move.l a0,(a1)
Same amount of lines, but less code (10 vs 12 bytes), less cycles (32 vs 48) and less bus accesses (8 vs 12).
All the best, Marcel
Re: MDV Low Level Routines
Posted: Mon Dec 19, 2016 1:28 pm
by tcat
pjw wrote:tcat,
It would be really great if you could write up your findings, either as articles for publication or in one or more of the Wiki's - preferably both.
Keep QL-ing!
Per
Hi Per,Simon,All,
My quest is not right at its end yet. I will be replacing R/W head on one of the MDs, and setting it for lower speed. Then doing further tests.
You may follow other MD related threads at H/W section.
When I have enough confidence about my findings, I will share.
P.S. Currently looking for 2 more R/W heads to fix remaining units I have here.
Tomas
Re: MDV Low Level Routines
Posted: Sun Feb 26, 2017 11:25 am
by tcat
Hi,
Ii seems that `Minerva' MD.SELEC and MD.DESEL are vectored routines. I do not have much documentation but source code.
These are declared as
Code: Select all
s vec.w 4 ss wser 4 ss rser 4 md selec 4 md desel ; $160 - $166
Meaning that MD.SELEC=$164, MD.DESEL=$166, correct?
EDIT
Parameters documented as
Code: Select all
* d1 -i - drive to select (call for select only)
* a3 -ip - address of microdrive control register
* d0/d2 destroyed
I have problems calling these, is there some special treatment I am not aware of?
Many thanks.
Tomas
Re: MDV Low Level Routines
Posted: Sun Feb 26, 2017 11:59 am
by tofro
From some old Minerva "updates_doc" I happen to have on my hard disk:
MD.SELEC $164 Select microdrive unit
D1 drive number 1..8 ???
A3 $18020 preserved
D0/D2 destroyed
Call this in supervisor mode, with interrupts disabled, to select which of the microdrive units is to be started up. (N.B. D1.W should be 1..8).
A delay of about half a second after this call should be sufficient to ensure that the drive is up to speed.
MD.DESEL $166 Deselect microdrives
A3 $18020 preserved
D0/D1/D2 destroyed
Call this in supervisor mode, with interrupts disabled, to stop microdrives.
NB: All Minerva extended vectors need to be called with an offset of $4000!
Hope this helps
Tobias
Re: MDV Low Level Routines
Posted: Sun Feb 26, 2017 12:22 pm
by janbredenbeek
It can also be done from SuperBASIC. This comes from the QL Service Manual:
Jan.
Re: MDV Low Level Routines
Posted: Sun Feb 26, 2017 12:28 pm
by tcat
Hi Tobias, Jan,
NB: All Minerva extended vectors need to be called with an offset of $4000!
Ah, this was probably the missing bit, I was not aware of.
Could I also code it like this?
or
Good, I can also do the tests right from Super BASIC, did not know that.
Many thanks.
Tomas
Re: MDV Low Level Routines
Posted: Sun Feb 26, 2017 1:40 pm
by janbredenbeek
tcat wrote:Hi Tobias, Jan,
NB: All Minerva extended vectors need to be called with an offset of $4000!
Ah, this was probably the missing bit, I was not aware of.
Could I also code it like this?
Nope, this effectively calls absolute address $4166.
And this reads a long word from location $4166 and calls the address it points to. Effectively CALL PEEK_L($4166).
It's a pity that these routines were not vectored in Sinclair ROMs. But you could test the version using MT.INF and call the following addresses:
- MD.SELECT:
1.02: $2B64
1.03: $2B70
1.10: $2C56
MD.DESEL:
1.02: $2B5E
1.03: $2B6A
1.10: $2C50
Jan.
Re: MDV Low Level Routines
Posted: Sun Feb 26, 2017 3:12 pm
by tcat
Hi Jan,
I see, having said that, can I make these absolute addresses, $4000 relative for the `jsr $4000(a2) call'?
To make the calling code easier, while supporting most ROMs incl. `Minerva'.
Code: Select all
1.02: $2B64
1.03: $2B70
1.10: $2C56
Many thanks.
Tomas
Re: MDV Low Level Routines
Posted: Sun Feb 26, 2017 4:17 pm
by janbredenbeek
tcat wrote:Hi Jan,
I see, having said that, can I make these absolute addresses, $4000 relative for the `jsr $4000(a2) call'?
To make the calling code easier, while supporting most ROMs incl. `Minerva'.
Code: Select all
1.02: $2B64
1.03: $2B70
1.10: $2C56
No these addresses have to be called directly after checking the QDOS version.
I don't know the addresses of the MG ROM (v1.13) off hand but there are disassemblies around where you can find them (you should mask off the dot as it is replaced by the country code, e.g. 1G13 for German MG ROM).
If the version is not one of these (and >1.13) it's probably Minerva, and then you can call them via the vector address (with offset $4000).
Jan.
Re: MDV Low Level Routines
Posted: Sun Feb 26, 2017 6:24 pm
by Outsoft
Very thanks to all there!!!