Ignore:
Timestamp:
Feb 19, 2015, 1:38:02 PM (9 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • XTIDECFG: Fixed a bug from r459 where the menu option for selection of default boot drive would be missing if the BIOS had been built without MODULE_HOTKEYS. The menu option is now visible if either or both of MODULE_HOTKEYS and MODULE_BOOT_MENU is available.
  • BIOS: Disabled ATA-ID validation by adding a new define (NO_ATAID_VALIDATION) and making it the default for all builds since at least two WD Caviar drive models are incompatible with it.
  • Fixed the "No Fixed Disk Present in FDISK"-bug introduced in r551 which means the Tiny build now works without including MODULE_DRIVEXLATE.
  • Fixed a bug from r528 where pressing hotkey F6 would not initiate detection of serial drives.
  • Fixed a bug from r186 in DisplayFormatCompressed.asm where the boot menu would print the IRQ in hexadecimal format when it should be in decimal format.
  • Optimizations and fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm

    r567 r580  
    8989    xor     bx, bx
    9090    xchg    si, ax
    91     jmp     short DisplayPrint_NullTerminatedStringFromBXSI
     91    jmp     SHORT DisplayPrint_NullTerminatedStringFromBXSI
    9292
    9393DisplayFormatCompressed_Format_x:
    9494DisplayFormatCompressed_Format_5_x:
    95     mov     si,16                       ; hex output, change base to 16
    96     mov     bx,(04<<8) + 'h'            ; 4 bytes, with postfix character 'h' to emit
     95    mov     si, 16                      ; hex output, change base to 16
     96    mov     bx, (04<<8) + 'h'           ; 4 bytes, with postfix character 'h' to emit
    9797                                        ; (note that the count includes the 'h')
    98     jmp     DisplayFormatCompressed_Format_u
    99 
    100 DisplayFormatCompressed_Format_2_I:
    101     mov     si,g_szDashForZero          ; preload dash string in case we jump
    102     test    ax,ax                       ; if parameter equals zero, emit dash string instead
    103     jz      DisplayFormat_ParseCharacters
    104     ; fall through
     98    SKIP2B  f                           ; Fall through to DisplayFormatCompressed_Format_u
    10599
    106100DisplayFormatCompressed_Format_2_u:
    107     mov     bh,2                        ; only two characters (instead of the default 5)
     101    mov     bh, 2                       ; only two characters (instead of the default 5)
    108102    ; fall through
    109103
     
    111105DisplayFormatCompressed_Format_5_u:
    112106    push    bx                          ; push postfix character - either a zero (default) or a 'h'
    113     mov     bl,bh                       ; preserve character count for .PrintLoop
     107    mov     bl, bh                      ; preserve character count for .PrintLoop
    114108
    115109.DivLoop:
     
    119113
    120114    dec     bh
    121     jnz     .DivLoop
     115    jnz     SHORT .DivLoop
    122116
    123117.PrintLoop:
     
    125119
    126120    dec     bl                          ; on second to last iteration, emit digit whether it is zero or not
    127     jz      .PrintDigit
    128 
    129     js      short DisplayPrint_CharacterFromAL  ; on last iteration, emit postfix character
     121    jz      SHORT .PrintDigit
     122    js      SHORT DisplayPrint_CharacterFromAL  ; on last iteration, emit postfix character
    130123                                                ; if it is zero, DisplayPrint_CharacterFromAL will not emit
    131124
    132125    or      bh, al                      ; skip leading zeros, bh keeps track if we have emitted anything non-zero
    133     jnz     .PrintDigit                 ; note that bh starts at zero, from the loop above
    134 
    135     test    ch,2                        ; are we padding with leading spaces?
    136     jnz     .PrintLoop                  ; test the even/odd of the format byte in the string
     126    jnz     SHORT .PrintDigit           ; note that bh starts at zero, from the loop above
     127
     128    test    ch, 2                       ; are we padding with leading spaces?
     129    jnz     SHORT .PrintLoop            ; test the even/odd of the format byte in the string
    137130
    138131    mov     al, 89h                     ; emit space
     
    144137
    145138    call    DisplayPrint_CharacterFromAL
    146 
    147     jmp     .PrintLoop
    148 
     139    jmp     SHORT .PrintLoop
     140
     141DisplayFormatCompressed_Format_2_I:
     142    test    ax, ax
     143    jnz     SHORT DisplayFormatCompressed_Format_2_u
     144    mov     si, g_szDashForZero         ; if parameter equals zero, emit dash string instead
     145    SKIP2B  bx                          ; Fall through to DisplayFormat_ParseCharacters
    149146
    150147;--------------------------------------------------------------------
     
    161158;       AX, BX, CX, DX, BP
    162159;--------------------------------------------------------------------
    163 
    164160DisplayFormatCompressed_BaseFormatOffset:
    165 
    166161DisplayFormat_ParseCharacters_FromAX:
    167     mov     si,ax
     162    mov     si, ax
    168163    ; fall through to DisplayFormat_ParseCharacters
    169164
     
    174169; and must be handled differently.
    175170;
    176     cmp     si,byte 07fh        ; well within the boundaries of ROMVARS_size
    177     mov     bx,cs               ; preload bx with cs in case we take the following jump
    178     jb      short DisplayPrint_NullTerminatedStringFromBXSI
     171    cmp     si, BYTE 7Fh        ; well within the boundaries of ROMVARS_size
     172    mov     bx, cs              ; preload bx with cs in case we take the following jump
     173    jb      SHORT DisplayPrint_NullTerminatedStringFromBXSI
    179174
    180175.decode:
    181176    cs lodsb                    ; load next byte of the string
    182 
    183     mov     ch,al               ; save a copy for later processing of high order bits
    184 
    185     test    al,0c0h             ; check for translation/format character
    186     jz      DisplayFormatCompressed_TranslatesAndFormats
    187 
    188     and     al,03fh                             ; "Normal" character, mask off high order bits
    189     add     al,StringsCompressed_NormalBase     ; and add character offset (usually around 0x40)
     177    mov     ch, al              ; save a copy for later processing of high order bits
     178    test    al, 0C0h            ; check for translation/format character
     179    jz      SHORT DisplayFormatCompressed_TranslatesAndFormats
     180
     181    and     al, 3Fh                             ; "Normal" character, mask off high order bits
     182    add     al, StringsCompressed_NormalBase    ; and add character offset (usually around 0x40)
    190183
    191184.output:
     
    193186
    194187.process_after_output:
    195     eSHL_IM ch,1                                ; check high order bits for end of string or space
    196     jns     short DisplayFormatCompressed_ret
    197     jnc     .decode
    198     mov     al,' '
     188    eSHL_IM ch, 1                               ; check high order bits for end of string or space
     189    jns     SHORT DisplayFormatCompressed_ret
     190    jnc     SHORT .decode
     191    mov     al, ' '
    199192    call    DisplayPrint_CharacterFromAL
    200     jmp     .decode
     193    jmp     SHORT .decode
    201194
    202195
     
    207200; DisplayFormatCompressed_BaseFormatOffset and jump targets (must fit in 256 bytes)
    208201;
    209     eSHL_IM ch,1                ; setup ch for later testing of null in .process_after_output
    210     and     ax,0001fh           ; also clears AH for addition with BX and DX below
    211 
    212     mov     bx,StringsCompressed_TranslatesAndFormats   ; calculate offset of translation/formats offset byte
    213     add     bx,ax
    214 
    215     cmp     al,StringsCompressed_FormatsBegin           ; determine if this is a translation or a format
    216 
    217     mov     al,[cs:bx]                                  ; fetch translation/formats byte
    218 
    219     jb      DisplayFormat_ParseCharacters.output        ; check if this a translation or a format
     202    eSHL_IM ch, 1               ; setup ch for later testing of null in .process_after_output
     203    and     ax, 001Fh           ; also clears AH for addition with BX and DX below
     204
     205    mov     bx, StringsCompressed_TranslatesAndFormats  ; calculate offset of translation/formats offset byte
     206    add     bx, ax
     207
     208    cmp     al, StringsCompressed_FormatsBegin          ; determine if this is a translation or a format
     209    mov     al, [cs:bx]                                 ; fetch translation/formats byte
     210    jb      SHORT DisplayFormat_ParseCharacters.output  ; check if this a translation or a format
    220211                                                        ; if it is translation, output and postprocess for eos
    221212                                                        ; note that the flags for this conditional jump were
    222213                                                        ; set with the cmp al,StringsCompressed_FormatsBegin
    223214
    224     mov     dx,DisplayFormatCompressed_BaseFormatOffset   ; calculate address to jump to for format handler
    225     sub     dx,ax
    226 
    227     mov     ax,[bp]             ; preload ax with parameter
     215    mov     dx, DisplayFormatCompressed_BaseFormatOffset    ; calculate address to jump to for format handler
     216    sub     dx, ax
     217
     218    mov     ax, [bp]            ; preload ax with parameter
    228219    dec     bp                  ; if no parameter is needed (format 'nl' for example),
    229220    dec     bp                  ; the format handler can reincrement bp
    230221
    231     mov     bx,0500h            ; preload bh with 5 decimal places for numeric output
     222    mov     bx, 0500h           ; preload bh with 5 decimal places for numeric output
    232223                                ; bl is zero, indicating not to output a 'h' (default base 10)
    233224
     
    235226    push    cx
    236227
    237     mov     si,10               ; preload si with 10 for numeric output (default base 10)
    238 
     228    mov     si, 10              ; preload si with 10 for numeric output (default base 10)
    239229    call    dx                  ; call the format routine
    240230
     
    242232    pop     si
    243233
    244     jmp     DisplayFormat_ParseCharacters.process_after_output  ; continue postprocessing, check for end of string
    245 
     234    jmp     SHORT DisplayFormat_ParseCharacters.process_after_output    ; continue postprocessing, check for end of string
Note: See TracChangeset for help on using the changeset viewer.