source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm@ 367

Last change on this file since 367 was 365, checked in by aitotat@…, 13 years ago

Changes to XTIDE Universal BIOS:

  • Errors from AH=9h are stored to DPTs again.
  • XT build fits in 8k again.
File size: 1.8 KB
Line 
1; Project name : XTIDE Universal BIOS
2; Description : Int 13h function AH=24h, Set Multiple Blocks.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; Int 13h function AH=24h, Set Multiple Blocks.
9;
10; AH24h_HandlerForSetMultipleBlocks
11; Parameters:
12; AL: Same as in INTPACK
13; DL: Translated Drive number
14; DS:DI: Ptr to DPT (in RAMVARS segment)
15; SS:BP: Ptr to IDEPACK
16; Parameters on INTPACK:
17; AL: Number of Sectors per Block (1, 2, 4, 8, 16, 32, 64 or 128)
18; Returns with INTPACK:
19; AH: Int 13h return status
20; CF: 0 if successful, 1 if error
21;--------------------------------------------------------------------
22AH24h_HandlerForSetMultipleBlocks:
23%ifndef USE_186
24 call AH24h_SetBlockSize
25 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
26%else
27 push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
28 ; Fall to AH24h_SetBlockSize
29%endif
30
31
32;--------------------------------------------------------------------
33; AH24h_SetBlockSize
34; Parameters:
35; AL: Number of Sectors per Block (1, 2, 4, 8, 16, 32, 64 or 128)
36; DS:DI: Ptr to DPT (in RAMVARS segment)
37; SS:BP: Ptr to IDEPACK
38; Returns:
39; AH: Int 13h return status
40; CF: 0 if successful, 1 if error
41; Corrupts registers:
42; AL, CX, DX
43;--------------------------------------------------------------------
44AH24h_SetBlockSize:
45 push bx
46
47 push ax
48 xchg dx, ax ; DL = Block size (Sector Count Register)
49 mov al, COMMAND_SET_MULTIPLE_MODE
50 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY)
51 call Idepack_StoreNonExtParametersAndIssueCommandFromAL
52 pop bx
53 jnc SHORT .StoreBlockSize
54 mov bl, 1 ; Block size 1 will always work
55.StoreBlockSize: ; Store new block size to DPT and return
56 mov [di+DPT_ATA.bBlockSize], bl
57
58 pop bx
59 ret
Note: See TracBrowser for help on using the repository browser.