[zxspectrum] Re: Lettura parametri disco Opus

  • From: Davide Barlotti <davide.barlotti@xxxxxxxxxx>
  • To: "zxspectrum@xxxxxxxxxxxxx" <zxspectrum@xxxxxxxxxxxxx>
  • Date: Thu, 28 Jun 2018 15:11:13 +0000

Ciao Enrico,

non so se può essere utile ma in questo addendum spiega qualcosa come accedere 
al settore 0 fisico (non logico)

Addendum for OPUS Discovery 2.22  Disassembly.    Roelof Koning 1995/2007.
-------------------------------------------------------------------------------------
A few remarks regarding the disassembly for version.2.2., as found on WOS.

-- About #0000 (Reset): This is an entry point where Opus pages in during a 
Spectrum Reset. Not the address #0000 is stacked but address #0001 in order to 
prevent an endless loop. 
-- About #0048 (Key-Int ): This is an entry point where Opus pages in on every 
interrupt. The fact that the return address is held in Table #0E opens the 
possibility to extend the Interrupt Routine when a 6116 RAM is present.
-- At #0030 (Look-up) the disassembly says that 'B' holds the 'table-entry', 
where later the tables concerned are called sub-tables, which they in fact are. 
The 'table' in which 'B' is used is a sub table from the table of which the 
number is given in the DEFB. The value in 'A' determines which subtable is 
chosen.
-- At #1462 : DE is made to hold the default catalogue length, and not the 
actual catalogue length as this is not copied into the disktable in RAM.
-- At #18E5 is byte 3 given as "extra sectors". In fact it is the starting 
number for a sequence of sector numbers on a track, only relevant when 
formatting.
-- At #18E5 is bytes 4-5 are given as "bootblock-1" where it should say 'number 
of reserved sectors'. 
-- At #18E5 is byte 7 given as 'control register' where it should say 'Command 
Mask'. All commands for the FDC (WD1770) hold four bits for information 
concerning hardware related issues. The bits give information about 'head 
settling delay', 'write compensation', 'spin up sequence' etc., and must be 
blended into every command code for the FDC. Such command of course goes into 
the command register. 
-- At #18E5: Byte 9 in the disk information table is unused.
-- At #1C3E : The 'lost-block' is not lost, nor stored in a specially reserved 
block. 
In fact it is the boot sector stored on the first sector on disk, which is 
(hard) side 0, 
track 0, sector 0. This 'absolute' sector 0 is not the 'logical' sector 0, as 
(at least) one sector is 'reserved'. (Offset => 1)
Note that the number 65536 which is suggested  for calculating the block number 
of the bootsector is just 00000 (zero) in Machine Code. Which indeed is the 
absolute number of the boot sector...... The whole exercise comes down to 
subtracting the offset beforehand, so that when DOS adds the offset as usual 
during the process, the final result is an absolute sector number and not a 
logical one. 



________________________________________
Da: zxspectrum-bounce@xxxxxxxxxxxxx <zxspectrum-bounce@xxxxxxxxxxxxx> per conto 
di Enrico Maria Giordano <e.m.giordano@xxxxxxxxxxxxxxx>
Inviato: giovedì 28 giugno 2018 14:04
A: The ZX Spectrum Mailing-List
Oggetto: [zxspectrum] Re: Lettura parametri disco Opus



Il 28/06/2018 10:50, Enrico Maria Giordano ha scritto:

Secondo voi questa routine ha qualcosa che non va?

PRM CALL 5896
     LD   A,(DRV)
     LD   BC,0400H
     CALL CPH
     LD   (BLK),HL
     LD   (CAT),DE
     JP   5960

Se chiamata solo all'inizio del programma va tutto bene ma se la
richiamo durante l'esecuzione del programma allora succede qualcosa per
cui poi il programma stesso si blocca.

Anche perché allora non si capisce perché quest'altra, che legge un
settore dal dischetto e che è molto simile alla precedente, funziona
perfettamente:

RDS CALL 5896
     LD   A,(DRV)
     LD   BC,0200H
     LD   HL,(SCT)
     LD   DE,STA
     CALL CPH
     JP   5960

Dove posso trovare la sintassi esatta e qualche esempio d'uso di queste
funzioni dell'Opus?

EMG

--
http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg


Other related posts: