VirtualBox

Changeset 75248 in vbox


Ignore:
Timestamp:
Nov 5, 2018 10:35:20 AM (6 years ago)
Author:
vboxsync
Message:

BIOS: Fast path for 32-bit division when divisor is in fact only 16-bit.

File:
1 edited

Legend:

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

    r69120 r75248  
    7272                .8086
    7373else
     74                ;
     75                ; If the divisor is only 16-bit, use a fast path
     76                ;
     77                test    cx, cx
     78                jnz     do_it_the_hard_way
     79               
     80                div     bx              ; dx:ax / bx -> ax=quotient, dx=remainder
    7481
     82                mov     bx, dx          ; remainder in cx:bx, and we know cx=0
     83
     84                xor     dx, dx          ; quotient in dx:ax, dx must be zero
     85
     86                popf
     87                ret
     88
     89do_it_the_hard_way:
    7590                ; Call C function do this.
    7691                push    ds
Note: See TracChangeset for help on using the changeset viewer.

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