Changeset 223 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Jan 25, 2012, 8:20:06 PM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Fixed what appears to be a mistake in EBIOS.inc
  • Added a 'release' option to the makefile of the Serial Server (invokes UPX)
  • Some very minor optimizations
  • Removed the eSEG macro and did some other cleanups (fixed typos etc)
Location:
trunk/Assembly_Library
Files:
7 edited

Legend:

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

    r181 r223  
    370370
    371371;--------------------------------------------------------------------
    372 ; Segment override prefix instruction.
    373 ;
    374 ; eSEG
    375 ;   Parameters:
    376 ;       %1:     Name of the segment (ES, CS, SS, DS, FS or GS)
    377 ;   Returns:
    378 ;       Nothing
    379 ;   Corrupts registers:
    380 ;       Nothing
    381 ;--------------------------------------------------------------------
    382 %macro eSEG 1
    383     %ifidni %1, es
    384         db  00100110b
    385     %elifidni %1, cs
    386         db  00101110b
    387     %elifidni %1, ss
    388         db  00110110b
    389     %elifidni %1, ds
    390         db  00111110b
    391     %elifidni %1, fs
    392         db  01100100b
    393     %elifidni %1, gs
    394         db  01100101b
    395     %else
    396         %error "Invalid segment override passed to eSEG!"
    397     %endif
    398 %endmacro
    399 
    400 
    401 ;--------------------------------------------------------------------
    402372; Repeats string instruction with segment override.
    403373; This macro prevents 8088/8086 restart bug.
     
    416386%macro eSEG_STR 3
    417387%ifndef USE_186 ; 8088/8086 has string instruction restart bug when more than one prefix
    418      %%Loop:
    419         %1                      ; REP is the prefix that can be lost
    420         eSEG    %2              ; SEG is the prefix that won't be lost
    421         %3                      ; String instruction
    422         jcxz    %%End           ; Jump to end if no repeats left (preserves FLAGS)
    423         jmp     SHORT %%Loop    ; Loop while repeats left
    424      %%End:
     388    %%Loop:
     389        %1                      ; REP is the prefix that can be lost
     390        %2                      ; SEG is the prefix that won't be lost
     391        %3                      ; String instruction
     392        jcxz    %%End           ; Jump to end if no repeats left (preserves FLAGS)
     393        jmp     SHORT %%Loop    ; Loop while repeats left
     394    %%End:
    425395%else   ; No bug on V20/V30 and later, don't know about 188/186
    426     eSEG    %2
    427     %1      %3
     396    %2
     397    %1 %3
    428398%endif
    429399%endmacro
  • trunk/Assembly_Library/Src/Display/CgaSnow.asm

    r162 r223  
    9999    cli             ; Interrupt request would mess up timing
    100100    WAIT_UNTIL_SAFE_CGA_WRITE
    101     eSEG    es
    102     movsb
     101    es movsb
    103102    sti
    104103    loop    .MovsbNextByte
  • trunk/Assembly_Library/Src/Display/DisplayFormat.asm

    r184 r223  
    9292ALIGN JUMP_ALIGN
    9393ReadCharacterAndTestForNull:
    94     eSEG    cs
    95     lodsb                                   ; Load from CS:SI to AL
     94    cs lodsb                                ; Load from CS:SI to AL
    9695    test    al, al                          ; NULL to end string?
    9796    ret
     
    321320%endif
    322321
    323 ALIGN JUMP_ALIGN       
     322ALIGN JUMP_ALIGN
    324323u_FormatUnsignedDecimalWord:
    325324    mov     ax, [bp]
     
    339338    mov     ax, [bp]
    340339    test    ax,ax
    341     jnz     u_FormatUnsignedDecimalWord     
     340    jnz     u_FormatUnsignedDecimalWord
    342341    mov     [bp], word g_szDashForZero
    343342;;; fall-through
    344        
     343
    345344ALIGN JUMP_ALIGN
    346345s_FormatStringFromSegmentCS:
  • trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm

    r202 r223  
    157157
    158158.decode:
    159     eSEG    cs
    160     lodsb                       ; load next byte of the string
     159    cs lodsb                    ; load next byte of the string
    161160
    162161    mov     ch,al               ; save a copy for later processing of high order bits
  • trunk/Assembly_Library/Src/Display/DisplayPrint.asm

    r194 r223  
    55SECTION .text
    66
    7                
     7
    88;--------------------------------------------------------------------
    99; Supports following formatting types:
     
    104104;       AX, DX
    105105;--------------------------------------------------------------------
    106        
     106
    107107%ifndef MODULE_STRINGS_COMPRESSED
    108        
     108
    109109ALIGN JUMP_ALIGN
    110110DisplayPrint_WordFromAXWithBaseInBX:
     
    126126.PrintNextDigit:
    127127    pop     ax                  ; Pop digit
    128     eSEG    cs
    129     xlatb
     128    cs xlatb
    130129    call    DisplayPrint_CharacterFromAL
    131130    loop    .PrintNextDigit
     
    152151;--------------------------------------------------------------------
    153152%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    154        
    155153ALIGN JUMP_ALIGN
    156154DisplayPrint_CharacterBufferFromBXSIwithLengthInCX:
     
    167165    loop    .PrintNextCharacter
    168166
    169     ;mov        ds, cx  ; Restore DS to BDA. Not needed unless DisplayPrint_CharacterFromAL changes DS.
    170167    pop     cx
    171168    pop     si
     
    173170    ret
    174171%endif
    175 
    176 
    177172
    178173
     
    278273    pop     cx
    279274.NothingToRepeat:
    280 
    281     ret
     275    ret
     276
    282277
    283278;--------------------------------------------------------------------
     
    292287;       AX, DX
    293288;--------------------------------------------------------------------
    294 
    295289%ifndef MODULE_STRINGS_COMPRESSED
    296290;;;
    297291;;; Take care when using this routine with compressed strings (which is why it is disabled).
    298292;;; All strings in CSSI should go through the DisplayFormatCompressed code to be decoded.
    299 ;;; 
     293;;;
    300294ALIGN JUMP_ALIGN
    301295DisplayPrint_NullTerminatedStringFromCSSI:
     
    304298    call    DisplayPrint_NullTerminatedStringFromBXSI
    305299    pop     bx
    306 
    307     ret
    308 %endif
    309 
    310        
     300    ret
     301%endif
    311302
    312303
     
    314305;;; Note that the following routines need to be at the bottom of this file
    315306;;; to accomodate short jumps from the next file (DisplayFormat/DisplayFormatCompressed)
    316 ;;; 
     307;;;
    317308
    318309;--------------------------------------------------------------------
     
    329320ALIGN JUMP_ALIGN
    330321DisplayPrint_Newline_FormatAdjustBP:
    331     inc     bp                  ; we didn't need a parameter after all, readjust BP 
     322    inc     bp                  ; we didn't need a parameter after all, readjust BP
    332323    inc     bp
    333324    ; fall through to DisplayPrint_Newline
     
    335326
    336327ALIGN JUMP_ALIGN
    337        
    338328DisplayPrint_Newline:
    339329    mov     al, LF
     
    364354
    365355
    366        
    367356;--------------------------------------------------------------------
    368357; DisplayPrint_NullTerminatedStringFromBXSI
     
    396385    pop     cx
    397386    pop     si
    398        
    399 DisplayPrint_Ret:               ; random ret to jump to                 
    400     ret
    401 
    402 
     387
     388DisplayPrint_Ret:               ; random ret to jump to
     389    ret
     390
  • trunk/Assembly_Library/Src/Menu/MenuAttributes.asm

    r116 r223  
    6868    add     si, .rgcColorAttributes
    6969.LoadAttributeAndReturn:
    70     eSEG    cs
    71     lodsb                               ; Load from [CS:SI] to AL
     70    cs lodsb                            ; Load from [CS:SI] to AL
    7271
    7372    pop     ds
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r194 r223  
    2222;       AX, BX, CX, DX, SI, DI
    2323;--------------------------------------------------------------------
    24 ALIGN JUMP_ALIGN   
     24ALIGN JUMP_ALIGN
    2525MenuBorders_RefreshAll:
     26%ifndef USE_186
    2627    call    MenuBorders_AdjustDisplayContextForDrawingBorders
    2728    call    MenuBorders_GetNumberOfMiddleCharactersToDX
     
    3132    call    DrawBottomBorderLine
    3233    jmp     DrawBottomShadowLine
     34%else
     35    push    DrawBottomShadowLine
     36    push    DrawBottomBorderLine
     37    push    RefreshInformationBorders
     38    push    RefreshItemBorders
     39    push    RefreshTitleBorders
     40    push    MenuBorders_GetNumberOfMiddleCharactersToDX
     41    jmp     MenuBorders_AdjustDisplayContextForDrawingBorders
     42%endif
    3343
    3444
     
    7181%endif
    7282
    73        
     83
    7484;--------------------------------------------------------------------
    7585; MenuBorders_AdjustDisplayContextForDrawingBorders
     
    315325ALIGN JUMP_ALIGN
    316326PrintBorderCharactersFromCSSI:
    317     eSEG    cs
    318     lodsb           ; Load from [cs:si+BORDER_CHARS.cLeft] to AL
     327    cs lodsb        ; Load from [cs:si+BORDER_CHARS.cLeft] to AL
    319328    call    MenuBorders_PrintSingleBorderCharacterFromAL
    320329
    321     eSEG    cs
    322     lodsb           ; Load from [cs:si+BORDER_CHARS.cMiddle] to AL
     330    cs lodsb        ; Load from [cs:si+BORDER_CHARS.cMiddle] to AL
    323331    call    MenuBorders_PrintMultipleBorderCharactersFromAL
    324332
    325     eSEG    cs
    326     lodsb           ; Load from [cs:si+BORDER_CHARS.cRight] to AL
     333    cs lodsb        ; Load from [cs:si+BORDER_CHARS.cRight] to AL
    327334    ; Fall to MenuBorders_PrintSingleBorderCharacterFromAL
    328335
Note: See TracChangeset for help on using the changeset viewer.