Changeset 202 in xtideuniversalbios


Ignore:
Timestamp:
Nov 22, 2011, 2:08:32 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Library/BIOS: Minor optimizations to DisplayFormatCompressed.asm and BootMenuEvent.asm
  • XTIDECFG: Trimmed trailing CRLFs from some of the text files in Help (also fixed a typo)
Location:
trunk
Files:
5 edited

Legend:

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

    r195 r202  
    11; Project name  :   Assembly Library
    22; Description   :   Functions for displaying formatted strings.
    3 ;                   ** Compressed Strings edition **
    4 ;
    5 ; Authors       :   Greg Lindhorst
    6 ;               :   gregli@hotmail.com
    7 ;               :       
    8 ;               :   Tomi Tilli
    9 ;               :   aitotat@gmail.com
    10 ;               :
    11 ; Description   :   This is a plug replacement for DisplayFormat.asm,
    12 ;                   working instead with precompiled and slightly compressed strings.
     3;                   ** Compressed Strings edition **
     4;                   This is a plug replacement for DisplayFormat.asm,
     5;                   working instead with precompiled and slightly compressed strings.
    136;
    147; Strings are compressed in a simple manner:
    158;   1. The two most common characters, space and null, are removed
    16 ;   2. Format specifiers are reduced to a single byte, including length information
     9;   2. Format specifiers are reduced to a single byte, including length information
    1710;
    1811; Format of bytes in the string are:
    1912;     01 xxxxxx     Character in x plus StringsCompressed_NormalBase
    2013;     10 xxxxxx     Character in x plus StringsCompressed_NormalBase, followed by a null (last character)
    21 ;     11 xxxxxx     Character in x plus StringsCompressed_NormalBase, followed by a space       
     14;     11 xxxxxx     Character in x plus StringsCompressed_NormalBase, followed by a space
    2215;     00 1 yyyyy    Character/Format in lookup table StringsCopmressed_TranslatesAndFormats
    2316;     00 0 yyyyy    Character/Format in lookup table StringsCompressed_TranslatesAndFormats, followed by a null
     
    3124;
    3225; The assignments of the first two bits above is not by accident.  The translates/format branch is 00
    33 ; which is easy to test for.  The '01' for "normal" (no null or space) and '001' for translates/format "normal" 
     26; which is easy to test for.  The '01' for "normal" (no null or space) and '001' for translates/format "normal"
    3427; match, allowing the translates/format codes to be shifted left by 1 and then tested with the same instructions.
    3528;
    36 ; It is always possible to say that a null character follows the current character - thus there is 
     29; It is always possible to say that a null character follows the current character - thus there is
    3730; no way (nor need) to specify a zero character.
    3831;
     
    4134; much "preload", just in case a branch is taken, but that is cheaper (in size) than adding additional branches.
    4235;
    43        
     36
    4437; Section containing code
    4538SECTION .text
     
    4942;
    5043; Names of format handlers are DisplayFormatCompressed_Format_* where * is
    51 ; replaced with the format code after the '%' in the original string, 
     44; replaced with the format code after the '%' in the original string,
    5245; with '-' replaced with '_'.
    5346;
     
    8780    jz      DisplayFormat_ParseCharacters
    8881    ; fall through
    89        
     82
    9083DisplayFormatCompressed_Format_2_u:
    9184    mov     bh,2                        ; only two characters (instead of the default 5)
    9285    ; fall through
    93        
     86
    9487DisplayFormatCompressed_Format_u:
    9588DisplayFormatCompressed_Format_5_u:
     
    10194    div     si                          ; DX:AX / 10 => AX=quot, DX=rem
    10295    push    dx                          ; Push digit
    103        
    104     dec     bh                         
     96
     97    dec     bh
    10598    jnz     .DivLoop
    10699
     
    114107                                                ; if it is zero, DisplayPrint_CharacterFromAL will not emit
    115108
    116     or      bh, al                      ; skip leading zeros, bh keeps track if we have emitted anythng non-zero
     109    or      bh, al                      ; skip leading zeros, bh keeps track if we have emitted anything non-zero
    117110    jnz     .PrintDigit                 ; note that bh starts at zero, from the loop above
    118111
    119     test    ch,2                        ; are we padding with leading spaces? 
     112    test    ch,2                        ; are we padding with leading spaces?
    120113    jnz     .PrintLoop                  ; test the even/odd of the format byte in the string
    121114
    122     mov     al,' '-'0'                  ; emit space, but let the following instuctions add '0'
    123 
    124 .PrintDigit:   
    125     add     al,'0'                      ; Digit to character
    126     cmp     al,'9'                      ; for hex output, greater than '9'?
    127     jle     .NoHexAdjustment
    128     add     al,'A'-'9'-1                ; adjust for hex output ('A' to 'F')
    129 .NoHexAdjustment:       
     115    mov     al, 89h                     ; emit space
     116
     117.PrintDigit:
     118    add     al, 90h                     ; Convert binary digit in AL to ASCII hex digit (0 - 9 or A - F)
     119    daa
     120    adc     al, 40h
     121    daa
    130122
    131123    call    DisplayPrint_CharacterFromAL
     
    133125    jmp     .PrintLoop
    134126
    135        
     127
    136128;--------------------------------------------------------------------
    137129; DisplayFormat_ParseCharacters
     
    146138;   Corrupts registers:
    147139;       AX, BX, CX, DX, BP
    148 ;--------------------------------------------------------------------       
     140;--------------------------------------------------------------------
    149141
    150142DisplayFormatCompressed_BaseFormatOffset:
    151        
     143
    152144DisplayFormat_ParseCharacters_FromAX:
    153145    mov     si,ax
    154146    ; fall through to DisplayFormat_ParseCharacters
    155147
    156 ALIGN JUMP_ALIGN       
    157 DisplayFormat_ParseCharacters: 
    158 ;
    159 ; This routine is used to outptu all strings from the ROM.  The strings in ROMVARS are not compressed,
     148ALIGN JUMP_ALIGN
     149DisplayFormat_ParseCharacters:
     150;
     151; This routine is used to output all strings from the ROM.  The strings in ROMVARS are not compressed,
    160152; and must be handled differently.
    161153;
     
    165157
    166158.decode:
    167     mov     al,[cs:si]          ; load next byte of the string
    168     inc     si
     159    eSEG    cs
     160    lodsb                       ; load next byte of the string
    169161
    170162    mov     ch,al               ; save a copy for later processing of high order bits
     
    175167    and     al,03fh                             ; "Normal" character, mask off high order bits
    176168    add     al,StringsCompressed_NormalBase     ; and add character offset (usually around 0x40)
    177        
     169
    178170.output:
    179     call    DisplayPrint_CharacterFromAL       
     171    call    DisplayPrint_CharacterFromAL
    180172
    181173.process_after_output:
     
    189181
    190182ALIGN JUMP_ALIGN
    191 DisplayFormatCompressed_TranslatesAndFormats:       
     183DisplayFormatCompressed_TranslatesAndFormats:
    192184;
    193185; This routine is here (above DisplayFormat_ParseCharacters) to reduce the amount of code between
     
    201193
    202194    cmp     al,StringsCompressed_FormatsBegin           ; determine if this is a translation or a format
    203                                                        
     195
    204196    mov     al,[cs:bx]                                  ; fetch translation/formats byte
    205197
     
    208200                                                        ; note that the flags for this conditional jump were
    209201                                                        ; set with the cmp al,StringsCompressed_FormatsBegin
    210        
     202
    211203    mov     dx,DisplayFormatCompressed_BaseFormatOffset   ; calculate address to jump to for format handler
    212204    sub     dx,ax
     
    231223    jmp     DisplayFormat_ParseCharacters.process_after_output  ; continue postprocessing, check for end of string
    232224
    233 
    234 
    235 
    236 
    237 
    238        
    239 
    240        
    241    
    242 
    243 
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm

    r194 r202  
    1818ALIGN JUMP_ALIGN
    1919BootMenuEvent_Handler:
    20        
     20
    2121%ifdef MENUEVENT_INLINE_OFFSETS
    22        
     22
    2323    add     bx, BootMenuEvent_Handler
    2424    jmp     bx
     
    3232MENUEVENT_RefreshInformation equ (BootMenuEvent_Handler.RefreshInformation - BootMenuEvent_Handler)
    3333MENUEVENT_RefreshItemFromCX equ (BootMenuEvent_Handler.RefreshItemFromCX - BootMenuEvent_Handler)
    34 ; 
    35 ; Note that there is no entry for MENUEVENT_IdleProcessing.  If MENUEVENT_IDLEPROCESSING_ENABLE is not %defined, 
     34;
     35; Note that there is no entry for MENUEVENT_IdleProcessing.  If MENUEVENT_IDLEPROCESSING_ENABLE is not %defined,
    3636; then the entry point will not be called (saving memory on this end and at the CALL point).
    3737;
    38        
     38
    3939%else
    40        
     40
    4141    cmp     bx, BYTE MENUEVENT.RefreshItemFromCX    ; Above last supported item?
    4242    ja      SHORT .EventNotHandled
     
    4646    clc
    4747    ret
    48        
     48
    4949ALIGN WORD_ALIGN
    5050.rgfnEventSpecificHandlers:
     
    5858    dw      .RefreshInformation         ; MENUEVENT.RefreshInformation
    5959    dw      .RefreshItemFromCX          ; MENUEVENT.RefreshItemFromCX
    60        
     60
    6161%endif
    6262
     
    153153ALIGN JUMP_ALIGN
    154154.RefreshItemFromCX:
    155     mov     bl,00h      ; will result in SF being clear in .RefreshItemOrInformation...
     155    xor     bl, bl      ; will result in SF being clear in .RefreshItemOrInformation...
    156156    SKIP2B  dx          ; dx corrupted below by BootMenu_GetDriveToDXforMenuitemInCX
    157157    ; Fall to .RefreshInformation
    158        
     158
    159159; Parameters:
    160160;   CX:         Index of highlighted item
     
    183183    jc      SHORT BootMenuPrint_HardDiskMenuitem
    184184    ; fall through to BootMenuEvent_FallThroughToFloppyMenuitem
    185        
    186 ;;; 
     185
     186;;;
    187187;;; Fall-through (to BootMenuPrint_FloppyMenuitem)
    188188;;; (checked at assembler time with the code after BootMenuPrint_FloppyMenuitem)
    189189;;;
    190190ALIGN JUMP_ALIGN
    191 BootMenuEvent_FallThroughToFloppyMenuitem: 
     191BootMenuEvent_FallThroughToFloppyMenuitem:
    192192    ; fall through to BootMenuPrint_FloppyMenuitem
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/Bootmenu_SerialDetect.txt

    r200 r202  
    11Set to Yes, at the end of normal drive detection, COM ports 1-7 (in reverse order) will be scanned for a connection to a serial drive server. This option provides flexibility with the COM port and baud rate to be used, it need not be configured ahead of time, but at the expense of a slower boot process. Even when this option is set to No, this functionality can still be invoked by holding down the ALT key at the end of normal drive detection. Note that if any serial drives are detected during the normal drive detection, no scan will take place (to avoid finding the same drive twice).
    2 
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialBaud.txt

    r199 r202  
    11Supported baud rates are 2400, 9600, 38.4K, and 115.2K. The server must also be set to this same speed. Older UARTs may only support 2400 and 9600 baud, but sometimes can be pushed to 38.4K. 115.2K will likely only be possible with a newer UART that inclues a FIFO. Some high speed serial ports include UART clock multipliers, allowing for speeds at 230.4K (2x multiplier) and 460.8K (4x multiplier). These high speeds are supported by these BIOS, even on original 4.77MHz 8088 systems. Note that UART clock multipliers are not detectable by the software and 115.2K will still be used during configuration for high speeds; but if a multiplier is used, the actual speed (including the multiplier) will need to be used on the server.
    2 
    3 
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Help/IDE_SerialPort.txt

    r199 r202  
    1 Select a serial port by I/O address. Supported values are between 240h and 438h, and must be on an 8-byte boundary. If the entered value corresponds to one fo the established COM port numbers, then the selection of serial port will use COM numbers instead.
     1Select a serial port by I/O address. Supported values are between 240h and 438h, and must be on an 8-byte boundary. If the entered value corresponds to one of the established COM port numbers, then the selection of serial port will use COM numbers instead.
Note: See TracChangeset for help on using the changeset viewer.