[148] | 1 | ; Project name : XTIDE Universal BIOS |
---|
[3] | 2 | ; Description : Int 13h function AH=23h, |
---|
| 3 | ; Set Controller Features Register. |
---|
| 4 | |
---|
| 5 | ; Section containing code |
---|
| 6 | SECTION .text |
---|
| 7 | |
---|
| 8 | ;-------------------------------------------------------------------- |
---|
| 9 | ; Int 13h function AH=23h, Set Controller Features Register. |
---|
| 10 | ; |
---|
| 11 | ; AH23h_HandlerForSetControllerFeatures |
---|
| 12 | ; Parameters: |
---|
[148] | 13 | ; AL, CX: Same as in INTPACK |
---|
| 14 | ; DL: Translated Drive number |
---|
| 15 | ; DS:DI: Ptr to DPT (in RAMVARS segment) |
---|
[150] | 16 | ; SS:BP: Ptr to IDEPACK |
---|
| 17 | ; Parameters on INTPACK: |
---|
[3] | 18 | ; AL: Feature Number (parameter to Features Register = subcommand) |
---|
[150] | 19 | ; (Parameter registers are undocumented, these are specific for this BIOS): |
---|
| 20 | ; BL: Parameter to Sector Count Register (subcommand specific) |
---|
| 21 | ; BH: Parameter to LBA Low / Sector Number Register (subcommand specific) |
---|
| 22 | ; CL: Parameter to LBA Middle / Cylinder Low Register (subcommand specific) |
---|
| 23 | ; CH: Parameter to LBA High / Cylinder High Register (subcommand specific) |
---|
| 24 | ; Returns with INTPACK: |
---|
[148] | 25 | ; AH: Int 13h return status |
---|
[294] | 26 | ; CF: 0 if successful, 1 if error |
---|
[148] | 27 | ;-------------------------------------------------------------------- |
---|
| 28 | AH23h_HandlerForSetControllerFeatures: |
---|
[150] | 29 | xchg si, ax ; SI = Feature Number |
---|
| 30 | mov dx, [bp+IDEPACK.intpack+INTPACK.bx] |
---|
[148] | 31 | %ifndef USE_186 |
---|
| 32 | call AH23h_SetControllerFeatures |
---|
| 33 | jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH |
---|
| 34 | %else |
---|
| 35 | push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH |
---|
[162] | 36 | ; Fall to AH23h_SetControllerFeatures |
---|
[148] | 37 | %endif |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | ;-------------------------------------------------------------------- |
---|
| 41 | ; AH23h_SetControllerFeatures |
---|
| 42 | ; Parameters: |
---|
[150] | 43 | ; DL: Parameter to Sector Count Register (subcommand specific) |
---|
| 44 | ; DH: Parameter to LBA Low / Sector Number Register (subcommand specific) |
---|
| 45 | ; CL: Parameter to LBA Middle / Cylinder Low Register (subcommand specific) |
---|
| 46 | ; CH: Parameter to LBA High / Cylinder High Register (subcommand specific) |
---|
| 47 | ; SI: Feature Number (parameter to Features Register = subcommand) |
---|
[148] | 48 | ; DS:DI: Ptr to DPT (in RAMVARS segment) |
---|
[150] | 49 | ; SS:BP: Ptr to IDEPACK |
---|
[3] | 50 | ; Returns: |
---|
| 51 | ; AH: Int 13h return status |
---|
[294] | 52 | ; CF: 0 if successful, 1 if error |
---|
[3] | 53 | ; Corrupts registers: |
---|
[150] | 54 | ; AL, BX, CX, DX |
---|
[3] | 55 | ;-------------------------------------------------------------------- |
---|
[148] | 56 | AH23h_SetControllerFeatures: |
---|
[150] | 57 | mov al, COMMAND_SET_FEATURES |
---|
| 58 | mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY) |
---|
| 59 | jmp Idepack_StoreNonExtParametersAndIssueCommandFromAL |
---|