Changeset 105 in xtideuniversalbios for trunk/Assembly_Library/Src/Util


Ignore:
Timestamp:
Feb 17, 2011, 2:52:42 PM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to Assembly Library:

  • More optimizations to reduce size.
  • Removed some utility functions to reduce size.
Location:
trunk/Assembly_Library/Src/Util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Util/Memory.asm

    r103 r105  
    6666    push    di
    6767    push    ax
    68     Registers_CopySSBPtoESDI
     68    call    Registers_CopySSBPtoESDI
    6969    call    Memory_ZeroESDIwithSizeInCX
    7070    pop     ax
  • trunk/Assembly_Library/Src/Util/Registers.asm

    r103 r105  
    11; Project name  :   Assembly Library
    22; Description   :   Functions for register operations.
    3 
    4 ;--------------------------------------------------------------------
    5 ; NORMALIZE_FAR_POINTER
    6 ;   Parameters:
    7 ;       %1:%2:      Far pointer to normalize
    8 ;       %3:         Scratch register
    9 ;       %4:         Scratch register
    10 ;   Returns:
    11 ;       %1:%2:      Normalized far pointer
    12 ;   Corrupts registers:
    13 ;       %3, %4
    14 ;--------------------------------------------------------------------
    15 %macro NORMALIZE_FAR_POINTER 4
    16     mov     %4, %2              ; Copy offset to scratch reg
    17     and     %2, BYTE 0Fh        ; Clear offset bits 15...4
    18     eSHR_IM %4, 4               ; Divide offset by 16
    19     mov     %3, %1              ; Copy segment to scratch reg
    20     add     %3, %4              ; Add shifted offset to segment
    21     mov     %1, %3              ; Set normalized segment
    22 %endmacro
    233
    244
    255; Section containing code
    266SECTION .text
    27 
    28 ;--------------------------------------------------------------------
    29 ; Registers_NormalizeDSSI
    30 ; Registers_NormalizeESDI
    31 ;   Parameters
    32 ;       DS:SI or ES:DI: Ptr to normalize
    33 ;   Returns:
    34 ;       DS:SI or ES:DI: Normalized pointer
    35 ;   Corrupts registers:
    36 ;       Nothing
    37 ;--------------------------------------------------------------------
    38 ALIGN JUMP_ALIGN
    39 Registers_NormalizeDSSI:
    40     push    dx
    41     push    ax
    42     NORMALIZE_FAR_POINTER ds, si, ax, dx
    43     pop     ax
    44     pop     dx
    45     ret
    46 
    47 ALIGN JUMP_ALIGN
    48 Registers_NormalizeESDI:
    49     push    dx
    50     push    ax
    51     NORMALIZE_FAR_POINTER es, di, ax, dx
    52     pop     ax
    53     pop     dx
    54     ret
    55 
    567
    578;--------------------------------------------------------------------
     
    7627;--------------------------------------------------------------------
    7728; Registers_CopySSBPtoESDI
    78 ; Registers_CopySSBPtoDSSI
    79 ; Registers_CopyDSSItoESDI
    80 ; Registers_CopyESDItoDSSI
     29; Registers_CopySSBPtoDSSI (uncommented to save bytes)
     30; Registers_CopyDSSItoESDI (uncommented to save bytes)
     31; Registers_CopyESDItoDSSI (uncommented to save bytes)
    8132;   Parameters
    8233;       Nothing
     
    8637;       Nothing
    8738;--------------------------------------------------------------------
    88 %macro Registers_CopySSBPtoESDI 0
    89     push    ss
    90     pop     es
    91     mov     di, bp
    92 %endmacro
     39ALIGN JUMP_ALIGN
     40Registers_CopySSBPtoESDI:
     41    COPY_SSBP_TO_ESDI
     42    ret
    9343
    94 %macro Registers_CopySSBPtoDSSI 0
    95     push    ss
    96     pop     ds
    97     mov     si, bp
    98 %endmacro
     44;ALIGN JUMP_ALIGN
     45;Registers_CopySSBPtoDSSI:
     46;   COPY_SSBP_TO_DSSI
     47;   ret
    9948
    100 %macro Registers_CopyDSSItoESDI 0
    101     push    ds
    102     pop     es
    103     mov     di, si
    104 %endmacro
     49;ALIGN JUMP_ALIGN
     50;Registers_CopyDSSItoESDI:
     51;   COPY_DSSI_TO_ESDI
     52;   ret
    10553
    106 %macro Registers_CopyESDItoDSSI 0
    107     push    es
    108     pop     ds
    109     mov     si, di
    110 %endmacro
     54;ALIGN JUMP_ALIGN
     55;Registers_CopyESDItoDSSI:
     56;   COPY_ESDI_to_DSSI
     57;   ret
    11158
    11259
    11360;--------------------------------------------------------------------
    114 ; Registers_SetZFifNullPointerInDSSI
     61; Registers_SetZFifNullPointerInDSSI (uncommented to save bytes)
    11562;   Parameters
    11663;       DS:SI:  Far pointer
     
    12067;       Nothing
    12168;--------------------------------------------------------------------
    122 ALIGN JUMP_ALIGN
    123 Registers_SetZFifNullPointerInDSSI:
    124     push    ax
    125     mov     ax, ds
    126     or      ax, si
    127     pop     ax
    128     ret
     69;ALIGN JUMP_ALIGN
     70;Registers_SetZFifNullPointerInDSSI:
     71;   push    ax
     72;   mov     ax, ds
     73;   or      ax, si
     74;   pop     ax
     75;   ret
Note: See TracChangeset for help on using the changeset viewer.