Changeset 160 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
- Timestamp:
- May 4, 2011, 5:49:22 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r158 r160 10 10 ; DS:DI: Ptr to Disk Parameter Table 11 11 ; ES:SI: Ptr to 512-byte ATA information read from the drive 12 ; CS:BP: Ptr to IDEVARS for the controller 12 13 ; Returns: 13 14 ; Nothing … … 103 104 xor ax, ax 104 105 ret 105 106 107 ;--------------------------------------------------------------------108 ; Device_OutputALtoIdeRegisterInDL109 ; Parameters:110 ; AL: Byte to output111 ; DL: IDE Register112 ; DS:DI: Ptr to DPT (in RAMVARS segment)113 ; Returns:114 ; Nothing115 ; Corrupts registers:116 ; BX, DX117 ;--------------------------------------------------------------------118 ALIGN JUMP_ALIGN119 Device_OutputALtoIdeRegisterInDL:120 mov bx, IdeIO_OutputALtoIdeRegisterInDX121 jmp SHORT TranslateRegisterAddressInDLifNecessaryThenJumpToBX122 123 124 ;--------------------------------------------------------------------125 ; Device_OutputALtoIdeControlBlockRegisterInDL126 ; Parameters:127 ; AL: Byte to output128 ; DL: IDE Control Block Register129 ; DS:DI: Ptr to DPT (in RAMVARS segment)130 ; Returns:131 ; Nothing132 ; Corrupts registers:133 ; BX, DX134 ;--------------------------------------------------------------------135 ALIGN JUMP_ALIGN136 Device_OutputALtoIdeControlBlockRegisterInDL:137 mov bx, IdeIO_OutputALtoIdeControlBlockRegisterInDX138 jmp SHORT TranslateRegisterAddressInDLifNecessaryThenJumpToBX139 140 141 ;--------------------------------------------------------------------142 ; Device_InputToALfromIdeRegisterInDL143 ; Parameters:144 ; DL: IDE Register145 ; DS:DI: Ptr to DPT (in RAMVARS segment)146 ; Returns:147 ; AL: Inputted byte148 ; Corrupts registers:149 ; BX, DX150 ;--------------------------------------------------------------------151 ALIGN JUMP_ALIGN152 Device_InputToALfromIdeRegisterInDL:153 mov bx, IdeIO_InputToALfromIdeRegisterInDX154 ; Fall to TranslateRegisterAddressInDLifNecessaryThenJumpToBX155 156 157 ;--------------------------------------------------------------------158 ; TranslateRegisterAddressInDLifNecessaryThenJumpToBX159 ; Parameters:160 ; AL: Byte to output (if output function in BX)161 ; DL: IDE Register162 ; BX: I/O function to jump to163 ; DS:DI: Ptr to DPT (in RAMVARS segment)164 ; Returns:165 ; AL: Inputted byte (if input function in BX)166 ; Corrupts registers:167 ; BX, DX168 ;--------------------------------------------------------------------169 TranslateRegisterAddressInDLifNecessaryThenJumpToBX:170 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_REVERSED_A0_AND_A3171 jz SHORT .JumpToIoFunctionInSI172 173 ; Exchange address lines A0 and A3 from DL174 mov dh, MASK_A3_AND_A0_ADDRESS_LINES175 and dh, dl ; DH = 0, 1, 8 or 9, we can ignore 0 and 9176 jz SHORT .JumpToIoFunctionInSI ; Jump out since DH is 0177 xor dh, MASK_A3_AND_A0_ADDRESS_LINES178 jz SHORT .JumpToIoFunctionInSI ; Jump out since DH was 9179 and dl, ~MASK_A3_AND_A0_ADDRESS_LINES180 or dl, dh ; Address lines now reversed181 182 ALIGN JUMP_ALIGN183 .JumpToIoFunctionInSI:184 push bx185 xor dh, dh186 eMOVZX bx, BYTE [di+DPT.bIdevarsOffset]; CS:BX now points to IDEVARS187 ret
Note:
See TracChangeset
for help on using the changeset viewer.