Changeset 258 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
- Timestamp:
- Feb 22, 2012, 7:01:53 PM (13 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
r248 r258 37 37 ; Clear: There is no selected menu item, DL is not valid 38 38 ; Corrupts registers: 39 ; CX, DI39 ; AX, DI 40 40 ;-------------------------------------------------------------------- 41 41 ALIGN JUMP_ALIGN … … 50 50 51 51 mov dl, cl ; Copy menuitem index to DX 52 call FloppyDrive_GetCountTo CX53 cmp dl, cl ; Floppy drive?52 call FloppyDrive_GetCountToAX 53 cmp dl, al ; Floppy drive? 54 54 jb SHORT .ReturnFloppyDriveInDX ; Set CF if branch taken 55 or cl, 80h ; Or 80h into CL before the sub55 or al, 80h ; Or 80h into AL before the sub 56 56 ; to cause CF to be set after 57 57 ; and result has high order bit set 58 sub dl, cl ; Remove floppy drives from index58 sub dl, al ; Remove floppy drives from index 59 59 60 60 .ReturnFloppyDriveInDX: … … 94 94 ALIGN JUMP_ALIGN 95 95 BootMenu_GetMenuitemCountToAX: 96 call RamVars_GetHardDiskCountFromBDAto CX96 call RamVars_GetHardDiskCountFromBDAtoAX 97 97 xchg ax, cx 98 call FloppyDrive_GetCountTo CX98 call FloppyDrive_GetCountToAX 99 99 add ax, cx 100 100 ret … … 136 136 BootMenu_GetMenuitemToAXforAsciiHotkeyInAL: 137 137 call Char_ALtoUpperCaseLetter 138 call BootMenu_GetLetterForFirstHardDiskToCL139 138 xor ah, ah 140 cmp al, cl ; Letter is for Hard Disk? 139 xchg ax, cx 140 call BootMenu_GetLetterForFirstHardDiskToAL 141 cmp cl, al ; Letter is for Hard Disk? 141 142 jae SHORT .StartFromHardDiskLetter 143 xchg ax, cx 142 144 sub al, 'A' ; Letter to Floppy Drive menuitem 143 145 ret 144 146 ALIGN JUMP_ALIGN 145 147 .StartFromHardDiskLetter: 146 sub al, cl ; Hard Disk index147 call FloppyDrive_GetCountTo CX148 sub cl, al ; Hard Disk index 149 call FloppyDrive_GetCountToAX 148 150 add ax, cx ; Menuitem index 151 ; Note: no need to xchg ax, cx as above, since adding with result to ax 149 152 ret 150 153 … … 160 163 ; CL: Upper case letter for first hard disk 161 164 ; Corrupts registers: 162 ; CH163 ;-------------------------------------------------------------------- 164 ALIGN JUMP_ALIGN 165 BootMenu_GetLetterForFirstHardDiskTo CL:166 call FloppyDrive_GetCountTo CX167 add cl, 'A'168 cmp cl, 'C'165 ; AX 166 ;-------------------------------------------------------------------- 167 ALIGN JUMP_ALIGN 168 BootMenu_GetLetterForFirstHardDiskToAL: 169 call FloppyDrive_GetCountToAX 170 add al, 'A' 171 cmp al, 'C' 169 172 ja .Return 170 mov cl, 'C'173 mov al, 'C' 171 174 ALIGN JUMP_ALIGN, ret 172 175 .Return: … … 181 184 ; DX: Menuitem index (assuming drive is available) 182 185 ; Corrupts registers: 183 ; Nothing186 ; AX 184 187 ;-------------------------------------------------------------------- 185 188 ALIGN JUMP_ALIGN … … 188 191 test dl, dl 189 192 jns SHORT .ReturnItemIndexInDX ; Return if floppy drive (HD bit not set) 190 call FloppyDrive_GetCountTo CX193 call FloppyDrive_GetCountToAX 191 194 and dl, ~80h ; Clear HD bit 192 add dx, cx195 add dx, ax 193 196 .ReturnItemIndexInDX: 194 197 ret … … 212 215 test dl, dl ; Floppy drive? 213 216 jns SHORT .IsFloppyDriveInSystem 214 call RamVars_GetHardDiskCountFromBDAto CX ; Hard Disk count to CX215 or cl, 80h ; Set Hard Disk bit to CX217 call RamVars_GetHardDiskCountFromBDAtoAX ; Hard Disk count to AX 218 or al, 80h ; Set Hard Disk bit to AX 216 219 jmp SHORT .CompareDriveNumberToDriveCount 217 220 .IsFloppyDriveInSystem: 218 call FloppyDrive_GetCountTo CX221 call FloppyDrive_GetCountToAX 219 222 .CompareDriveNumberToDriveCount: 220 cmp dl, cl ; Set CF when DL is smaller221 ret 223 cmp dl, al ; Set CF when DL is smaller 224 ret
Note:
See TracChangeset
for help on using the changeset viewer.