Changeset 592 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Jun 25, 2018, 10:29:27 PM (6 years ago)
Author:
Krister Nordvall
Message:

Changes:

  • The problem with NASM in the previous revision (r591) has been fixed.
  • The colors used by the boot menu and hotkey bar can now be customized by selecting one of a number of pre-defined color themes. Suggestions for additional themes are more than welcome!
  • Large builds are now 10 KB. Small builds are still 8 KB with the exception of the Tiny build which is now 4 KB. In other words, builds are now as small as possible to make it easier to combine them with other BIOSes.
  • Added code to the library to improve drive error handling. XTIDECFG can now handle "Drive Not Ready" errors.
  • Fixed a couple of potential bugs in AtaID.asm (AtaID_GetMaxPioModeToAXandMinCycleTimeToCX); 1) ATA1.bPioMode was treated as a WORD variable. 2) ATA2.bPIOSupp was assumed to be non-zero which would result in PIO mode 3 being returned if the assumption was wrong.
  • Made the same changes in the equivalent function used by BIOSDRVS (DisplayPioModeInformationUsingAtaInfoFromDSBX in AtaInfo.asm).
  • Fixed a bug from r587 in PDC20x30.asm in PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX.
  • Fixed a bug from r523 in XTIDECFG where Auto Configure would only set the IRQ on one IDE interface on AT-builds.
  • XTIDECFG will now restore the default settings for the "Serial port virtual device" when reselecting it in the list of device types. This makes it behave consistently for all device types.
  • The eAAM macro is now used regardless if USE_UNDOC_INTEL is defined or not because it is apparently supported on all processors including the NEC V20/V30 CPUs.
  • Renamed the EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS define to EXCLUDE_FROM_XUB.
  • Added a define to exclude unused library code from BIOSDRVS (EXCLUDE_FROM_BIOSDRVS). This makes it a lot smaller than in previous revisions.
  • All unnecessary CLD-instructions are now under a new define 'CLD_NEEDED' which is only enabled for the BIOS. It is disabled for XTIDECFG and BIOSDRVS but can be enabled if needed by adding this define to the respective makefile. This change was made because these unnecessary instructions are wasteful and should never be needed. In fact, they only serve to hide bugs (in other peoples code) which I strongly believe should be avoided. I recommend people making their own BIOSes from source to not use this define as it's extremely unlikely to be needed.
  • Updated the copyright info in SerDrive and changed an URL to point to the new site.
  • Updated the copyright info and version number in BIOSDRVS.
  • Updated the copyright info in XTIDECFG.
  • Optimizations in general.
Location:
trunk/Assembly_Library
Files:
38 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/BiosFunctions.inc

    r510 r592  
    66; BIOS interrupts
    77BIOS_VIDEO_INTERRUPT_10h        EQU     10h
     8BIOS_EQUIPMENT_INTERRUPT_11h    EQU     11h
    89BIOS_DISK_INTERRUPT_13h         EQU     13h
    910BIOS_SYSTEM_INTERRUPT_15h       EQU     15h
  • trunk/Assembly_Library/Inc/Debug.inc

    r590 r592  
    2424    mov     bl, %2
    2525    CALL_DISPLAY_LIBRARY PrintWordFromAXWithBaseInBL
    26 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     26%ifndef EXCLUDE_FROM_XUB
    2727    call    Keyboard_RemoveAllKeystrokesFromBuffer
    2828%endif
     
    5252    mov     al, %1
    5353    CALL_DISPLAY_LIBRARY PrintCharacterFromAL
    54 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     54%ifndef EXCLUDE_FROM_XUB
    5555    call    Keyboard_RemoveAllKeystrokesFromBuffer
    5656%endif
     
    9595%macro WAIT_ANY_KEY_TO_CONTINUE 0
    9696    push    ax
    97 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     97%ifndef EXCLUDE_FROM_XUB
    9898    call    Keyboard_RemoveAllKeystrokesFromBuffer
    9999%endif
  • trunk/Assembly_Library/Inc/Display.inc

    r590 r592  
    6161    .InitializeDisplayContext                       resb    2
    6262
    63 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     63%ifndef EXCLUDE_FROM_XUB
    6464    .SetCharacterPointerFromBXAX                    resb    2
    6565%endif
     
    7474    .SynchronizeDisplayContextToHardware            resb    2
    7575
    76 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     76%ifndef EXCLUDE_FROM_XUB
    7777    .GetCharacterPointerToBXAX                      resb    2
    7878%endif
     
    8181
    8282    .FormatNullTerminatedStringFromCSSI             resb    2
    83 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     83%ifndef EXCLUDE_FROM_XUB
    8484    .PrintSignedWordFromAXWithBaseInBL              resb    2
    8585%endif
    8686    .PrintWordFromAXWithBaseInBL                    resb    2
    87 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
     87%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    8888    .PrintQWordFromSSBPwithBaseInBX                 resb    2
    8989%endif
     
    9494    .PrintCharacterFromAL                           resb    2
    9595    .PrintNewlineCharacters                         resb    2
    96 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     96%ifndef EXCLUDE_FROM_XUB
    9797    .ClearAreaWithHeightInAHandWidthInAL            resb    2
    9898%endif
  • trunk/Assembly_Library/Inc/DosFunctions.inc

    r589 r592  
    66; DOS interrupts
    77DOS_INTERRUPT_21h                                   EQU     21h
     8DOS_CTRL_C_CTRL_BREAK_HANDLER_23h                   EQU     23h
    89DOS_CRITICAL_ERROR_HANDLER_24h                      EQU     24h
    910DOS_TSR_MULTIPLEX_INTERRUPT_2Fh                     EQU     2Fh
     
    3132FIND_FIRST_MATCHING_FILE                            EQU     4Eh     ; DOS 2+
    3233FIND_NEXT_MATCHING_FILE                             EQU     4Fh     ; DOS 2+
     34GET_EXTENDED_ERROR_INFORMATION                      EQU     59h     ; DOS 3.0+
    3335
    3436; DOS errors
  • trunk/Assembly_Library/Inc/Emulate.inc

    r589 r592  
    6060
    6161;--------------------------------------------------------------------
     62; Find String In String
     63;
     64; FSIS
     65;   Parameters:
     66;       %1:     String to search for (case-insensitive)
     67;       %2:     String to search in
     68;   Returns:
     69;   strpos:     Position of %1 in %2 if found, 0 if not found
     70;--------------------------------------------------------------------
     71%macro FSIS 2.nolist
     72%defstr s1 %1
     73%defstr s2 %2
     74%strlen sl1 s1
     75%strlen sl2 s2
     76%assign strpos 0
     77    %if sl1 <= sl2
     78        %assign strpos sl2 - sl1 + 1
     79        %rep strpos
     80            %substr %%ss s2 strpos, sl1
     81            %ifidni %%ss, s1
     82                %exitrep
     83            %else
     84                %assign strpos strpos - 1
     85            %endif
     86        %endrep
     87    %endif
     88%endmacro
     89
     90
     91;--------------------------------------------------------------------
    6292; The undocumented instruction SALC (Set AL According to CF).
    6393; Available on all Intel processors and truly compatible clones.
     
    108138;--------------------------------------------------------------------
    109139; The AAM instruction (ASCII Adjust after Multiplication).
    110 ; Available on all Intel processors and truly compatible clones.
    111 ; Does not work on the NEC V20/V30 or Sony CXQ70108 processors
    112 ; unless %1 is 10 (0Ah).
    113140;
    114141; eAAM
     
    152179%macro eBSF 2
    153180%ifndef USE_386
    154     push    cx
    155181    cmp     WORD %2, BYTE 0     ; Source operand is zero?
    156182    je      SHORT %%Return      ;  If so, return with ZF set
    157183
    158184    ; Set destination to zero and load mask for bit 0
     185    push    cx
    159186    xor     %1, %1
    160187    mov     cx, 1
     
    163190%%BitLoop:
    164191    test    %2, cx              ; Bit set?
    165     jnz     SHORT %%Return      ;  If so, return with ZF cleared
     192    jnz     SHORT %%PopAndReturn;  If so, return with ZF cleared
    166193    shl     cx, 1               ; Prepare to test next bit
    167194    inc     %1                  ; Increment bit index
    168195    jmp     SHORT %%BitLoop     ; Loop until bit found
    169 %%Return:
     196%%PopAndReturn:
    170197    pop     cx
     198%%Return:
    171199;-----------------------------------
    172200%else
     
    193221%macro eBSR 2
    194222%ifndef USE_386
    195     push    cx
    196223    cmp     WORD %2, BYTE 0     ; Source operand is zero?
    197224    je      SHORT %%Return      ;  If so, return with ZF set
    198225
    199226    ; Load mask for highest order bit
     227    push    cx
    200228    mov     cx, 1<<15
    201229    mov     %1, 15
     
    204232%%BitLoop:
    205233    test    %2, cx              ; Bit set?
    206     jnz     SHORT %%Return      ;  If so, return with ZF cleared
     234    jnz     SHORT %%PopAndReturn;  If so, return with ZF cleared
    207235    shr     cx, 1               ; Prepare to test next bit
    208236    dec     %1                  ; Decrement bit index
    209237    jmp     SHORT %%BitLoop     ; Loop until bit found
    210 %%Return:
     238%%PopAndReturn:
    211239    pop     cx
     240%%Return:
    212241;-----------------------------------
    213242%else
     
    260289
    261290%macro eCMOVE 2
    262     eCMOVZ %1, %2
     291    eCMOVZ  %1, %2
    263292%endmacro
    264293
    265294%macro eCMOVNE 2
    266     eCMOVNZ %1, %2
     295    eCMOVNZ %1, %2
    267296%endmacro
    268297
    269298%macro eCMOVB 2
    270     jnb     SHORT %%Return
    271     mov     %1, %2
    272 %%Return:
     299    eCMOVC  %1, %2
    273300%endmacro
    274301
     
    289316; Conditional Set.
    290317;
    291 ; eCSETcc
     318; eSETcc
    292319;   Parameters:
    293320;       %1:     Destination data
     
    297324;       Flags
    298325;--------------------------------------------------------------------
    299 %macro eCSETZ 1
     326%macro eSETZ 1
    300327    mov     %1, 0           ; Clear while preserving flags
    301328    jnz     SHORT %%Return  ; Nothing to set
     
    304331%endmacro
    305332
    306 %macro eCSETNZ 1
     333%macro eSETNZ 1
    307334    mov     %1, 0           ; Clear while preserving flags
    308335    jz      SHORT %%Return  ; Nothing to set
     
    339366        xor     dh, dh
    340367    %else   ; SI, DI, BP (all may be used in effective address)
    341         push    ax
    342         mov     al, %2
    343         xor     ah, ah
    344         xchg    ax, %1
    345         pop     ax
     368        FSIS    %1, %2
     369        %if strpos
     370            push    ax
     371            mov     al, %2
     372            xor     ah, ah
     373            xchg    %1, ax
     374            pop     ax
     375        %else
     376            xchg    %1, ax
     377            mov     al, %2
     378            xor     ah, ah
     379            xchg    %1, ax
     380        %endif
    346381    %endif
    347382;-----------------------------------
     
    484519; eSEG_STR
    485520;   Parameters:
    486 ;       %1:     REP/REPNE or REPE prefix
     521;       %1:     REP/REPE/REPZ or REPNE/REPNZ prefix
    487522;       %2:     Source segment override (destination is always ES)
    488523;       %3:     String instruction
     
    491526;       FLAGS for cmps and scas only
    492527;   Corrupts registers:
    493 ;       Nothing
     528;       FLAGS
    494529;--------------------------------------------------------------------
    495530%macro eSEG_STR 3
     
    499534        %2                      ; SEG is the prefix that won't be lost
    500535        %3                      ; String instruction
     536FSIS    cmps, %3
     537%ifn strpos
     538    FSIS    scas, %3
     539%endif
     540%if strpos                      ; Must preserve FLAGS
    501541        jcxz    %%End           ; Jump to end if no repeats left (preserves FLAGS)
    502542        jmp     SHORT %%Loop    ; Loop while repeats left
    503543    %%End:
     544%else                           ; No need to preserve FLAGS
     545        inc     cx
     546        loop    %%Loop
     547%endif
    504548%else   ; No bug on V20/V30 and later, don't know about 188/186
    505549    %2
     
    556600%ifdef USE_386
    557601    %if %2 = 1
    558         add     %1, %1  ; Same size but faster on 386 and 486. Fails if %1 is a memory operand.
     602        FSIS    ], %1
     603        %if strpos
     604            eSHIFT_IM   %1, %2, shl
     605        %else
     606            add     %1, %1  ; Same size but faster on 386 and 486.
     607        %endif
    559608    %else
    560609        eSHIFT_IM   %1, %2, shl
     
    582631%ifdef USE_386
    583632    %if %2 = 1
    584         adc     %1, %1  ; Same size but faster on 386 and 486. Fails if %1 is a memory operand.
     633        FSIS    ], %1
     634        %if strpos
     635            eSHIFT_IM   %1, %2, rcl
     636        %else
     637            adc     %1, %1  ; Same size but faster on 386 and 486.
     638        %endif
    585639    %else
    586640        eSHIFT_IM   %1, %2, rcl
  • trunk/Assembly_Library/Inc/Macros.inc

    r566 r592  
    1818;       %1
    1919;--------------------------------------------------------------------
    20 %macro SKIP2B 1
     20%macro SKIP2B 1.nolist
    2121    %ifidni     %1, f
    2222        db  03Dh                    ; Opcode byte for CMP AX, <immed>
  • trunk/Assembly_Library/Inc/Math.inc

    r589 r592  
    2323    jb      %%Return            ;  If so, return
    2424    mov     %1, %2              ; Copy %2 to %1
    25 ALIGN JUMP_ALIGN
    2625%%Return:
    2726%endmacro
     
    3130    jl      %%Return            ;  If so, return
    3231    mov     %1, %2              ; Copy %2 to %1
    33 ALIGN JUMP_ALIGN
    3432%%Return:
    3533%endmacro
     
    5149    ja      %%Return            ;  If so, return
    5250    mov     %1, %2              ; Copy %2 to %1
    53 ALIGN JUMP_ALIGN
    5451%%Return:
    5552%endmacro
     
    5956    jg      %%Return            ;  If so, return
    6057    mov     %1, %2              ; Copy %2 to %1
    61 ALIGN JUMP_ALIGN
    6258%%Return:
    6359%endmacro
     
    6763; SHL_DXAX
    6864;   Parameters:
    69 ;       %1:     Number of bits to shift
     65;       %1:     Number of bits to shift. Can be (in preferred order) CX, CL or an immediate value.
    7066;   Returns:
    7167;       DX:AX   Shifted value
     
    7470;--------------------------------------------------------------------
    7571%macro SHL_DXAX 1
     72%ifdef USE_386
    7673    %ifnidni %1, cx
     74        ; %1 is CL or an immediate
     75        shld    dx, ax, %1
     76        shl     ax, %1
     77    %else
     78        ; %1 is CX
     79        shld    dx, ax, cl
     80        shl     ax, cl
     81    %endif
     82%else
     83    %ifidni %1, cl
     84        ; %1 is CL
     85        xor     ch, ch
     86    %elifnidni %1, cx
     87        ; %1 is an immediate
    7788        mov     cx, %1
    7889    %endif
     
    8293    eRCL_IM dx, 1
    8394    loop    .ShiftNextBit
     95%endif
    8496%endmacro
    8597
     
    88100; SHR_DXAX
    89101;   Parameters:
    90 ;       %1:     Number of bits to shift
     102;       %1:     Number of bits to shift. Can be (in preferred order) CX, CL or an immediate value.
    91103;   Returns:
    92104;       DX:AX   Shifted value
     
    95107;--------------------------------------------------------------------
    96108%macro SHR_DXAX 1
     109%ifdef USE_386
    97110    %ifnidni %1, cx
     111        ; %1 is CL or an immediate
     112        shrd    ax, dx, %1
     113        shr     dx, %1
     114    %else
     115        ; %1 is CX
     116        shrd    ax, dx, cl
     117        shr     dx, cl
     118    %endif
     119%else
     120    %ifidni %1, cl
     121        ; %1 is CL
     122        xor     ch, ch
     123    %elifnidni %1, cx
     124        ; %1 is an immediate
    98125        mov     cx, %1
    99126    %endif
     
    103130    rcr     ax, 1
    104131    loop    .ShiftNextBit
     132%endif
    105133%endmacro
    106134
  • trunk/Assembly_Library/Inc/Menu.inc

    r525 r592  
    159159SCROLL_THUMB_CHARACTER              EQU     BLOCK_FULL_FOREGROUND
    160160
    161 NO_ITEM_SELECTED                    EQU     -1
     161;NO_ITEM_SELECTED                   EQU     -1
    162162NO_ITEM_HIGHLIGHTED                 EQU     -1
    163163NO_TIMEOUT_USED                     EQU     0
  • trunk/Assembly_Library/Src/AssemblyLibrary.asm

    r526 r592  
    9090  %endif
    9191    %include "Char.asm"
    92     %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     92    %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    9393        %include "String.asm"
    9494        %include "StringProcess.asm"
     
    106106
    107107%ifdef INCLUDE_TIME_LIBRARY
    108     %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     108    %ifndef EXCLUDE_FROM_XUB
    109109        %include "Delay.asm"
    110110        %ifndef EXCLUDE_FROM_XTIDECFG
     
    119119    %define UTIL_SIZE_JUMP_ALIGN 1
    120120  %endif
    121     %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    122         %include "Bit.asm"
     121    %ifndef EXCLUDE_FROM_XUB
     122        %ifndef EXCLUDE_FROM_BIOSDRVS
     123            %include "Bit.asm"
     124        %endif
     125        %include "Math.asm"
    123126    %endif
    124     %include "Math.asm"
    125     %include "Registers.asm"
    126     %include "Reboot.asm"
    127     %include "Memory.asm"
     127    %ifndef EXCLUDE_FROM_BIOSDRVS
     128        %include "Registers.asm"
     129        %include "Reboot.asm"
     130        %include "Memory.asm"
     131    %endif
    128132    %include "Size.asm"
    129     %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     133    %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    130134        %include "Sort.asm"
    131135    %endif
  • trunk/Assembly_Library/Src/Display/CgaSnow.asm

    r583 r592  
    106106;       AX, CX, DX
    107107;--------------------------------------------------------------------
    108 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     108%ifdef EXCLUDE_FROM_XUB
    109109    %ifdef MODULE_STRINGS_COMPRESSED
    110110        %define EXCLUDE
  • trunk/Assembly_Library/Src/Display/Display.asm

    r590 r592  
    3838    push    dx
    3939
     40%ifdef CLD_NEEDED
    4041    cld
     42%endif
    4143    LOAD_BDA_SEGMENT_TO ds, dx
    4244    mov     dx, di
     
    7678    %define InitializeDisplayContext                        DisplayContext_Initialize
    7779
    78 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     80%ifndef EXCLUDE_FROM_XUB
    7981    %define SetCharacterPointerFromBXAX                     DisplayContext_SetCharacterPointerFromBXAX
    8082%endif
     
    8991    %define SynchronizeDisplayContextToHardware             DisplayContext_SynchronizeToHardware
    9092
    91 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     93%ifndef EXCLUDE_FROM_XUB
    9294    %define GetCharacterPointerToBXAX                       DisplayContext_GetCharacterPointerToBXAX
    9395%endif
     
    9698
    9799    %define FormatNullTerminatedStringFromCSSI              Display_FormatNullTerminatedStringFromCSSI
    98 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     100%ifndef EXCLUDE_FROM_XUB
    99101    %define PrintSignedWordFromAXWithBaseInBL               DisplayPrint_SignedWordFromAXWithBaseInBL
    100102%endif
    101103    %define PrintWordFromAXWithBaseInBL                     DisplayPrint_WordFromAXWithBaseInBL
    102 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
     104%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    103105    %define PrintQWordFromSSBPwithBaseInBX                  DisplayPrint_QWordFromSSBPwithBaseInBX
    104106%endif
     
    109111    %define PrintCharacterFromAL                            DisplayPrint_CharacterFromAL
    110112    %define PrintNewlineCharacters                          DisplayPrint_Newline
    111 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     113%ifndef EXCLUDE_FROM_XUB
    112114    %define ClearAreaWithHeightInAHandWidthInAL             DisplayPrint_ClearAreaWithHeightInAHandWidthInAL
    113115%endif
  • trunk/Assembly_Library/Src/Display/DisplayContext.asm

    r588 r592  
    110110;       AX, DI
    111111;--------------------------------------------------------------------
    112 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     112%ifdef EXCLUDE_FROM_XUB
    113113    %ifndef MODULE_BOOT_MENU
    114114        %define EXCLUDE
     
    116116%endif
    117117
    118 %ifndef EXCLUDE
     118%ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS
    119119ALIGN DISPLAY_JUMP_ALIGN
    120120DisplayContext_Push:
     
    170170    mov     ds, di                  ; Restore DS
    171171    ret
    172 %endif ; EXCLUDE
     172%endif ; EXCLUDE OR EXCLUDE_FROM_BIOSDRVS
    173173%undef EXCLUDE
    174174
     
    184184;       AX, DI
    185185;--------------------------------------------------------------------
    186 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     186%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    187187ALIGN DISPLAY_JUMP_ALIGN
    188188DisplayContext_PrepareOffScreenBufferInESBXwithLengthInCX:
     
    202202    pop     ds
    203203    ret
    204 %endif ; EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     204%endif ; EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    205205
    206206
     
    215215;       AX
    216216;--------------------------------------------------------------------
    217 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     217%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    218218ALIGN DISPLAY_JUMP_ALIGN
    219219DisplayContext_SetCharacterPointerFromBXAX:
     
    235235;       Nothing
    236236;--------------------------------------------------------------------
    237 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     237%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    238238ALIGN DISPLAY_JUMP_ALIGN
    239239DisplayContext_GetCharacterPointerToBXAX:
     
    244244
    245245
    246 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     246%ifdef EXCLUDE_FROM_XUB
    247247    %ifndef MODULE_BOOT_MENU
    248248        %define EXCLUDE
     
    282282;--------------------------------------------------------------------
    283283%ifndef EXCLUDE ; 2 of 3
     284%ifndef EXCLUDE_FROM_BIOSDRVS
    284285ALIGN DISPLAY_JUMP_ALIGN
    285286DisplayContext_SetCharacterAttributeFromAL:
     
    287288    ret
    288289%endif
     290%endif
    289291
    290292
     
    300302;--------------------------------------------------------------------
    301303%ifndef EXCLUDE ; 3 of 3
     304%ifndef EXCLUDE_FROM_BIOSDRVS
    302305ALIGN DISPLAY_JUMP_ALIGN
    303306DisplayContext_SetCharacterOutputParameterFromAX:
     
    305308    ret
    306309%endif
     310%endif
    307311
    308312%undef EXCLUDE
     
    318322;       Nothing
    319323;--------------------------------------------------------------------
    320 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
     324%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS
    321325ALIGN DISPLAY_JUMP_ALIGN
    322326DisplayContext_GetCharacterOutputParameterToDX:
  • trunk/Assembly_Library/Src/Display/DisplayCursor.asm

    r526 r592  
    4848;       Nothing
    4949;--------------------------------------------------------------------
    50 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     50%ifdef EXCLUDE_FROM_XUB
    5151    %ifndef MODULE_BOOT_MENU
    5252        %define EXCLUDE
     
    5454%endif
    5555
    56 %ifndef EXCLUDE
     56%ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS
    5757ALIGN DISPLAY_JUMP_ALIGN
    5858DisplayCursor_SetShapeFromAX:
  • trunk/Assembly_Library/Src/Display/DisplayFormat.asm

    r590 r592  
    142142
    143143.rgcFormatCharToLookupIndex:
    144 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     144%ifndef EXCLUDE_FROM_XUB
    145145    db      "aIAduxsSctz-+%"
    146146%else
     
    150150ALIGN WORD_ALIGN
    151151.rgfnFormatSpecifierParser:
    152 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     152%ifndef EXCLUDE_FROM_XUB
    153153    dw      a_FormatAttributeForNextCharacter
    154154%endif
    155155    dw      I_FormatDashForZero
    156156    dw      A_FormatAttributeForRemainingString
    157 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     157%ifndef EXCLUDE_FROM_XUB
    158158    dw      d_FormatSignedDecimalWord
    159159%endif
     
    161161    dw      x_FormatHexadecimalWord
    162162    dw      s_FormatStringFromSegmentCS
    163 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     163%ifndef EXCLUDE_FROM_XUB
    164164    dw      S_FormatStringFromFarPointer
    165165%endif
    166166    dw      c_FormatCharacter
    167 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     167%ifndef EXCLUDE_FROM_XUB
    168168    dw      t_FormatRepeatCharacter
    169169%endif
    170170    dw      z_FormatStringFromSegmentZero
    171171    dw      PrepareToPrependParameterWithSpaces
    172 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     172%ifndef EXCLUDE_FROM_XUB
    173173    dw      PrepareToAppendSpacesAfterParameter
    174174    dw      percent_FormatPercent
     
    308308;       AX, BX, DX
    309309;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    310 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     310%ifndef EXCLUDE_FROM_XUB
    311311ALIGN DISPLAY_JUMP_ALIGN
    312312a_FormatAttributeForNextCharacter:
     
    330330    ret
    331331
    332 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     332%ifndef EXCLUDE_FROM_XUB
    333333ALIGN DISPLAY_JUMP_ALIGN
    334334d_FormatSignedDecimalWord:
     
    391391    ret
    392392
    393 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     393%ifndef EXCLUDE_FROM_XUB
    394394ALIGN DISPLAY_JUMP_ALIGN
    395395S_FormatStringFromFarPointer:
     
    408408    jmp     DisplayPrint_CharacterFromAL
    409409
    410 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     410%ifndef EXCLUDE_FROM_XUB
    411411ALIGN DISPLAY_JUMP_ALIGN
    412412t_FormatRepeatCharacter:
  • trunk/Assembly_Library/Src/Display/DisplayPage.asm

    r589 r592  
    3131;       AX, DX
    3232;--------------------------------------------------------------------
    33 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
     33%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS
    3434ALIGN DISPLAY_JUMP_ALIGN
    3535DisplayPage_SetFromAL:
     
    4141
    4242
    43 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     43%ifdef EXCLUDE_FROM_XUB
    4444    %define EXCLUDE
    4545    %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU
     
    4848%endif
    4949
    50 %ifndef EXCLUDE
     50%ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS
    5151;--------------------------------------------------------------------
    5252; DisplayPage_GetColumnsToALandRowsToAH
  • trunk/Assembly_Library/Src/Display/DisplayPrint.asm

    r590 r592  
    9494;       AX, BH, DX
    9595;--------------------------------------------------------------------
    96 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     96%ifndef EXCLUDE_FROM_XUB
    9797ALIGN DISPLAY_JUMP_ALIGN
    9898DisplayPrint_SignedWordFromAXWithBaseInBL:
     
    163163;       AX, DX, [SS:BP]
    164164;--------------------------------------------------------------------
    165 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
     165%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    166166ALIGN DISPLAY_JUMP_ALIGN
    167167DisplayPrint_QWordFromSSBPwithBaseInBX:
     
    194194;       AX, DX
    195195;--------------------------------------------------------------------
    196 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     196%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    197197ALIGN DISPLAY_JUMP_ALIGN
    198198DisplayPrint_CharacterBufferFromBXSIwithLengthInCX:
     
    261261;       AX, DX
    262262;--------------------------------------------------------------------
    263 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     263%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    264264ALIGN DISPLAY_JUMP_ALIGN
    265265DisplayPrint_ClearAreaWithHeightInAHandWidthInAL:
     
    292292%endif
    293293
    294 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     294%ifdef EXCLUDE_FROM_XUB
    295295    %define EXCLUDE
    296296    %ifndef MODULE_STRINGS_COMPRESSED
  • trunk/Assembly_Library/Src/File/Directory.asm

    r526 r592  
    9999;       Nothing
    100100;--------------------------------------------------------------------
     101%ifndef EXCLUDE_FROM_XTIDECFG
    101102ALIGN JUMP_ALIGN
    102103Directory_GetMatchCountToAXforSearchStringInDSSIwithAttributesInCX:
     
    115116    pop     dx
    116117    ret
     118%endif
    117119
    118120
  • trunk/Assembly_Library/Src/File/DosCritical.asm

    r526 r592  
    1 ; File name     :   DosCritical.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   1.9.2010
    4 ; Last update   :   2.9.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   DOS Critical Error Handler (24h) replacements.
    73
     
    2218;
    2319
     20; Note! Only DOS functions 01h - 0Ch, 30h and 59h can be called from a Critical Error Handler.
    2421
    2522; DOS Critical Error Handler return values
     
    2825    .retryOperation                             resb    1
    2926    .terminateProgramAsThoughInt21hAH4ChCalled  resb    1
    30     .failSystemCallInProgress                   resb    1
     27    .failSystemCallInProgress                   resb    1   ; Needs DOS 3.1+
    3128endstruc
    3229
     
    8380
    8481;--------------------------------------------------------------------
     82; DosCritical_CustomHandler
     83;   Parameters:
     84;       Nothing
     85;   Returns:
     86;       Nothing
     87;   Corrupts registers:
     88;       Nothing
     89;--------------------------------------------------------------------
     90ALIGN JUMP_ALIGN
     91DosCritical_CustomHandler:
     92    add     sp, 6   ; Remove the INT 24h return address and flags from stack
     93
     94    mov     ah, GET_EXTENDED_ERROR_INFORMATION  ; Requires DOS 3.0+
     95    xor     bx, bx
     96    int     DOS_INTERRUPT_21h
     97    mov     [cs:bLastCriticalError], al
     98
     99    pop     ax
     100    pop     bx
     101    pop     cx
     102    pop     dx
     103    pop     si
     104    pop     di
     105    pop     bp
     106    pop     ds
     107    pop     es
     108    iret            ; Return from the INT 21h call
     109
     110bLastCriticalError:     db  0
     111
     112
     113;--------------------------------------------------------------------
    85114; DosCritical_HandlerToIgnoreAllErrors
    86115;   Parameters:
     
    95124    mov     al, CRITICAL_ERROR_ACTION.ignoreErrorAndContinueProcessingRequest
    96125    iret
     126
  • trunk/Assembly_Library/Src/File/Drive.asm

    r589 r592  
    3030;       Nothing
    3131;--------------------------------------------------------------------
     32%ifndef EXCLUDE_FROM_XTIDECFG
    3233ALIGN JUMP_ALIGN
    3334Drive_GetNumberOfAvailableDrivesToAX:
     
    4243    pop     dx
    4344    ret
     45%endif
    4446
    4547
  • trunk/Assembly_Library/Src/File/FileIO.asm

    r526 r592  
    3535;       AX, BX
    3636;--------------------------------------------------------------------
     37%ifndef EXCLUDE_FROM_XTIDECFG
    3738ALIGN JUMP_ALIGN
    3839FileIO_CreateWithPathInDSSIandAttributesInCX:
     
    4041    SKIP2B  bx
    4142    ; Fall to FileIO_OpenWithPathInDSSIandFileAccessInAL
     43%endif
    4244
    4345;--------------------------------------------------------------------
  • trunk/Assembly_Library/Src/Keyboard/Keyboard.asm

    r589 r592  
    3737;       DX
    3838;--------------------------------------------------------------------
    39 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     39%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    4040ALIGN KEYBOARD_JUMP_ALIGN
    4141Keyboard_ReadUserInputtedWordWhilePrinting:
     
    8787;       AX
    8888;--------------------------------------------------------------------
    89 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     89%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    9090ALIGN KEYBOARD_JUMP_ALIGN
    9191Keyboard_ReadUserInputtedStringToESDIWhilePrinting:
     
    9898    xor     bx, bx                              ; Zero character counter
    9999    dec     cx                                  ; Decrement buffer size for NULL
     100%ifdef CLD_NEEDED
    100101    cld
     102%endif
    101103ALIGN KEYBOARD_JUMP_ALIGN
    102104.GetCharacterFromUser:
     
    197199    xor     al, al                              ; Set ZF and clear CF
    198200    ret
    199 %endif ; EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     201%endif ; EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    200202
    201203
     
    209211;       AX
    210212;--------------------------------------------------------------------
    211 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     213%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    212214ALIGN KEYBOARD_JUMP_ALIGN
    213215Keyboard_PrintBackspace:
     
    230232;       AX
    231233;--------------------------------------------------------------------
    232 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     234%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    233235ALIGN KEYBOARD_JUMP_ALIGN
    234236Keyboard_PlayBellForUnwantedKeystroke:
     
    246248;       AX
    247249;--------------------------------------------------------------------
    248 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     250%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    249251ALIGN KEYBOARD_JUMP_ALIGN
    250252Keyboard_PrintInputtedCharacter:
     
    266268;       AX
    267269;--------------------------------------------------------------------
    268 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS   ; Only used when debugging
     270%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS               ; Only used when debugging
    269271ALIGN KEYBOARD_JUMP_ALIGN
    270272Keyboard_RemoveAllKeystrokesFromBuffer:
     
    289291;       Nothing
    290292;--------------------------------------------------------------------
    291 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     293%ifdef EXCLUDE_FROM_XUB
    292294    %define EXCLUDE
    293295    %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU
  • trunk/Assembly_Library/Src/LibSizeCheck.asm

    r526 r592  
    2020
    2121; Include .inc files
    22 %define EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     22%define EXCLUDE_FROM_XUB
    2323;%define INCLUDE_DISPLAY_LIBRARY
    2424;%define INCLUDE_FILE_LIBRARY
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r589 r592  
    249249ALIGN JUMP_ALIGN
    250250AppendFileFromDTAinDSSItoOffScreenBuffer:
    251     call    .FilterCurrentDirectory         ; We never want "."
    252     call    .FilterUpDirectoryWhenInRoot    ; No ".." when in root directory
     251    cmp     WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS
     252    je      SHORT .Return                   ; We never want "."
     253    test    dl, dl
     254    jnz     SHORT .NotInRootDirectory
     255    cmp     WORD [si+DTA.szFile], UPDIR_CHARACTERS
     256    je      SHORT .Return                   ; No ".." when in root directory
     257.NotInRootDirectory:
    253258    inc     cx                              ; Nothing filtered so increment files/directories
    254259
     
    262267    pop     si
    263268    pop     bp
    264     ret
    265 
    266 ;--------------------------------------------------------------------
    267 ; .FilterCurrentDirectory
    268 ; .FilterUpDirectoryWhenInRoot
    269 ;   Parameters:
    270 ;       DL:     Zero if root directory selected
    271 ;       DS:SI:  Ptr to DTA containing file information
    272 ;   Returns:
    273 ;       Nothing
    274 ;       Returns from AppendFileToBufferInESDIfromDtaInDSSI when filtering
    275 ;   Corrupts registers:
    276 ;       AX
    277 ;--------------------------------------------------------------------
    278 ALIGN JUMP_ALIGN
    279 .FilterCurrentDirectory:
    280     cmp     WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS
    281     je      SHORT .DoFilter
    282     ret
    283 
    284 ALIGN JUMP_ALIGN
    285 .FilterUpDirectoryWhenInRoot:
    286     test    dl, dl          ; Set ZF if root directory selected
    287     jnz     SHORT .ReturnWithoutFiltering
    288     cmp     WORD [si+DTA.szFile], UPDIR_CHARACTERS
    289     jne     SHORT .ReturnWithoutFiltering
    290 .DoFilter:
    291     add     sp, BYTE 2      ; Remove return address from stack
    292 ALIGN JUMP_ALIGN, ret
    293 .ReturnWithoutFiltering:
     269.Return:
    294270    ret
    295271
     
    473449ALIGN JUMP_ALIGN
    474450GetInfoLinesToCXandDialogFlagsToAX:
    475     xor     ax, ax
    476     call    GetDialogFlagsToAL
    477     jmp     Bit_GetSetCountToCXfromAX
     451    ePUSH_T ax, Bit_GetSetCountToCXfromAX
     452    xor     ah, ah
     453    ; Fall to GetDialogFlagsToAL
    478454
    479455;--------------------------------------------------------------------
     
    696672    call    .ChangeDriveToUserSelectionFromIoInDSSI
    697673    add     sp, BYTE DRIVE_DIALOG_IO_size
     674.UserCancelledDriveChange:
    698675    ret
    699676
     
    729706    jne     SHORT .UserCancelledDriveChange
    730707
     708    ; Install our Custom Critical Error Handler to catch "Drive Not Ready" errors. This handler only works on DOS 3.0+ systems
     709    ; but that should be OK because only DOS 3.1+ will trigger it. Under older DOS versions drives are enumerated using
     710    ; GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE which will access the drive so we know it is available at this point.
     711    mov     dx, DosCritical_CustomHandler
     712    call    DosCritical_InstallNewHandlerFromCSDX
     713
     714    ; Save the current drive on stack in case the selected drive is not ready and the user decides to cancel the change.
     715    call    Drive_GetDefaultToAL
     716    xchg    dx, ax
     717
     718.RetryDrive:
     719    push    dx                                  ; Save the previous current drive to stack
     720
    731721    mov     dl, [si+DRIVE_DIALOG_IO.bReturnDriveNumber]
    732722    call    Drive_SetDefaultFromDL
     723
     724    ; Now we must try to force a media access to catch "Drive Not Ready".
     725    push    ds
     726    push    ss
     727    pop     ds
     728    ePUSH_T ax, CURRENTDIR_CHARACTERS
     729    mov     cx, FLG_FILEATTR_DIRECTORY
     730    mov     dx, sp
     731    mov     ax, FIND_FIRST_MATCHING_FILE<<8
     732    int     DOS_INTERRUPT_21h
     733    pop     ax
     734    pop     ds
     735
     736    pop     dx                                  ; Restore the previous current drive from stack
     737
     738    xchg    ah, [cs:bLastCriticalError]         ; Zero bLastCriticalError and fetch error code to AH
     739    cmp     ah, ERR_DOS_DRIVE_NOT_READY
     740    jne     SHORT .DriveIsReady
     741
     742    mov     bx, g_szDlgDriveNotReady
     743    call    Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX
     744    jz      SHORT .RetryDrive
     745    ; The user cancelled the drive change. Restore current drive to what it was previously.
     746    call    Drive_SetDefaultFromDL
     747    jmp     DosCritical_RestoreDosHandler
     748
     749.DriveIsReady:
     750    call    DosCritical_RestoreDosHandler
    733751    jmp     RefreshFilesToDisplay
    734 .UserCancelledDriveChange:
    735     ret
    736752
    737753
  • trunk/Assembly_Library/Src/Menu/MenuAttributes.asm

    r526 r592  
    9191
    9292.rgcColorAttributes:
     93; Classic (default theme)
    9394istruc ATTRIBUTE_CHARS
    9495    at  ATTRIBUTE_CHARS.cBordersAndBackground,  db  COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE)
     
    100101    at  ATTRIBUTE_CHARS.cNormalTimeout,         db  COLOR_ATTRIBUTE(COLOR_GREEN, COLOR_BLUE)
    101102iend
     103ColorTheme  equ     MenuAttribute_GetToAXfromTypeInSI.rgcColorAttributes
    102104
    103105.rgcBlackAndWhiteAttributes:    ; Only COLOR_WHITE, COLOR_BRIGHT_WHITE and COLOR_BLACK should be used
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r583 r592  
    8787;       AX, BX, CX, DX, SI, DI
    8888;--------------------------------------------------------------------
    89 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     89%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    9090ALIGN MENU_JUMP_ALIGN
    9191MenuBorders_RefreshItemBorders:
  • trunk/Assembly_Library/Src/Menu/MenuInit.asm

    r532 r592  
    114114;       AX, BX, DX
    115115;--------------------------------------------------------------------
    116 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     116%ifndef EXCLUDE_FROM_XUB
    117117ALIGN MENU_JUMP_ALIGN
    118118MenuInit_CloseMenuIfExitEventAllows:
     
    138138
    139139
    140 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     140%ifndef EXCLUDE_FROM_XUB
    141141;--------------------------------------------------------------------
    142142; MenuInit_HighlightItemFromAX
     
    168168    mov     ax, [bp+MENUINIT.wHighlightedItem]
    169169    ret
    170 %endif ; EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     170%endif ; EXCLUDE_FROM_XUB
    171171
    172172
     
    183183;       Nothing
    184184;--------------------------------------------------------------------
    185 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     185%ifndef EXCLUDE_FROM_XUB
     186%ifndef EXCLUDE_FROM_XTIDECFG
    186187ALIGN MENU_JUMP_ALIGN
    187188MenuInit_SetTitleHeightFromAL:
     
    193194    mov     [bp+MENUINIT.bInfoLines], al
    194195    ret
     196%endif ; EXCLUDE_FROM_XTIDECFG
    195197
    196198ALIGN MENU_JUMP_ALIGN
     
    198200    mov     [bp+MENUINIT.wItems], ax
    199201    ret
    200 %endif
     202%endif ; EXCLUDE_FROM_XUB
    201203
    202204
     
    212214;       Nothing
    213215;--------------------------------------------------------------------
    214 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     216%ifndef EXCLUDE_FROM_XUB
     217%ifndef EXCLUDE_FROM_XTIDECFG
    215218ALIGN MENU_JUMP_ALIGN
    216219MenuInit_SetUserDataFromDSSI:
     
    218221    mov     [bp+MENU.dwUserData+2], ds
    219222    ret
     223%endif ; EXCLUDE_FROM_XTIDECFG
    220224
    221225ALIGN MENU_JUMP_ALIGN
     
    223227    lds     si, [bp+MENU.dwUserData]
    224228    ret
    225 %endif
     229%endif ; EXCLUDE_FROM_XUB
  • trunk/Assembly_Library/Src/Menu/MenuLocation.asm

    r583 r592  
    5555;       Nothing
    5656;--------------------------------------------------------------------
    57 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     57%ifndef EXCLUDE_FROM_XUB
    5858MenuLocation_GetItemBordersTopLeftCoordinatesToAX:
    5959%endif
  • trunk/Assembly_Library/Src/Menu/MenuText.asm

    r583 r592  
    3232;       AX, BX, CX, DX, SI, DI
    3333;--------------------------------------------------------------------
    34 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     34%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    3535ALIGN MENU_JUMP_ALIGN
    3636MenuText_ClearTitleArea:
  • trunk/Assembly_Library/Src/Serial/SerialServer.asm

    r568 r592  
    6161        push    ax              ; working copy on the top of the stack
    6262
    63 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS   ; DF already cleared in Int13h.asm
     63%ifndef EXCLUDE_FROM_XUB        ; DF already cleared in Int13h.asm
     64%ifdef CLD_NEEDED
    6465        cld
     66%endif
    6567%endif
    6668
  • trunk/Assembly_Library/Src/String/Char.asm

    r526 r592  
    5151;       Nothing
    5252;--------------------------------------------------------------------
    53 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     53%ifdef EXCLUDE_FROM_XUB
    5454    %ifndef MODULE_HOTKEYS
    5555        %define EXCLUDE
     
    5757%endif
    5858
    59 %ifndef EXCLUDE
     59%ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS
    6060ALIGN STRING_JUMP_ALIGN
    6161Char_IsLowerCaseLetterInAL:
     
    7676;       Nothing
    7777;--------------------------------------------------------------------
    78 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     78%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    7979ALIGN STRING_JUMP_ALIGN
    8080Char_IsUpperCaseLetterInAL:
     
    9595;       Nothing
    9696;--------------------------------------------------------------------
    97 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     97%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    9898ALIGN STRING_JUMP_ALIGN
    9999Char_IsHexadecimalDigitInAL:
     
    136136;       Nothing
    137137;--------------------------------------------------------------------
    138 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     138%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    139139ALIGN STRING_JUMP_ALIGN
    140140Char_ConvertIntegerToALfromDigitInALwithBaseInBX:
     
    166166;       Nothing
    167167;--------------------------------------------------------------------
    168 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     168%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    169169ALIGN STRING_JUMP_ALIGN
    170170Char_CharIsValid:
     
    174174
    175175
    176 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     176%ifdef EXCLUDE_FROM_XUB
    177177    %ifndef MODULE_HOTKEYS
    178178        %define EXCLUDE
     
    201201;       Nothing
    202202;--------------------------------------------------------------------
    203 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     203%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    204204ALIGN STRING_JUMP_ALIGN
    205205Char_ALtoLowerCaseLetter:
     
    218218;       Nothing
    219219;--------------------------------------------------------------------
    220 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     220%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    221221ALIGN STRING_JUMP_ALIGN
    222222Char_ALtoUpperCaseLetter:
     
    237237;       Nothing
    238238;--------------------------------------------------------------------
    239 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     239%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    240240Char_ChangeCaseInAL:
    241241    xor     al, 32
     
    254254;       Nothing
    255255;--------------------------------------------------------------------
    256 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     256%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS
    257257ALIGN STRING_JUMP_ALIGN
    258258Char_GetFilterFunctionToDXforNumericBaseInBX:
  • trunk/Assembly_Library/Src/Time/TimerTicks.asm

    r526 r592  
    4848;       CX
    4949;--------------------------------------------------------------------
    50 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     50%ifndef EXCLUDE_FROM_XUB
    5151%ifndef EXCLUDE_FROM_XTIDECFG
    5252ALIGN JUMP_ALIGN
     
    6464    div     cx      ; Divide DX:AX by CX, Minutes to AX, remainder ticks to DX
    6565    ret
    66 %endif ; EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    67 
    68 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
     66%endif ; EXCLUDE_FROM_XUB
     67
     68%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    6969ALIGN JUMP_ALIGN
    7070TimerTicks_GetSecondsToAXandRemainderTicksToDXfromTicksInDX:
     
    8080
    8181
    82 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     82%ifdef EXCLUDE_FROM_XUB
    8383    %ifndef MODULE_BOOT_MENU
    8484        %define EXCLUDE
     
    164164;       Nothing
    165165;--------------------------------------------------------------------
    166 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     166%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    167167ALIGN JUMP_ALIGN
    168168TimerTicks_GetElapsedToAXandResetDSBX:
     
    184184;       Nothing
    185185;--------------------------------------------------------------------
    186 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     186%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    187187ALIGN JUMP_ALIGN
    188188TimerTicks_GetElapsedToAXfromDSBX:
     
    202202;       Nothing
    203203;--------------------------------------------------------------------
    204 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     204%ifdef EXCLUDE_FROM_XUB
    205205    %ifndef MODULE_BOOT_MENU OR MODULE_HOTKEYS
    206206        %define EXCLUDE
  • trunk/Assembly_Library/Src/Util/Bit.asm

    r526 r592  
    2424; Bit_GetSetCountToCXfromDXAX
    2525;   Parameters
    26 ;       DX:AX:      Source DWORD
     26;       DX:AX:  Source DWORD
    2727;   Returns:
    2828;       CX:     Number of bits set in DX:AX
     
    5858    push    ax
    5959
    60     xor     cx, cx
     60    mov     cx, -1
    6161ALIGN JUMP_ALIGN
    62 .BitScanLoop:
     62.IncrementCX:
     63    inc     cx
     64.ShiftLoop:
    6365    shr     ax, 1
    64     jz      SHORT .LastBitInCF
    65     adc     cl, ch
    66     jmp     SHORT .BitScanLoop
    67 ALIGN JUMP_ALIGN
    68 .LastBitInCF:
    69     adc     cl, ch
     66    jc      SHORT .IncrementCX
     67    jnz     SHORT .ShiftLoop
    7068
    7169    pop     ax
     
    9593    ret
    9694
     95
    9796;--------------------------------------------------------------------
    9897; Bit_SetToAXfromIndexInCL
     
    115114    pop     dx
    116115    ret
     116
  • trunk/Assembly_Library/Src/Util/Math.asm

    r589 r592  
    3333;       AX
    3434;--------------------------------------------------------------------
    35 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
     35%ifndef EXCLUDE_FROM_XTIDECFG
    3636ALIGN JUMP_ALIGN
    3737Math_DivQWatSSBPbyCX:
    38 %if 1
    39     xor     dx, dx
    40     mov     ax, [bp+6]      ; Load highest divident WORD to DX:AX
    41     div     cx
    42     mov     [bp+6], ax      ; Store quotient
    43 
    44     mov     ax, [bp+4]
    45     div     cx
    46     mov     [bp+4], ax
    47 
    48     mov     ax, [bp+2]
    49     div     cx
    50     mov     [bp+2], ax
    51 
    52     mov     ax, [bp]
    53     div     cx
    54     mov     [bp], ax
    55     ret
    56 %else ; ~1
    57 ; This is about half the size compared to the above code but it's not tested which is why it's commented away.
    5838    push    di
    5939    mov     di, 6
     
    6545    dec     di
    6646    dec     di
    67     jns     .Next
     47    jns     SHORT .Next
    6848    pop     di
    6949    ret
    70 %endif ; 1
    7150%endif
    7251
     
    8362;       Nothing
    8463;--------------------------------------------------------------------
    85 %ifndef EXCLUDE_FROM_XTIDECFG
     64%ifndef EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS
    8665ALIGN JUMP_ALIGN
    8766Math_DivDXAXbyCX:
  • trunk/Assembly_Library/Src/Util/Memory.asm

    r580 r592  
    2424; OPTIMIZE_STRING_OPERATION
    2525;   Parameters
    26 ;       %1:     Repeat instruction
    27 ;       %2:     String instruction without size (for example MOVS and not MOVSB or MOVSW)
     26;       %1:     String instruction without size (only MOVS and STOS is supported)
    2827;       CX:     Number of BYTEs to operate
    29 ;       DS:SI:  Ptr to source data
     28;       DS:SI:  Ptr to source data (for MOVS)
    3029;       ES:DI:  Ptr to destination
    3130;   Returns:
     31;       CF:     Cleared
     32;       CX:     Zero
    3233;       SI, DI: Updated by number of bytes operated
    3334;   Corrupts registers:
    3435;       Nothing
    3536;--------------------------------------------------------------------
    36 %macro OPTIMIZE_STRING_OPERATION 2
    37     push    cx
    38 
    39     shr     cx, 1           ; Operate with WORDs for performance
    40     jz  %%HandleRemainingByte
    41     %1      %2w
    42 %%HandleRemainingByte:
    43     jnc     SHORT %%OperationCompleted
    44     %2b
    45 
    46 ALIGN JUMP_ALIGN
    47 %%OperationCompleted:
    48     pop     cx
     37%macro OPTIMIZE_STRING_OPERATION 1
     38    shr     cx, 1
     39    rep     %1w
     40    eRCL_IM cx, 1
     41    rep     %1b
    4942%endmacro
    5043
     
    5750;       ES:DI:  Ptr to destination buffer
    5851;   Returns:
     52;       CF:     Cleared
    5953;       SI, DI: Updated by number of bytes copied
    6054;   Corrupts registers:
    6155;       Nothing
    6256;--------------------------------------------------------------------
    63 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     57%ifndef EXCLUDE_FROM_XUB
    6458ALIGN JUMP_ALIGN
    6559Memory_CopyCXbytesFromDSSItoESDI:
    66     OPTIMIZE_STRING_OPERATION rep, movs
     60    push    cx
     61    OPTIMIZE_STRING_OPERATION movs
     62    pop     cx
    6763    ret
    6864%endif
     
    7773;       Nothing
    7874;   Corrupts registers:
    79 ;       Nothing
     75;       CX
    8076;--------------------------------------------------------------------
    8177%ifdef INCLUDE_MENU_LIBRARY
     
    10298;       DI:     Updated by number of BYTEs stored
    10399;   Corrupts registers:
    104 ;       AX
     100;       AX, CX
    105101;--------------------------------------------------------------------
    106102ALIGN JUMP_ALIGN
     
    118114;       DI:     Updated by number of BYTEs stored
    119115;   Corrupts registers:
    120 ;       Nothing
     116;       CX
    121117;--------------------------------------------------------------------
    122 ALIGN JUMP_ALIGN
    123118Memory_StoreCXbytesFromAccumToESDI:
    124     OPTIMIZE_STRING_OPERATION rep, stos
     119    OPTIMIZE_STRING_OPERATION stos
    125120    ret
    126121
     
    135130;       AX
    136131;--------------------------------------------------------------------
    137 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     132%ifndef EXCLUDE_FROM_XUB
    138133ALIGN JUMP_ALIGN
    139134Memory_ReserveCXbytesFromStackToDSSI:
  • trunk/Assembly_Library/Src/Util/Reboot.asm

    r526 r592  
    4444    mov     al, 0FEh                ; System reset (AT+ keyboard controller)
    4545    out     64h, al                 ; Reset computer (AT+)
    46 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     46%ifndef EXCLUDE_FROM_XUB
    4747    %ifdef INCLUDE_TIME_LIBRARY
    4848        mov     ax, 10
  • trunk/Assembly_Library/Src/Util/Registers.asm

    r526 r592  
    5959%endif
    6060
    61 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     61%ifndef EXCLUDE_FROM_XUB
    6262ALIGN JUMP_ALIGN
    6363Registers_CopySSBPtoDSSI:
     
    9191;
    9292;--------------------------------------------------------------------
    93 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG
     93%ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG
    9494ALIGN JUMP_ALIGN
    9595Registers_NormalizeESSI:
    9696    mov         cx, si
    97     and         si, byte 0fh
    98     jmp         Registers_NormalizeFinish
     97    and         si, BYTE 0Fh
     98    jmp         SHORT Registers_NormalizeFinish
    9999
    100100ALIGN JUMP_ALIGN
    101101Registers_NormalizeESDI:
    102102    mov         cx, di
    103     and         di, byte 0fh
     103    and         di, BYTE 0Fh
    104104;;; fall-through
    105105
  • trunk/Assembly_Library/Src/Util/Size.asm

    r580 r592  
    7070    jae     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
    7171    add     sp, BYTE 2                  ; Clean return address from stack
    72     xchg    si, cx                      ; CX = Remainder (0...1023), SI = Magnitude
    7372
    7473    ; Convert remainder to tenths
    75     xchg    bx, ax                      ; Store AX
    76     mov     al, 5                       ; AH = 0
    77     mul     cx                          ; DX:AX = remainder * (10 / 2)
    78 %ifdef USE_186
    79     shr     ax, 9                       ; Divide AX by (1024 / 2)
    80 %else
    81     shr     ax, 1
    82     mov     al, ah
    83     cbw
    84 %endif
    85     xchg    cx, ax                      ; CX = tenths
    86     xchg    ax, bx
     74    mov     bx, 640
     75    xchg    bx, ax                      ; BX = Size, AX = (10 / 1024) * 65536
     76    mul     si                          ; DX = Remainder * (10 / 1024)
     77    xchg    dx, ax
     78    xchg    cx, ax                      ; CX = Tenths, AX = Magnitude
     79    xchg    bx, ax                      ; AX = Size, BX = Magnitude
    8780
    8881    ; Convert magnitude to character
    89     mov     dl, [cs:si+.rgbMagnitudeToChar]
     82    mov     dl, [cs:bx+.rgbMagnitudeToChar]
    9083
    9184    pop     si
     
    154147;       Nothing
    155148;--------------------------------------------------------------------
    156 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     149%ifdef EXCLUDE_FROM_XUB
    157150    %ifdef USE_386
    158151        %define EXCLUDE
  • trunk/Assembly_Library/Src/Util/Sort.asm

    r526 r592  
    6363    push    cx
    6464
     65%ifdef CLD_NEEDED
    6566    cld
     67%endif
    6668    mov     cx, di                      ; Restore item size to CX
    6769    xor     ax, ax                      ; Zero starting index
     
    191193
    192194    cmp     ax, dx  ; If (left <= right)
    193     jg      SHORT ArrangeItemsInRangeAXtoDXtoBothSidesOfPivotInESDI
     195    jg      SHORT .BreakLoopSinceAllItemsExamined
    194196    call    SwapItemsFromIndexesAXandDX
    195197    inc     ax
Note: See TracChangeset for help on using the changeset viewer.