Changeset 142 in xtideuniversalbios


Ignore:
Timestamp:
Mar 14, 2011, 5:17:47 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX now returns right value on 8086/8088 build.
  • Debug macros again work on XTIDE Universal BIOS.
Location:
trunk/Assembly_Library
Files:
2 edited

Legend:

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

    r45 r142  
    1 ; File name     :   Debug.inc
    21; Project name  :   Assembly Library
    3 ; Created date  :   8.8.2010
    4 ; Last update   :   29.9.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Debugging macros.
    73%ifndef DEBUG_INC
     
    2824    mov     bx, %2
    2925    CALL_DISPLAY_LIBRARY PrintWordFromAXwithBaseInBX
     26%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    3027    call    Keyboard_RemoveAllKeystrokesFromBuffer
     28%endif
    3129    call    Keyboard_GetKeystrokeToAXandWaitIfNecessary
    3230
     
    5452    mov     al, %1
    5553    CALL_DISPLAY_LIBRARY PrintCharacterFromAL
     54%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    5655    call    Keyboard_RemoveAllKeystrokesFromBuffer
     56%endif
    5757    call    Keyboard_GetKeystrokeToAXandWaitIfNecessary
    5858
     
    9595%macro WAIT_ANY_KEY_TO_CONTINUE 0
    9696    push    ax
     97%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    9798    call    Keyboard_RemoveAllKeystrokesFromBuffer
     99%endif
    98100    call    Keyboard_GetKeystrokeToAXandWaitIfNecessary
    99101    pop     ax
     
    101103
    102104
    103 
    104105%endif ; DEBUG_INC
  • trunk/Assembly_Library/Src/Util/Size.asm

    r141 r142  
    3232ALIGN JUMP_ALIGN
    3333Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX:
     34%ifndef USE_186     ; If 8086/8088
     35    push    di
     36%endif
    3437    push    si
    3538
    3639ALIGN JUMP_ALIGN
    3740.MagnitudeConversionLoop:
    38     ePUSH_T si, .MagnitudeConversionLoop
    39     test    bx, bx                  ; Bits 32...47 in use?
     41    ePUSH_T di, .MagnitudeConversionLoop; DI corrupted only on 8086/8088 build
     42    test    bx, bx                      ; Bits 32...47 in use?
    4043    jnz     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
    41     test    dx, dx                  ; Bits 16...31 in use?
     44    test    dx, dx                      ; Bits 16...31 in use?
    4245    jnz     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
    43     cmp     ax, 10000               ; 5 digits needed?
     46    cmp     ax, 10000                   ; 5 digits needed?
    4447    jae     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
    45     add     sp, BYTE 2              ; Clean return address from stack
    46     xchg    si, cx                  ; CX = Remainder (0...1023), SI = Magnitude
     48    add     sp, BYTE 2                  ; Clean return address from stack
     49    xchg    si, cx                      ; CX = Remainder (0...1023), SI = Magnitude
    4750
    4851    ; Convert remainder to tenths
    49     xchg    bx, ax                  ; Store AX
     52    xchg    bx, ax                      ; Store AX
    5053    mov     ax, 10
    51     mul     cx                      ; DX:AX = remainder * 10
    52     eSHR_IM ax, 10                  ; Divide AX by 1024
    53     xchg    cx, ax                  ; CX = tenths
     54    mul     cx                          ; DX:AX = remainder * 10
     55    eSHR_IM ax, 10                      ; Divide AX by 1024
     56    xchg    cx, ax                      ; CX = tenths
    5457    xchg    ax, bx
    5558
     
    5861
    5962    pop     si
     63%ifndef USE_186
     64    pop     di
     65%endif
    6066    ret
    6167.rgbMagnitudeToChar:    db  " kMGTP"
Note: See TracChangeset for help on using the changeset viewer.