source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm@ 347

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

Changes to XTIDE Universal BIOS:

  • Commented out the FS and GS segment registers from INTPACK since we never touch them anyway.
  • Minor changes to improve speed in the Int13h handler.
  • Changed Prepare_ByValidatingSectorsInALforOldInt13h so it really doesn't corrupt anything.
  • Changed the makefile so 'make strings' now works even if StringsCompressed.asm is missing or empty.
File size: 2.2 KB
RevLine 
[99]1; Project name : XTIDE Universal BIOS
[3]2; Description : Functions for swapping drive letters.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; DriveXlate_ToOrBack
9; Parameters:
10; DL: Drive number to be possibly translated
11; DS: RAMVARS segment
12; Returns:
13; DL: Translated drive number
14; Corrupts registers:
15; DI
16;--------------------------------------------------------------------
17ALIGN JUMP_ALIGN
18DriveXlate_ToOrBack:
19 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_DRVXLAT
20 jz SHORT .Return ; Return if translation disabled
21 xchg di, ax ; Backup AX
22
[126]23 mov ah, 80h ; Assume hard disk
[294]24 mov al, [RAMVARS.xlateVars+XLATEVARS.bHDSwap]
[126]25 test dl, ah ; Hard disk?
[322]26 jnz SHORT .SwapDrive ; If so, jump to swap
[294]27 mov al, [RAMVARS.xlateVars+XLATEVARS.bFDSwap]
[126]28 cbw
[3]29
[126]30ALIGN JUMP_ALIGN
[322]31.SwapDrive:
32 cmp ah, dl ; Swap DL from 00h/80h to xxh?
[3]33 je SHORT .SwapToXXhInAL
[322]34 cmp al, dl ; Swap DL from xxh to 00h/80h?
35 jne SHORT .RestoreAXandReturn
[181]36 mov al, ah
[3]37ALIGN JUMP_ALIGN
38.SwapToXXhInAL:
39 mov dl, al
[322]40ALIGN JUMP_ALIGN
41.RestoreAXandReturn:
42 xchg ax, di ; Restore AX
[181]43ALIGN JUMP_ALIGN, ret
44.Return:
[3]45 ret
46
47
48;--------------------------------------------------------------------
49; Resets drive swapping variables to defaults (no swapping).
50;
51; DriveXlate_Reset
52; Parameters:
53; DS: RAMVARS segment
54; Returns:
55; Nothing
56; Corrupts registers:
[181]57; Nothing
[128]58;--------------------------------------------------------------------
[3]59ALIGN JUMP_ALIGN
60DriveXlate_Reset:
[248]61 mov WORD [RAMVARS.xlateVars+XLATEVARS.wFDandHDswap], 8000h
[3]62 ret
63
64
65;--------------------------------------------------------------------
66; Stores drive to be swapped.
67;
68; DriveXlate_SetDriveToSwap
69; Parameters:
70; DL: Drive to swap to 00h or 80h
71; DS: RAMVARS segment
72; Returns:
73; Nothing
74; Corrupts registers:
75; Nothing
[128]76;--------------------------------------------------------------------
[3]77ALIGN JUMP_ALIGN
78DriveXlate_SetDriveToSwap:
[128]79 test dl, dl ; Floppy drive?
80 js SHORT .SetHardDiskToSwap
[99]81.SetFloppyDriveToSwap:
[3]82 mov [RAMVARS.xlateVars+XLATEVARS.bFDSwap], dl
83 ret
84ALIGN JUMP_ALIGN
[99]85.SetHardDiskToSwap:
[3]86 mov [RAMVARS.xlateVars+XLATEVARS.bHDSwap], dl
87 ret
Note: See TracBrowser for help on using the repository browser.