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

Last change on this file since 148 was 148, checked in by aitotat, 13 years ago

Changes to XTIDE Universal BIOS:

  • INT 13h optimizations to save almost 100 bytes.
File size: 1.8 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)
15;       SS:BP:  Ptr to INTPACK
16;   Parameters on INTPACK in SS:BP:
[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)
[148]21;   Returns with INTPACK in SS:BP:
[3]22;       AH:     BIOS Error code
23;       CF:     0 if succesfull, 1 if error
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
[84]32    ; Fall through to AHCh_SeekToCylinder
33%endif
[3]34
35
36;--------------------------------------------------------------------
37; AHCh_SeekToCylinder
38;   Parameters:
39;       CH:     Cylinder number, bits 7...0
40;       CL:     Bits 7...6: Cylinder number bits 9 and 8
41;               Bits 5...0: Starting sector number (1...63)
42;       DH:     Starting head number (0...255)
[148]43;       DS:DI:  Ptr to DPT (in RAMVARS segment)
[3]44;   Returns:
45;       AH:     BIOS Error code
46;       CF:     0 if succesfull, 1 if error
47;   Corrupts registers:
48;       AL, BX, CX, DX
49;--------------------------------------------------------------------
50AHCh_SeekToCylinder:
51    mov     ax, HCMD_SEEK<<8            ; Load cmd to AH, AL=zero sector cnt
52    call    HCommand_OutputCountAndLCHSandCommand
[148]53    jc      SHORT .ReturnWithErrorCodeInAH
[3]54    mov     bx, di                      ; DS:BX now points to DPT
55    jmp     HStatus_WaitIrqOrRdy        ; Wait for IRQ or RDY
[148]56.ReturnWithErrorCodeInAH:
[3]57    ret
Note: See TracBrowser for help on using the repository browser.