2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2012-03-15 16:41:29 +04:00
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;**********************************************************
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;**********************************************************
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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
|
|
|
|
|
|
|
|
|
|
;give_back_application_data: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; mov edi,[TASK_BASE]
|
|
|
|
|
; mov edi,[edi+TASKDATA.mem_start]
|
|
|
|
|
; add edi,ecx
|
|
|
|
|
give_back_application_data_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov esi, FDD_BUFF;FDD_DataBuffer ;0x40000
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
mov cx, 128
|
2010-10-01 13:21:55 +04:00
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;take_data_from_application: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; mov esi,[TASK_BASE]
|
|
|
|
|
; mov esi,[esi+TASKDATA.mem_start]
|
|
|
|
|
; add esi,ecx
|
|
|
|
|
take_data_from_application_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov edi, FDD_BUFF;FDD_DataBuffer ;0x40000
|
|
|
|
|
xor ecx, ecx
|
|
|
|
|
mov cx, 128
|
2010-10-01 13:21:55 +04:00
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
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> (FDC_Status)
|
|
|
|
|
FDC_Normal equ 0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
FDC_TimeOut equ 1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
FDC_DiskNotFound equ 2 ;<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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><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><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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
|
|
|
|
|
|
|
|
|
|
uglobal
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><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><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><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
FDD_Time DD ?
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><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><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><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><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><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
RecalRepCounter DB ?
|
|
|
|
|
endg
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><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
|
2012-03-08 12:33:38 +04:00
|
|
|
|
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)
|
2010-10-01 13:21:55 +04:00
|
|
|
|
out 0x5, al
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, 0x1;[dmasize] ;(0x1ff = 511 / 0x23ff =9215)
|
|
|
|
|
out 0x5, al
|
|
|
|
|
mov al, 2
|
|
|
|
|
out 0xa, al
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* AL - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;***********************************
|
|
|
|
|
FDCDataOutput:
|
|
|
|
|
; pusha
|
|
|
|
|
push eax ecx edx
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AH, AL ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> AH
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov DX, 3F4h ;(<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FDC)
|
2010-10-01 13:21:55 +04:00
|
|
|
|
mov ecx, 0x10000 ;<EFBFBD><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:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
in AL, DX ;<EFBFBD><EFBFBD><EFBFBD><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <EFBFBD> 7
|
|
|
|
|
cmp AL, 80h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <EFBFBD> 7
|
2010-10-01 13:21:55 +04:00
|
|
|
|
je @@OutByteToFDC
|
|
|
|
|
loop @@TestRS
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_TimeOut
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp @@End_5
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@OutByteToFDC:
|
|
|
|
|
inc DX
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, AH
|
|
|
|
|
out DX, AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@End_5:
|
|
|
|
|
; popa
|
|
|
|
|
pop edx ecx 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> 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><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><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov DX, 3F4h ;(<EFBFBD><EFBFBD><EFBFBD><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><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@TestRS_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
in AL, DX ;<EFBFBD><EFBFBD><EFBFBD><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <EFBFBD> 7
|
|
|
|
|
cmp AL, 0C0h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 6 <EFBFBD> 7
|
2010-10-01 13:21:55 +04:00
|
|
|
|
je @@GetByteFromFDC
|
|
|
|
|
loop @@TestRS_1
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_TimeOut
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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
|
2012-03-08 12:33:38 +04:00
|
|
|
|
in AL, DX
|
|
|
|
|
@@End_6:
|
|
|
|
|
pop DX
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDD_IntFlag], 1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [fdc_irq_func], FDCInterrupt
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDD_IntFlag], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
mov [TickCounter], eax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><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:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDD_IntFlag], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz @@End_7 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call change_task
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
sub eax, [TickCounter]
|
|
|
|
|
cmp eax, 50 ;25 ;5 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jb @@TestRS_2
|
|
|
|
|
; jl @@TestRS_2
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_TimeOut
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; mov [flp_status],0
|
2012-03-08 12:33:38 +04:00
|
|
|
|
@@End_7:
|
|
|
|
|
popa
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, [flp_number]
|
|
|
|
|
cmp [fdd_motor_status], al
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov DX, 3F2h;<EFBFBD><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, 0
|
|
|
|
|
out DX, AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [flp_number], 1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jne FDDMotorON_B
|
|
|
|
|
; call FDDMotorOFF_B
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 1Ch ; Floppy A
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp FDDMotorON_1
|
|
|
|
|
FDDMotorON_B:
|
|
|
|
|
; call FDDMotorOFF_A
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 2Dh ; Floppy B
|
2010-10-01 13:21:55 +04:00
|
|
|
|
FDDMotorON_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
out DX, AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
mov [TickCounter], eax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0,5 <EFBFBD>
|
|
|
|
|
@@dT:
|
|
|
|
|
call change_task
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
sub eax, [TickCounter]
|
|
|
|
|
cmp eax, 50 ;10
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jb @@dT
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [flp_number], 1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jne fdd_motor_on_B
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [fdd_motor_status], 1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp fdd_motor_on
|
|
|
|
|
fdd_motor_on_B:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [fdd_motor_status], 2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
mov [timer_fdd_motor], eax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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> *
|
|
|
|
|
;*****************************************
|
|
|
|
|
align 4
|
|
|
|
|
check_fdd_motor_status:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [fdd_motor_status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
je end_check_fdd_motor_status_1
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
sub eax, [timer_fdd_motor]
|
|
|
|
|
cmp eax, 500
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jb end_check_fdd_motor_status
|
|
|
|
|
call FDDMotorOFF
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [fdd_motor_status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
end_check_fdd_motor_status_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [flp_status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [flp_number], 1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [root_read], 0
|
|
|
|
|
mov [flp_fat], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
FDDMotorOFF_A:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov DX, 3F2h;<EFBFBD><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, 0Ch ; Floppy A
|
|
|
|
|
out DX, AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
FDDMotorOFF_B:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov DX, 3F2h;<EFBFBD><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, 5h ; Floppy B
|
|
|
|
|
out DX, AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD><EFBFBD>"
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 07h
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 00h
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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>
|
|
|
|
|
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><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><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><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>"
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 0Fh
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Head]
|
|
|
|
|
shl AL, 2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Track]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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>
|
|
|
|
|
call WaitFDCInterrupt
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jne @@Exit
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 08h
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
|
|
|
|
call FDCDataInput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_ST0], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataInput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_C], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test [FDC_ST0], 100000b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
je @@Err
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDC_C]
|
|
|
|
|
cmp AL, [FDD_Track]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD><EFBFBD>?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDC_ST0]
|
|
|
|
|
and AL, 100b
|
|
|
|
|
shr AL, 2
|
|
|
|
|
cmp AL, [FDD_Head]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp @@Exit
|
|
|
|
|
@@Err: ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_TrackNotFound
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; 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><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><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><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><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><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 500 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AX, 0
|
|
|
|
|
mov DX, 03F7h
|
|
|
|
|
out DX, AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [dmamode], 0x46
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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>"
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 0E6h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Head]
|
|
|
|
|
shl AL, 2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Track]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Head]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Sector]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 2 ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (512 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 18 ;+1; 3Fh ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 1Bh ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> GPL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 0FFh;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DTL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call WaitFDCInterrupt
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call GetStatusInfo
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test [FDC_ST0], 11011000b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz @@Err_1
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp @@Exit_1
|
2012-03-08 12:33:38 +04:00
|
|
|
|
@@Err_1:
|
|
|
|
|
mov [FDC_Status], FDC_SectorNotFound
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; 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><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><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><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><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><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [RecalRepCounter], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@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><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [ReadRepCounter], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@ReadSector_1:
|
|
|
|
|
call ReadSector
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
je @@Exit_2
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], 1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
je @@Err_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><EFBFBD><EFBFBD>
|
|
|
|
|
inc [ReadRepCounter]
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [ReadRepCounter], 3
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jb @@ReadSector_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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call RecalibrateFDD
|
|
|
|
|
call SeekTrack
|
|
|
|
|
inc [RecalRepCounter]
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [RecalRepCounter], 3
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jb @@TryAgain
|
|
|
|
|
; mov [flp_status],0
|
|
|
|
|
@@Exit_2:
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
@@Err_3:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [flp_status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><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><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><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><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><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><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 500 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AX, 0
|
|
|
|
|
mov DX, 03F7h
|
|
|
|
|
out DX, AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [dmamode], 0x4A
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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>"
|
2012-03-08 12:33:38 +04:00
|
|
|
|
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> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Head]
|
|
|
|
|
shl AL, 2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Track]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Head]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, [FDD_Sector]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 2 ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (512 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 18; 3Fh ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 1Bh ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> GPL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataOutput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov AL, 0FFh;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DTL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call WaitFDCInterrupt
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call GetStatusInfo
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test [FDC_ST0], 11000000b ;11011000b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz @@Err_2
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_Status], FDC_Normal
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp @@Exit_3
|
2012-03-08 12:33:38 +04:00
|
|
|
|
@@Err_2:
|
|
|
|
|
mov [FDC_Status], FDC_SectorNotFound
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@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><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* FDD_Track - <EFBFBD><EFBFBD><EFBFBD><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><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><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><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><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [RecalRepCounter], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@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><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [ReadRepCounter], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@WriteSector_1:
|
|
|
|
|
call WriteSector
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
je @@Exit_4
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [FDC_Status], 1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
je @@Err_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>
|
|
|
|
|
inc [ReadRepCounter]
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [ReadRepCounter], 3
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jb @@WriteSector_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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call RecalibrateFDD
|
|
|
|
|
call SeekTrack
|
|
|
|
|
inc [RecalRepCounter]
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [RecalRepCounter], 3
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jb @@TryAgain_1
|
|
|
|
|
@@Exit_4:
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
@@Err_4:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [flp_status], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
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
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_ST0], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataInput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_ST1], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataInput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_ST2], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataInput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_C], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataInput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_H], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataInput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_R], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call FDCDataInput
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [FDC_N], AL
|
2010-10-01 13:21:55 +04:00
|
|
|
|
pop AX
|
|
|
|
|
ret
|
|
|
|
|
|