mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-12 09:57:05 +03:00
686 lines
21 KiB
PHP
686 lines
21 KiB
PHP
|
;**********************************************************
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>।<EFBFBD>⢥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠡ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>᪠
|
|||
|
;**********************************************************
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㫠<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쥢<EFBFBD><EFBFBD>.
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>ࠡ<EFBFBD>⪠ Mario79
|
|||
|
fdd_read_and_write:
|
|||
|
pusha
|
|||
|
read_sector:
|
|||
|
cmp eax,1
|
|||
|
jne write_sector
|
|||
|
call save_HTS_values
|
|||
|
call flp_readsector
|
|||
|
call give_back_application_data
|
|||
|
jmp fdd_read_end
|
|||
|
write_sector:
|
|||
|
cmp eax,2
|
|||
|
jne fdd_read_end
|
|||
|
call save_HTS_values
|
|||
|
call take_data_from_application
|
|||
|
call flp_writesector
|
|||
|
fdd_read_end:
|
|||
|
popa
|
|||
|
ret
|
|||
|
|
|||
|
save_HTS_values:
|
|||
|
mov [FDD_Sector],bl
|
|||
|
mov [FDD_Head],bh
|
|||
|
shr ebx,16
|
|||
|
mov [FDD_Track],bl
|
|||
|
mov [FDD_Type],bh
|
|||
|
ret
|
|||
|
|
|||
|
give_back_application_data: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov edi,[3010h]
|
|||
|
mov edi,[edi+10h]
|
|||
|
add edi,ecx
|
|||
|
give_back_application_data_1:
|
|||
|
mov esi,0xD000 ;FDD_DataBuffer ;0x40000
|
|||
|
xor ecx,ecx
|
|||
|
mov cx,128
|
|||
|
cld
|
|||
|
rep movsd
|
|||
|
ret
|
|||
|
|
|||
|
take_data_from_application: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov esi,[3010h]
|
|||
|
mov esi,[esi+10h]
|
|||
|
add esi,ecx
|
|||
|
take_data_from_application_1:
|
|||
|
mov edi,0xD000 ;FDD_DataBuffer ;0x40000
|
|||
|
xor ecx,ecx
|
|||
|
mov cx,128
|
|||
|
cld
|
|||
|
rep movsd
|
|||
|
ret
|
|||
|
|
|||
|
flp_initialization:
|
|||
|
; <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠡ<EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call SetUserInterrupts
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call FDDMotorON
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; mov [FDD_Track],0
|
|||
|
; mov [FDD_Head],0
|
|||
|
; mov [FDD_Sector],1
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ४<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㫥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call RecalibrateFDD
|
|||
|
call SeekTrack
|
|||
|
ret
|
|||
|
|
|||
|
flp_readsector:
|
|||
|
call flp_initialization
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call ReadSectWithRetr
|
|||
|
; call ReadSector
|
|||
|
; cmp [FDC_Status],0
|
|||
|
; jne @@SectorNotFound
|
|||
|
mov [fdc_irq_func],fdc_null
|
|||
|
; call FDDMotorOFF
|
|||
|
ret
|
|||
|
|
|||
|
flp_writesector:
|
|||
|
call flp_initialization
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call WriteSectWithRetr
|
|||
|
; call WriteSector
|
|||
|
; cmp [FDC_Status],0
|
|||
|
; jne @@SectorNotFound
|
|||
|
mov [fdc_irq_func],fdc_null
|
|||
|
; call FDDMotorOFF
|
|||
|
ret
|
|||
|
|
|||
|
@@DiskNotFound:
|
|||
|
ret
|
|||
|
@@SectorNotFound:
|
|||
|
ret
|
|||
|
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (FDC_Status)
|
|||
|
FDC_Normal equ 0 ;<EFBFBD><EFBFBD>ଠ<EFBFBD>쭮<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD>
|
|||
|
FDC_TimeOut equ 1 ;<EFBFBD>訡<EFBFBD><EFBFBD> ⠩<EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FDC_DiskNotFound equ 2 ;<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>᪠
|
|||
|
FDC_TrackNotFound equ 3 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FDC_SectorNotFound equ 4 ;ᥪ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>ᨬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>न<EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> ᮮ⢥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD>ࠬ <EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD>⭮<EFBFBD><EFBFBD>
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>᪠ <EFBFBD><EFBFBD>ꥬ<EFBFBD><EFBFBD> 1,44 <EFBFBD><EFBFBD>)
|
|||
|
MAX_Track equ 79
|
|||
|
MAX_Head equ 1
|
|||
|
MAX_Sector equ 18
|
|||
|
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 ⨪<EFBFBD><EFBFBD> ⠩<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
TickCounter dd ?
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FDC_Status DB ?
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FDD_IntFlag DB ?
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>砫<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FDD_Time DD ?
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FDD_Type db 0
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>न<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FDD_Track DB ?
|
|||
|
FDD_Head DB ?
|
|||
|
FDD_Sector DB ?
|
|||
|
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> १<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨
|
|||
|
FDC_ST0 DB ?
|
|||
|
FDC_ST1 DB ?
|
|||
|
FDC_ST2 DB ?
|
|||
|
FDC_C DB ?
|
|||
|
FDC_H DB ?
|
|||
|
FDC_R DB ?
|
|||
|
FDC_N DB ?
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD>⥭<EFBFBD><EFBFBD>
|
|||
|
ReadRepCounter DB ?
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 ४<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
RecalRepCounter DB ?
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
;FDD_DataBuffer: times 512 db 0 ;DB 512 DUP (?)
|
|||
|
fdd_motor_status db 0
|
|||
|
timer_fdd_motor dd 0
|
|||
|
|
|||
|
;*************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;*************************************
|
|||
|
Init_FDC_DMA:
|
|||
|
pushad
|
|||
|
mov al,0
|
|||
|
out 0x0c,al ; reset the flip-flop to a known state.
|
|||
|
mov al,6 ; mask channel 2 so we can reprogram it.
|
|||
|
out 0x0a,al
|
|||
|
mov al,[dmamode] ; 0x46 -> Read from floppy - 0x4A Write to floppy
|
|||
|
out 0x0b,al
|
|||
|
mov al,0
|
|||
|
out 0x0c,al ; reset the flip-flop to a known state.
|
|||
|
mov eax,0xD000
|
|||
|
out 0x04,al ; set the channel 2 starting address to 0
|
|||
|
shr eax,8
|
|||
|
out 0x04,al
|
|||
|
shr eax,8
|
|||
|
out 0x81,al
|
|||
|
mov al,0
|
|||
|
out 0x0c, al ; reset flip-flop
|
|||
|
mov al, 0xff ;set count (actual size -1)
|
|||
|
out 0x5, al
|
|||
|
mov al,0x1 ;[dmasize] ;(0x1ff = 511 / 0x23ff =9215)
|
|||
|
out 0x5,al
|
|||
|
mov al,2
|
|||
|
out 0xa,al
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
;***********************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FDC *
|
|||
|
;* <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|||
|
;* AL - <EFBFBD>뢮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|||
|
;***********************************
|
|||
|
FDCDataOutput:
|
|||
|
; pusha
|
|||
|
push ax cx dx
|
|||
|
mov AH,AL ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> AH
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [FDC_Status],FDC_Normal
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⮢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD>ਥ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov DX,3F4h ;(<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> FDC)
|
|||
|
xor CX,CX ;<EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 ⠩<EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
@@TestRS:
|
|||
|
in AL,DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ॣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> RS
|
|||
|
and AL,0C0h ;<EFBFBD>뤥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <EFBFBD> 7
|
|||
|
cmp AL,80h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <EFBFBD> 7
|
|||
|
je @@OutByteToFDC
|
|||
|
loop @@TestRS
|
|||
|
; <EFBFBD>訡<EFBFBD><EFBFBD> ⠩<EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [FDC_Status],FDC_TimeOut
|
|||
|
jmp @@End_5
|
|||
|
; <EFBFBD>뢥<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
@@OutByteToFDC:
|
|||
|
inc DX
|
|||
|
mov AL,AH
|
|||
|
out DX,AL
|
|||
|
@@End_5:
|
|||
|
; popa
|
|||
|
pop dx cx ax
|
|||
|
ret
|
|||
|
|
|||
|
;******************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FDC *
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD>楤<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>室<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD>. *
|
|||
|
;* <EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|||
|
;* AL - <EFBFBD><EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|||
|
;******************************************
|
|||
|
FDCDataInput:
|
|||
|
push ECX
|
|||
|
push DX
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [FDC_Status],FDC_Normal
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⮢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov DX,3F4h ;(<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> FDC)
|
|||
|
xor CX,CX ;<EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 ⠩<EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
@@TestRS_1:
|
|||
|
in AL,DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ॣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> RS
|
|||
|
and AL,0C0h ;<EFBFBD>뤫<EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <EFBFBD> 7
|
|||
|
cmp AL,0C0h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <EFBFBD> 7
|
|||
|
je @@GetByteFromFDC
|
|||
|
loop @@TestRS_1
|
|||
|
; <EFBFBD>訡<EFBFBD><EFBFBD> ⠩<EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [FDC_Status],FDC_TimeOut
|
|||
|
jmp @@End_6
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
@@GetByteFromFDC:
|
|||
|
inc DX
|
|||
|
in AL,DX
|
|||
|
@@End_6: pop DX
|
|||
|
pop ECX
|
|||
|
ret
|
|||
|
|
|||
|
;*********************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;*********************************************
|
|||
|
FDCInterrupt:
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; sti
|
|||
|
; push AX
|
|||
|
; <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䫠<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [FDD_IntFlag],1
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> EOI <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
; mov AL,20h
|
|||
|
; out 20h,AL
|
|||
|
; pop AX
|
|||
|
ret
|
|||
|
|
|||
|
|
|||
|
;******************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;******************************************
|
|||
|
SetUserInterrupts:
|
|||
|
mov [fdc_irq_func],FDCInterrupt
|
|||
|
ret
|
|||
|
|
|||
|
;*******************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;*******************************************
|
|||
|
WaitFDCInterrupt:
|
|||
|
pusha
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨
|
|||
|
mov [FDC_Status],FDC_Normal
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䫠<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [FDD_IntFlag],0
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>㫨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 ⨪<EFBFBD><EFBFBD>
|
|||
|
mov eax,[timer_ticks]
|
|||
|
mov [TickCounter],eax
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䫠<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
@@TestRS_2:
|
|||
|
cmp [FDD_IntFlag],0
|
|||
|
jnz @@End_7 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ந<EFBFBD><EFBFBD>諮
|
|||
|
mov eax,[timer_ticks]
|
|||
|
sub eax,[TickCounter]
|
|||
|
cmp eax,50 ;25 ;5 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5 ⨪<EFBFBD><EFBFBD>
|
|||
|
jb @@TestRS_2
|
|||
|
; jl @@TestRS_2
|
|||
|
; <EFBFBD>訡<EFBFBD><EFBFBD> ⠩<EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [FDC_Status],FDC_TimeOut
|
|||
|
; mov [flp_status],0
|
|||
|
@@End_7: popa
|
|||
|
ret
|
|||
|
|
|||
|
;*********************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "A:" *
|
|||
|
;*********************************
|
|||
|
FDDMotorON:
|
|||
|
pusha
|
|||
|
; cmp [fdd_motor_status],1
|
|||
|
; je fdd_motor_on
|
|||
|
mov al,[flp_number]
|
|||
|
cmp [fdd_motor_status],al
|
|||
|
je fdd_motor_on
|
|||
|
; <EFBFBD>ந<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov DX,3F2h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫ﬨ
|
|||
|
mov AL,0
|
|||
|
out DX,AL
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
cmp [flp_number],1
|
|||
|
jne FDDMotorON_B
|
|||
|
; call FDDMotorOFF_B
|
|||
|
mov AL,1Ch ; Floppy A
|
|||
|
jmp FDDMotorON_1
|
|||
|
FDDMotorON_B:
|
|||
|
; call FDDMotorOFF_A
|
|||
|
mov AL,2Dh ; Floppy B
|
|||
|
FDDMotorON_1:
|
|||
|
out DX,AL
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>㫨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 ⨪<EFBFBD><EFBFBD>
|
|||
|
mov eax,[timer_ticks]
|
|||
|
mov [TickCounter],eax
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0,5 <EFBFBD>
|
|||
|
@@dT:
|
|||
|
mov eax,[timer_ticks]
|
|||
|
sub eax,[TickCounter]
|
|||
|
cmp eax,50 ;10
|
|||
|
jb @@dT
|
|||
|
cmp [flp_number],1
|
|||
|
jne fdd_motor_on_B
|
|||
|
mov [fdd_motor_status],1
|
|||
|
jmp fdd_motor_on
|
|||
|
fdd_motor_on_B:
|
|||
|
mov [fdd_motor_status],2
|
|||
|
fdd_motor_on:
|
|||
|
call save_timer_fdd_motor
|
|||
|
popa
|
|||
|
ret
|
|||
|
|
|||
|
;*****************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;*****************************************
|
|||
|
save_timer_fdd_motor:
|
|||
|
mov eax,[timer_ticks]
|
|||
|
mov [timer_fdd_motor],eax
|
|||
|
ret
|
|||
|
|
|||
|
;*****************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;*****************************************
|
|||
|
check_fdd_motor_status:
|
|||
|
cmp [fdd_motor_status],0
|
|||
|
je end_check_fdd_motor_status
|
|||
|
mov eax,[timer_ticks]
|
|||
|
sub eax,[timer_fdd_motor]
|
|||
|
cmp eax,500
|
|||
|
jb end_check_fdd_motor_status
|
|||
|
call FDDMotorOFF
|
|||
|
mov [fdd_motor_status],0
|
|||
|
end_check_fdd_motor_status:
|
|||
|
ret
|
|||
|
|
|||
|
;**********************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;**********************************
|
|||
|
FDDMotorOFF:
|
|||
|
push AX
|
|||
|
push DX
|
|||
|
cmp [flp_number],1
|
|||
|
jne FDDMotorOFF_1
|
|||
|
call FDDMotorOFF_A
|
|||
|
jmp FDDMotorOFF_2
|
|||
|
FDDMotorOFF_1:
|
|||
|
call FDDMotorOFF_B
|
|||
|
FDDMotorOFF_2:
|
|||
|
pop DX
|
|||
|
pop AX
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䫠<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>裡 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ॢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ଠ樨
|
|||
|
mov [root_read],0
|
|||
|
mov [flp_fat],0
|
|||
|
ret
|
|||
|
|
|||
|
FDDMotorOFF_A:
|
|||
|
mov DX,3F2h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫ﬨ
|
|||
|
mov AL,0Ch ; Floppy A
|
|||
|
out DX,AL
|
|||
|
ret
|
|||
|
|
|||
|
FDDMotorOFF_B:
|
|||
|
mov DX,3F2h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫ﬨ
|
|||
|
mov AL,5h ; Floppy B
|
|||
|
out DX,AL
|
|||
|
ret
|
|||
|
|
|||
|
;*******************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "A:" *
|
|||
|
;*******************************
|
|||
|
RecalibrateFDD:
|
|||
|
pusha
|
|||
|
call save_timer_fdd_motor
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
mov AL,07h
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,00h
|
|||
|
call FDCDataOutput
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨
|
|||
|
call WaitFDCInterrupt
|
|||
|
; cmp [FDC_Status],0
|
|||
|
; je no_fdc_status_error
|
|||
|
; mov [flp_status],0
|
|||
|
;no_fdc_status_error:
|
|||
|
call save_timer_fdd_motor
|
|||
|
popa
|
|||
|
ret
|
|||
|
|
|||
|
;*****************************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;* <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>१ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|||
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-79); *
|
|||
|
;* FDD_Head - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-1). *
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> FDC_Status. *
|
|||
|
;*****************************************************
|
|||
|
SeekTrack:
|
|||
|
pusha
|
|||
|
call save_timer_fdd_motor
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
mov AL,0Fh
|
|||
|
call FDCDataOutput
|
|||
|
; <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫<EFBFBD>
|
|||
|
mov AL,[FDD_Head]
|
|||
|
shl AL,2
|
|||
|
call FDCDataOutput
|
|||
|
; <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov AL,[FDD_Track]
|
|||
|
call FDCDataOutput
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨
|
|||
|
call WaitFDCInterrupt
|
|||
|
cmp [FDC_Status],FDC_Normal
|
|||
|
jne @@Exit
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> १<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>᪠
|
|||
|
mov AL,08h
|
|||
|
call FDCDataOutput
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_ST0],AL
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_C],AL
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> १<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>᪠
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭?
|
|||
|
test [FDC_ST0],100000b
|
|||
|
je @@Err
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>४ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
mov AL,[FDC_C]
|
|||
|
cmp AL,[FDD_Track]
|
|||
|
jne @@Err
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
|||
|
mov AL,[FDC_ST0]
|
|||
|
and AL,100b
|
|||
|
shr AL,2
|
|||
|
cmp AL,[FDD_Head]
|
|||
|
jne @@Err
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD> <EFBFBD>ᯥ譮
|
|||
|
mov [FDC_Status],FDC_Normal
|
|||
|
jmp @@Exit
|
|||
|
@@Err: ; <EFBFBD>४ <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [FDC_Status],FDC_TrackNotFound
|
|||
|
; mov [flp_status],0
|
|||
|
@@Exit:
|
|||
|
call save_timer_fdd_motor
|
|||
|
popa
|
|||
|
ret
|
|||
|
|
|||
|
;*******************************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;* <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>१ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|||
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-79); *
|
|||
|
;* FDD_Head - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-1); *
|
|||
|
;* FDD_Sector - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> (1-18). *
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> FDC_Status. *
|
|||
|
;* <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>砥 <EFBFBD>ᯥ譮<EFBFBD><EFBFBD> <EFBFBD>믮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD>⥭<EFBFBD><EFBFBD> *
|
|||
|
;* ᮤ<EFBFBD>ন<EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㤥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᥭ<EFBFBD> <EFBFBD> FDD_DataBuffer. *
|
|||
|
;*******************************************************
|
|||
|
ReadSector:
|
|||
|
pushad
|
|||
|
call save_timer_fdd_motor
|
|||
|
; <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD> 500 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>
|
|||
|
mov AX,0
|
|||
|
mov DX,03F7h
|
|||
|
out DX,AL
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>אַ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㯠 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [dmamode],0x46
|
|||
|
call Init_FDC_DMA
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD>⥭<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
mov AL,0E6h ;<EFBFBD>⥭<EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>४<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,[FDD_Head]
|
|||
|
shl AL,2
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,[FDD_Track]
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,[FDD_Head]
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,[FDD_Sector]
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,2 ;<EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> (512 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,18 ;+1; 3Fh ;<EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,1Bh ;<EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> GPL
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,0FFh ;<EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> DTL
|
|||
|
call FDCDataOutput
|
|||
|
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨
|
|||
|
call WaitFDCInterrupt
|
|||
|
cmp [FDC_Status],FDC_Normal
|
|||
|
jne @@Exit_1
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨
|
|||
|
call GetStatusInfo
|
|||
|
test [FDC_ST0],11011000b
|
|||
|
jnz @@Err_1
|
|||
|
mov [FDC_Status],FDC_Normal
|
|||
|
jmp @@Exit_1
|
|||
|
@@Err_1: mov [FDC_Status],FDC_SectorNotFound
|
|||
|
; mov [flp_status],0
|
|||
|
@@Exit_1:
|
|||
|
call save_timer_fdd_motor
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
;*******************************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>) *
|
|||
|
;* <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>१ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|||
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-79); *
|
|||
|
;* FDD_Head - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-1); *
|
|||
|
;* FDD_Sector - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> (1-18). *
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> FDC_Status. *
|
|||
|
;* <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>砥 <EFBFBD>ᯥ譮<EFBFBD><EFBFBD> <EFBFBD>믮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD>⥭<EFBFBD><EFBFBD> *
|
|||
|
;* ᮤ<EFBFBD>ন<EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㤥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᥭ<EFBFBD> <EFBFBD> FDD_DataBuffer. *
|
|||
|
;*******************************************************
|
|||
|
ReadSectWithRetr:
|
|||
|
pusha
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>㫨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 ४<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [RecalRepCounter],0
|
|||
|
@@TryAgain:
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>㫨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD>⥭<EFBFBD><EFBFBD>
|
|||
|
mov [ReadRepCounter],0
|
|||
|
@@ReadSector_1:
|
|||
|
call ReadSector
|
|||
|
cmp [FDC_Status],0
|
|||
|
je @@Exit_2
|
|||
|
cmp [FDC_Status],1
|
|||
|
je @@Err_3
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⭮<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> <EFBFBD>⥭<EFBFBD><EFBFBD>
|
|||
|
inc [ReadRepCounter]
|
|||
|
cmp [ReadRepCounter],3
|
|||
|
jb @@ReadSector_1
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⭮<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> ४<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call RecalibrateFDD
|
|||
|
call SeekTrack
|
|||
|
inc [RecalRepCounter]
|
|||
|
cmp [RecalRepCounter],3
|
|||
|
jb @@TryAgain
|
|||
|
; mov [flp_status],0
|
|||
|
@@Exit_2:
|
|||
|
popa
|
|||
|
ret
|
|||
|
@@Err_3:
|
|||
|
mov [flp_status],0
|
|||
|
popa
|
|||
|
ret
|
|||
|
|
|||
|
;*******************************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;* <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>१ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|||
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-79); *
|
|||
|
;* FDD_Head - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-1); *
|
|||
|
;* FDD_Sector - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> (1-18). *
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> FDC_Status. *
|
|||
|
;* <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>砥 <EFBFBD>ᯥ譮<EFBFBD><EFBFBD> <EFBFBD>믮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;* ᮤ<EFBFBD>ন<EFBFBD><EFBFBD><EFBFBD> FDD_DataBuffer <EFBFBD>㤥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᥭ<EFBFBD> <EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD>. *
|
|||
|
;*******************************************************
|
|||
|
WriteSector:
|
|||
|
pushad
|
|||
|
call save_timer_fdd_motor
|
|||
|
; <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD> 500 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>
|
|||
|
mov AX,0
|
|||
|
mov DX,03F7h
|
|||
|
out DX,AL
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>אַ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㯠 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [dmamode],0x4A
|
|||
|
call Init_FDC_DMA
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|||
|
mov AL,0xC5 ;0x45 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>४<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,[FDD_Head]
|
|||
|
shl AL,2
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,[FDD_Track]
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,[FDD_Head]
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,[FDD_Sector]
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,2 ;<EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> (512 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,18; 3Fh ;<EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,1Bh ;<EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> GPL
|
|||
|
call FDCDataOutput
|
|||
|
mov AL,0FFh ;<EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> DTL
|
|||
|
call FDCDataOutput
|
|||
|
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨
|
|||
|
call WaitFDCInterrupt
|
|||
|
cmp [FDC_Status],FDC_Normal
|
|||
|
jne @@Exit_3
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨
|
|||
|
call GetStatusInfo
|
|||
|
test [FDC_ST0],11000000b ;11011000b
|
|||
|
jnz @@Err_2
|
|||
|
mov [FDC_Status],FDC_Normal
|
|||
|
jmp @@Exit_3
|
|||
|
@@Err_2: mov [FDC_Status],FDC_SectorNotFound
|
|||
|
@@Exit_3:
|
|||
|
call save_timer_fdd_motor
|
|||
|
popad
|
|||
|
ret
|
|||
|
|
|||
|
;*******************************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>) *
|
|||
|
;* <EFBFBD><EFBFBD>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>१ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|||
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-79); *
|
|||
|
;* FDD_Head - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-1); *
|
|||
|
;* FDD_Sector - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> (1-18). *
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> FDC_Status. *
|
|||
|
;* <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>砥 <EFBFBD>ᯥ譮<EFBFBD><EFBFBD> <EFBFBD>믮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;* ᮤ<EFBFBD>ন<EFBFBD><EFBFBD><EFBFBD> FDD_DataBuffer <EFBFBD>㤥<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᥭ<EFBFBD> <EFBFBD> ᥪ<EFBFBD><EFBFBD><EFBFBD>. *
|
|||
|
;*******************************************************
|
|||
|
WriteSectWithRetr:
|
|||
|
pusha
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>㫨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 ४<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
mov [RecalRepCounter],0
|
|||
|
@@TryAgain_1:
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD>㫨<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>樨 <EFBFBD>⥭<EFBFBD><EFBFBD>
|
|||
|
mov [ReadRepCounter],0
|
|||
|
@@WriteSector_1:
|
|||
|
call WriteSector
|
|||
|
cmp [FDC_Status],0
|
|||
|
je @@Exit_4
|
|||
|
cmp [FDC_Status],1
|
|||
|
je @@Err_4
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⭮<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> <EFBFBD>⥭<EFBFBD><EFBFBD>
|
|||
|
inc [ReadRepCounter]
|
|||
|
cmp [ReadRepCounter],3
|
|||
|
jb @@WriteSector_1
|
|||
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⭮<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD> ४<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
call RecalibrateFDD
|
|||
|
call SeekTrack
|
|||
|
inc [RecalRepCounter]
|
|||
|
cmp [RecalRepCounter],3
|
|||
|
jb @@TryAgain_1
|
|||
|
@@Exit_4:
|
|||
|
popa
|
|||
|
ret
|
|||
|
@@Err_4:
|
|||
|
mov [flp_status],0
|
|||
|
popa
|
|||
|
ret
|
|||
|
|
|||
|
;*********************************************
|
|||
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|||
|
;*********************************************
|
|||
|
GetStatusInfo:
|
|||
|
push AX
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_ST0],AL
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_ST1],AL
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_ST2],AL
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_C],AL
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_H],AL
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_R],AL
|
|||
|
call FDCDataInput
|
|||
|
mov [FDC_N],AL
|
|||
|
pop AX
|
|||
|
ret
|
|||
|
|