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

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

Changes to XTIDE Universal BIOS:

  • Hopefully this commit is successful. Sorry for the mess.
File size: 1.6 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; CommandLookup_OrOldInt13hIndexToBL
10; Parameters:
11; DS:DI: Ptr to DPT
12; ES:SI: Ptr to DAP (Disk Address Packet)
13; Returns:
14; BX: Index to command lookup table
15; Corrupts registers:
16; AX
17;--------------------------------------------------------------------
18ALIGN JUMP_ALIGN
19CommandLookup_GetEbiosIndexToBX:
20 ; LBA28 or LBA48 command
21 xor bx, bx
22 mov ax, [es:si+DAP.qwLBA+3] ; Load LBA48 bytes 3 and 4
23 and al, ~0Fh ; Clear LBA28 bits 24...27
24 or al, [es:si+DAP.qwLBA+5]
25 cmp bx, ax ; Set CF if any of bits 28...47 set
26 rcl bx, 1 ; BX = 0 for LBA28, BX = 1 for LBA48
27
28 ; Block mode or single sector
29ALIGN JUMP_ALIGN
30CommandLookup_OrOldInt13hIndexToBL:
31 mov al, FLGH_DPT_BLOCK_MODE_SUPPORTED ; Bit 1
32 and al, [di+DPT.bFlagsHigh]
33 or bl, al ; BX = index to lookup table
34 ret
35
36
37g_rgbReadCommandLookup:
38 db COMMAND_READ_SECTORS ; 00b, CHS or LBA28 single sector
39 db COMMAND_READ_SECTORS_EXT ; 01b, LBA48 single sector
40 db COMMAND_READ_MULTIPLE ; 10b, CHS or LBA28 block mode
41 db COMMAND_READ_MULTIPLE_EXT ; 11b, LBA48 block mode
42
43g_rgbWriteCommandLookup:
44 db COMMAND_WRITE_SECTORS
45 db COMMAND_WRITE_SECTORS_EXT
46 db COMMAND_WRITE_MULTIPLE
47 db COMMAND_WRITE_MULTIPLE_EXT
48
49g_rgbVerifyCommandLookup:
50 db COMMAND_VERIFY_SECTORS
51 db COMMAND_VERIFY_SECTORS_EXT
52 db COMMAND_VERIFY_SECTORS
53 db COMMAND_VERIFY_SECTORS_EXT
54
Note: See TracBrowser for help on using the repository browser.