Changeset 241 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm


Ignore:
Timestamp:
Feb 9, 2012, 11:08:59 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Space optimizations in the Boot Menu and BootInfo routines, taking advantage of nested %s. Optimization in the init of RamVars to avoid writing the signature twice. Preparing for addition of serial floppy support, starting to break the assumption that our drives are always 80h or higher.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm

    r181 r241  
    2222    call    BootMenu_Enter          ; Get selected menuitem index to CX
    2323    call    BootMenuPrint_ClearScreen
    24     cmp     cx, BYTE NO_ITEM_SELECTED
    25     je      SHORT BootMenu_DisplayAndReturnSelection    ; Clear screen and display menu
    26     ; Fall to BootMenu_GetDriveToDXforMenuitemInCX
     24    call    BootMenu_GetDriveToDXforMenuitemInCX
     25    jnc     BootMenu_DisplayAndReturnSelection
     26    ret
    2727
    2828;--------------------------------------------------------------------
     
    3030;   Parameters:
    3131;       CX:     Index of menuitem selected from Boot Menu
    32 ;       DS:     RAMVARS segment
    3332;   Returns:
    3433;       DX:     Drive number to be used for booting
    35 ;   Corrupts registers:
    36 ;       CX
    37 ;--------------------------------------------------------------------
     34;       DS:     RAMVARS segment
     35;       CF:     Set: There is a selected menu item, DL is valid
     36;               Clear: There is no selected menu item, DL is not valid
     37;   Corrupts registers:
     38;       CX, DI
     39;--------------------------------------------------------------------
     40ALIGN JUMP_ALIGN
     41BootMenu_GetDriveToDXforMenuitemInCX_And_RamVars_GetSegmentToDS:
     42    call    RamVars_GetSegmentToDS
     43;;; fall-through
     44                       
    3845ALIGN JUMP_ALIGN
    3946BootMenu_GetDriveToDXforMenuitemInCX:
    40     mov     dx, cx                  ; Copy menuitem index to DX
    41     call    FloppyDrive_GetCountToCX
    42     cmp     dx, cx                  ; Floppy drive?
    43     jb      SHORT .ReturnFloppyDriveInDX
    44     sub     dx, cx                  ; Remove floppy drives from index
    45     or      dl, 80h
     47    cmp     cl, NO_ITEM_HIGHLIGHTED
     48    je      SHORT .ReturnFloppyDriveInDX    ; Clear CF if branch taken
     49
     50    mov     dl, cl                          ; Copy menuitem index to DX
     51    call    FloppyDrive_GetCountToCX
     52    cmp     dl, cl                          ; Floppy drive?
     53    jb      SHORT .ReturnFloppyDriveInDX    ; Set CF if branch taken
     54    or      cl, 80h                         ; Or 80h into CL before the sub
     55                                            ; to cause CF to be set after
     56                                            ; and result has high order bit set
     57    sub     dl, cl                          ; Remove floppy drives from index
     58
    4659.ReturnFloppyDriveInDX:
    4760    ret
Note: See TracChangeset for help on using the changeset viewer.