NewsProductsSprinterSupportDownloadSprinter ForumAbout usLinksSite map Russian site

Reply to (Software programming for the computer Sprinter)
Fill out the form below to post a message on the forum. HTML is disabled. Markup is enabled, so you may use markup in your posts.

Username
Anonymous

Subject

Post Icon

Post

I want to preview my post .

In response to:
Poster: Denis Parinov
Subject: Re: WD1793 Floppy Disk Controller

0Fh Command/Status register
3Fh Track register
5Fh Sector register
FFh Drive Control register

In Spectrum configuration the port 0Fh also mapped to 1Fh for TRDOS compatibility.
But I would recommend to you don't use direct port access for it.
A Sprinter have BIOS functions for reading/writing any disk sectors.

for example:

At first, make reset disk and to set required parameters.


INIT_DISK
LD D,n ; drive number 0-FDD A, 1-FDD B, 80h-HDD C...
LD C,#51 ; reset disk
RST #08 ; BIOS call
;
LD D,n ; drive number
LD E,n ; sectors per track.
PUSH DE
LD A,D
LD C,#58 ; get disk parameters
RST #08 ; BIOS call
LD A,H
POP HL
PUSH HL
LD H,A
POP AF
LD IX,256 ; sector size
LD C,#59 ; set disk parameters
RST #08 ; BIOS call
RET


And next to use BIOS fn. 055h for reading.

 

DRV_READ: ; reading from disk
LD A,drv_type ; bit 0..3 - drive number
; bit 4..7 - drive type
; 0 - FDD
; 6 - ram-disk (reserved)
; 8 - HDD
; C - CD-ROM (reserved)
LD HL,sec_h ; sector number (high)
LD IX,sec_l ; sector number (low)
; (HL:IX - 32bit sector number, like LBA)
LD B,n_sec ; sectors count
LD DE,bufer_adr ; memory address for reading
LD C,#55 ;
RST #08 ; CF=0 - read OK
; CF=1 - read error