source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHCh_HSeek.asm @ 294

Last change on this file since 294 was 294, checked in by krille_n_@…, 12 years ago

Commit 2/2 (BIOS):

  • Fixed a bug in AH1h_HStatus.asm.
  • Minor optimizations.
  • Fixed spelling and did some cleaning.
File size: 1.7 KB
RevLine 
[116]1; Project name  :   XTIDE Universal BIOS
[3]2; Description   :   Int 13h function AH=Ch, Seek.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; Int 13h function AH=Ch, Seek.
9;
10; AHCh_HandlerForSeek
11;   Parameters:
[148]12;       CX, DH: Same as in INTPACK
13;       DL:     Translated Drive number
14;       DS:DI:  Ptr to DPT (in RAMVARS segment)
[150]15;       SS:BP:  Ptr to IDEREGS_AND_INTPACK
16;   Parameters on INTPACK:
[3]17;       CH:     Cylinder number, bits 7...0
18;       CL:     Bits 7...6: Cylinder number bits 9 and 8
19;               Bits 5...0: Starting sector number (1...63)
20;       DH:     Starting head number (0...255)
[150]21;   Returns with INTPACK:
[3]22;       AH:     BIOS Error code
[294]23;       CF:     0 if successful, 1 if error
[3]24;--------------------------------------------------------------------
25ALIGN JUMP_ALIGN
26AHCh_HandlerForSeek:
[84]27%ifndef USE_186
[3]28    call    AHCh_SeekToCylinder
[148]29    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
[84]30%else
[148]31    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
[162]32    ; Fall to AHCh_SeekToCylinder
[84]33%endif
[3]34
35;--------------------------------------------------------------------
36; AHCh_SeekToCylinder
37;   Parameters:
38;       CH:     Cylinder number, bits 7...0
39;       CL:     Bits 7...6: Cylinder number bits 9 and 8
40;               Bits 5...0: Starting sector number (1...63)
41;       DH:     Starting head number (0...255)
[148]42;       DS:DI:  Ptr to DPT (in RAMVARS segment)
[150]43;       SS:BP:  Ptr to IDEREGS_AND_INTPACK
[3]44;   Returns:
45;       AH:     BIOS Error code
[294]46;       CF:     0 if successful, 1 if error
[3]47;   Corrupts registers:
48;       AL, BX, CX, DX
49;--------------------------------------------------------------------
50AHCh_SeekToCylinder:
[150]51    mov     ah, COMMAND_SEEK
52    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
53    jmp     Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH
Note: See TracBrowser for help on using the repository browser.