Index: /trunk/include/iprt/uint32.h
===================================================================
--- /trunk/include/iprt/uint32.h	(revision 60484)
+++ /trunk/include/iprt/uint32.h	(revision 60485)
@@ -929,6 +929,6 @@
 DECLINLINE(bool) RTUInt32BitAreAllSet(PRTUINT32U pValue)
 {
-    return pValue->s.Hi == UINT32_MAX
-        && pValue->s.Lo == UINT32_MAX;
+    return pValue->s.Hi == UINT16_MAX
+        && pValue->s.Lo == UINT16_MAX;
 }
 
Index: /trunk/include/iprt/uint64.h
===================================================================
--- /trunk/include/iprt/uint64.h	(revision 60484)
+++ /trunk/include/iprt/uint64.h	(revision 60485)
@@ -799,5 +799,5 @@
     {
         /* (left shift) */
-        cBits &= 31
+        cBits &= 31;
         if (cBits >= 32)
         {
@@ -816,5 +816,5 @@
         /* (right shift) */
         cBits = -cBits;
-        cBits &= 31
+        cBits &= 31;
         if (cBits >= 32)
         {
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk	(revision 60484)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk	(revision 60485)
@@ -165,4 +165,6 @@
 	bs3-cmn-PerCpuData.c \
 	bs3-cmn-ConvertRMStackToP16UsingCxReturnToAx.asm \
+	bs3-cmn-UInt64Div.c \
+	bs3-cmn-UInt32Div.c \
 	bs3-wc16-U8DR.asm \
 	bs3-wc16-U8DQ.asm \
@@ -175,4 +177,5 @@
 	bs3-wc16-I4D.asm \
        bs3-c16-Trap16Generic.asm
+bs3kit-common-16_bs3-cmn-UInt64Div.c_CFLAGS = -oh -d0 # -d1+ vs -d0 saves 0x6a3-0x577 = 0x12C (300)!
 
 # The 32-bit BS3Kit library.
@@ -183,4 +186,5 @@
 bs3kit-common-32_ASDEFS   = RT_ASMDEFS_INC_FIRST_FILE
 bs3kit-common-32_SOURCES  = $(VBOX_BS3KIT_COMMON_SOURCES) \
+	bs3-cmn-UInt64Div.c \
 	bs3-wc32-U8D.asm \
 	bs3-wc32-I8D.asm \
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-UInt32Div.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-UInt32Div.c	(revision 60485)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-UInt32Div.c	(revision 60485)
@@ -0,0 +1,40 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Unsigned 32-bit division (compiler support routine helper).
+ */
+
+/*
+ * Copyright (C) 2007-2016 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#include <bs3kit.h>
+#include <iprt/uint32.h>
+
+
+
+void BS3_CMN_NM(Bs3UInt32Div)(RTUINT32U uDividend, RTUINT32U uDivisor, RTUINT32U BS3_FAR *paQuotientReminder)
+{
+    RTUInt32DivRem(&paQuotientReminder[0], &paQuotientReminder[1], &uDividend, &uDivisor);
+}
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-UInt64Div.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-UInt64Div.c	(revision 60485)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-UInt64Div.c	(revision 60485)
@@ -0,0 +1,40 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Unsigned 64-bit division (compiler support routine helper).
+ */
+
+/*
+ * Copyright (C) 2007-2016 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#include <bs3kit.h>
+#include <iprt/uint64.h>
+
+
+
+void BS3_CMN_NM(Bs3UInt64Div)(RTUINT64U uDividend, RTUINT64U uDivisor, RTUINT64U BS3_FAR *paQuotientReminder)
+{
+    RTUInt64DivRem(&paQuotientReminder[0], &paQuotientReminder[1], &uDividend, &uDivisor);
+}
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U4D.asm
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U4D.asm	(revision 60484)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U4D.asm	(revision 60485)
@@ -28,4 +28,5 @@
 
 
+
 ;;
 ; 32-bit unsigned integer division.
@@ -39,4 +40,5 @@
 global $_?U4D
 $_?U4D:
+%if TMPL_BITS >= 32
         ; Move dividend into EDX:EAX
         shl     eax, 10h
@@ -59,5 +61,46 @@
         mov     edx, eax
         shr     edx, 10h
+%else
+        push    ds
+        push    es
 
+        ;
+        ; Convert to a C __cdecl call - too lazy to do this in assembly.
+        ;
+
+        ; Set up a frame of sorts, allocating 8 bytes for the result buffer.
+        push    bp
+        sub     sp, 08h
+        mov     bp, sp
+
+        ; Pointer to the return buffer.
+        push    ss
+        push    bp
+        add     bp, 08h                 ; Correct bp.
+
+        ; The divisor.
+        push    cx
+        push    bx
+
+        ; The dividend.
+        push    dx
+        push    ax
+
+        BS3_EXTERN_CMN Bs3UInt32Div
+        call    Bs3UInt32Div
+
+        ; Load the reminder.
+        mov     cx, [bp - 08h + 6]
+        mov     bx, [bp - 08h + 4]
+        ; Load the quotient.
+        mov     dx, [bp - 08h + 2]
+        mov     ax, [bp - 08h]
+
+        mov     sp, bp
+        pop     bp
+        pop     es
+        pop     ds
+
+%endif
         ret
 
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U8DQ.asm
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U8DQ.asm	(revision 60484)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U8DQ.asm	(revision 60485)
@@ -77,6 +77,8 @@
 
         ; The divisor.
-        push    dword [es:si + 4]
-        push    dword [es:si]
+        push    word [es:si + 6]
+        push    word [es:si + 4]
+        push    word [es:si + 2]
+        push    word [es:si]
 
         ; The dividend.
@@ -89,10 +91,11 @@
 
         ; Load the quotient.
-        mov     ax, [bp - 10h + 8 + 6]
-        mov     bx, [bp - 10h + 8 + 4]
-        mov     cx, [bp - 10h + 8 + 2]
-        mov     dx, [bp - 10h + 8]
+        mov     ax, [bp - 10h + 6]
+        mov     bx, [bp - 10h + 4]
+        mov     cx, [bp - 10h + 2]
+        mov     dx, [bp - 10h]
 
-        leave
+        mov     sp, bp
+        pop     bp
         pop     es
         pop     ds
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U8DR.asm
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U8DR.asm	(revision 60484)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc16-U8DR.asm	(revision 60485)
@@ -77,6 +77,8 @@
 
         ; The divisor.
-        push    dword [es:si + 4]
-        push    dword [es:si]
+        push    word [es:si + 6]
+        push    word [es:si + 4]
+        push    word [es:si + 2]
+        push    word [es:si]
 
         ; The dividend.
@@ -94,5 +96,6 @@
         mov     dx, [bp - 10h + 8]
 
-        leave
+        mov     sp, bp
+        pop     bp
         pop     es
         pop     ds
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc32-U8D.asm
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc32-U8D.asm	(revision 60484)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-wc32-U8D.asm	(revision 60485)
@@ -51,5 +51,5 @@
         push    esp
 
-        ; The dividend.
+        ; The divisor.
         push    ecx
         push    ebx
