VirtualBox

Ignore:
Timestamp:
Nov 17, 2015 3:30:27 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104154
Message:

BIOS: Added 64-bit unsigned left/right shift.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/BiosCommonCode/support.asm

    r56292 r58723  
    2222public          __U4D
    2323public          __U4M
     24public          __U8LS
     25public          __U8RS
    2426ifndef          VBOX_PC_BIOS
    2527public          __I4D
     
    4345; @param    cx:bx   Divisor.
    4446; @returns  dx:ax   Quotient.
    45 ;           cx:bx   Reminder.
     47;           cx:bx   Remainder.
    4648;
    4749__U4D:
     
    5961                mov     cx, bx
    6062
    61                 div     ecx                 ; eax:edx / ecx -> eax=quotient, edx=reminder.
     63                div     ecx                 ; eax:edx / ecx -> eax=quotient, edx=remainder.
    6264
    6365                mov     bx, dx
     
    8486; @param    cx:bx   Divisor.
    8587; @returns  dx:ax   Quotient.
    86 ;           cx:bx   Reminder.
     88;           cx:bx   Remainder.
    8789;
    8890__I4D:
     
    100102                mov     cx, bx
    101103
    102                 idiv    ecx                 ; eax:edx / ecx -> eax=quotient, edx=reminder.
     104                idiv    ecx                 ; eax:edx / ecx -> eax=quotient, edx=remainder.
    103105
    104106                mov     bx, dx
     
    157159ifndef          VBOX_PC_BIOS
    158160;;
    159 ; 32-bit unsigned multiplication.
    160 ; memset taking a far pointer.
     161; 32-bit signed multiplication.
    161162;
    162163; @param    dx:ax   Factor 1.
     
    198199
    199200;;
     201; 64-bit left shift.
     202;
     203; @param    ax:bx:cx:dx Value.
     204; @param    si          Shift count.
     205; @returns  ax:bx:cx:dx Shifted value.
     206; si is zeroed
     207;
     208__U8LS:
     209
     210                test    si, si
     211                jz      u8ls_quit
     212u8ls_rot:
     213                shl     dx, 1
     214                rcl     cx, 1
     215                rcl     bx, 1
     216                rcl     ax, 1
     217                dec     si
     218                jnz     u8ls_rot
     219u8ls_quit:
     220                ret
     221
     222
     223;;
     224; 64-bit unsigned right shift.
     225;
     226; @param    ax:bx:cx:dx Value.
     227; @param    si          Shift count.
     228; @returns  ax:bx:cx:dx Shifted value.
     229; si is zeroed
     230;
     231__U8RS:
     232
     233                test    si, si
     234                jz      u8rs_quit
     235u8rs_rot:
     236                shr     ax, 1
     237                rcr     bx, 1
     238                rcr     cx, 1
     239                rcr     dx, 1
     240                dec     si
     241                jnz     u8rs_rot
     242u8rs_quit:
     243                ret
     244
     245
     246;;
    200247; memset taking a far pointer.
    201248;
     
    221268
    222269;;
    223 ; memset taking far pointers.
     270; memcpy taking far pointers.
    224271;
    225272; cx, es may be modified; si, di are preserved
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette