source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/CommandLookup.asm@ 192

Last change on this file since 192 was 181, checked in by krille_n_@…, 13 years ago

Changes to all parts of the project:

  • Size optimizations.
  • Added a define (EXCLUDE_FROM_XTIDECFG) to exclude unused library code from XTIDECFG.
  • Tried to minimize time spent with interrupts disabled.
  • Some minor attempts to improve speed (reordering instructions etc).
  • Tried to improve readability, did some cleanup and fixed some errors in comments.
File size: 2.0 KB
Line 
1; Project name : XTIDE Universal BIOS
2; Description : Functions for loading correct transfer command.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; CommandLookup_GetEbiosIndexToBX
9; Parameters:
10; DS:DI: Ptr to DPT
11; ES:SI: Ptr to DAP (Disk Address Packet)
12; Returns:
13; BX: Index to command lookup table
14; Corrupts registers:
15; AX, DX
16;--------------------------------------------------------------------
17%ifdef MODULE_EBIOS
18ALIGN JUMP_ALIGN
19CommandLookup_GetEbiosIndexToBX:
20 ; LBA28 or LBA48 command
21 xor dx, dx
22 mov al, [es:si+DAP.qwLBA+3] ; Load LBA48 byte 3 (bits 24...31)
23 and ax, 00F0h ; Clear LBA28 bits 24...27
24 or ax, [es:si+DAP.qwLBA+4] ; Set bits from LBA bytes 4 and 5
25 cmp dx, ax ; Set CF if any of bits 28...47 set
26 rcl dx, 1 ; DX = 0 for LBA28, DX = 1 for LBA48
27 call CommandLookup_GetOldInt13hIndexToBX
28 or bx, dx ; Set block mode / single sector bit
29 ret
30%endif
31
32;--------------------------------------------------------------------
33; CommandLookup_GetOldInt13hIndexToBX
34; Parameters:
35; DS:DI: Ptr to DPT
36; Returns:
37; BX: Index to command lookup table
38; Corrupts registers:
39; Nothing
40;--------------------------------------------------------------------
41ALIGN JUMP_ALIGN
42CommandLookup_GetOldInt13hIndexToBX:
43 ; Block mode or single sector
44 mov bl, [di+DPT.bFlagsHigh]
45 and bx, BYTE FLGH_DPT_BLOCK_MODE_SUPPORTED ; Bit 1
46 ret
47
48
49g_rgbReadCommandLookup:
50 db COMMAND_READ_SECTORS ; 00b, CHS or LBA28 single sector
51 db COMMAND_READ_SECTORS_EXT ; 01b, LBA48 single sector
52 db COMMAND_READ_MULTIPLE ; 10b, CHS or LBA28 block mode
53 db COMMAND_READ_MULTIPLE_EXT ; 11b, LBA48 block mode
54
55g_rgbWriteCommandLookup:
56 db COMMAND_WRITE_SECTORS
57 db COMMAND_WRITE_SECTORS_EXT
58 db COMMAND_WRITE_MULTIPLE
59 db COMMAND_WRITE_MULTIPLE_EXT
60
61g_rgbVerifyCommandLookup:
62 db COMMAND_VERIFY_SECTORS
63 db COMMAND_VERIFY_SECTORS_EXT
64 db COMMAND_VERIFY_SECTORS
65 db COMMAND_VERIFY_SECTORS_EXT
66
Note: See TracBrowser for help on using the repository browser.