Changeset 141 in xtideuniversalbios for trunk/Assembly_Library/Src


Ignore:
Timestamp:
Mar 14, 2011, 3:49:50 PM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to Assembly Library:

  • Some inlining in Size.asm.
  • File Dialog can now enter in subdirectories starting with number.
Location:
trunk/Assembly_Library/Src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r106 r141  
    498498    call    Char_IsUpperCaseLetterInAL
    499499    jc      SHORT .ParseAndChangeToSubdirInDSSI
     500    call    Char_IsDecimalDigitInAL
     501    jc      SHORT .ParseAndChangeToSubdirInDSSI ; Assume subdir and check for errors
    500502    ; Fall to .ParseAndSelectFileFromDSSI
    501503
     
    550552.ChangeDirectoryToDSSI:
    551553    call    Directory_ChangeToPathFromDSSI
     554    jc      SHORT .ParseAndSelectFileFromDSSI   ; Must have been a file starting with number
    552555    ; Fall to RefreshFilesToDisplay
    553556
  • trunk/Assembly_Library/Src/Util/Size.asm

    r85 r141  
    4343    cmp     ax, 10000               ; 5 digits needed?
    4444    jae     SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX
     45    add     sp, BYTE 2              ; Clean return address from stack
     46    xchg    si, cx                  ; CX = Remainder (0...1023), SI = Magnitude
    4547
    46     add     sp, BYTE 2              ; Clean return address from stack
    47     call    Size_ConvertMagnitudeRemainderInSItoTenths
    48     call    Size_GetMagnitudeCharacterToDLfromMagnitudeInCX
    49     mov     cx, si
     48    ; Convert remainder to tenths
     49    xchg    bx, ax                  ; Store AX
     50    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    xchg    ax, bx
     55
     56    ; Convert magnitude to character
     57    mov     dl, [cs:si+.rgbMagnitudeToChar]
    5058
    5159    pop     si
    5260    ret
     61.rgbMagnitudeToChar:    db  " kMGTP"
     62
    5363
    5464;--------------------------------------------------------------------
     
    98108    rcr     ax, 1                   ; ...kiB
    99109    ret
    100 
    101 
    102 ;--------------------------------------------------------------------
    103 ; Size_ConvertMagnitudeRemainderInSItoTenths
    104 ;   Parameters:
    105 ;       SI:         Remainder from last magnitude division (0...1023)
    106 ;   Returns:
    107 ;       SI:         Tenths
    108 ;   Corrupts registers:
    109 ;       DX
    110 ;--------------------------------------------------------------------
    111 ALIGN JUMP_ALIGN
    112 Size_ConvertMagnitudeRemainderInSItoTenths:
    113     push    ax
    114 
    115     mov     ax, 10
    116     mul     si                  ; DX:AX = remainder * 10
    117     eSHR_IM ax, 10              ; Divide AX by 1024
    118     xchg    si, ax              ; SI = tenths
    119 
    120     pop     ax
    121     ret
    122 
    123 
    124 ;--------------------------------------------------------------------
    125 ; Size_GetMagnitudeCharacterToDLfromMagnitudeInCX
    126 ;   Parameters:
    127 ;       CX:     Magnitude in BYTE_MULTIPLES
    128 ;   Returns:
    129 ;       DL:     Magnitude character
    130 ;   Corrupts registers:
    131 ;       BX
    132 ;--------------------------------------------------------------------
    133 ALIGN JUMP_ALIGN
    134 Size_GetMagnitudeCharacterToDLfromMagnitudeInCX:
    135     mov     bx, cx
    136     mov     dl, [cs:bx+.rgbMagnitudeToChar]
    137     ret
    138 ALIGN WORD_ALIGN
    139 .rgbMagnitudeToChar:    db  " kMGTP"
Note: See TracChangeset for help on using the changeset viewer.