Hi!

- (Lucho) 32-bit division code for 386-enabled Watcom kernel.

--- Begin Message ---
diff -ruNp old/kernel/ludivmul.inc new/kernel/ludivmul.inc
--- old/kernel/ludivmul.inc     2002-01-26 17:13:14.000000000 +0000
+++ new/kernel/ludivmul.inc     2004-07-17 11:26:04.000000000 +0000
@@ -51,6 +51,7 @@
 ; destroys:
 ;   flags
 ;
+%if XCPU < 386
 
        test    cx, cx             ; divisor > 2^32-1 ?
        jnz     %%big_divisor      ; yes, divisor > 32^32-1
@@ -107,4 +108,35 @@
        pop     si                 ;  variables
        ret
 
-%endmacro   
\ No newline at end of file
+%else  ; XCPU >= 386 (Svilen Stoianov and Luchezar Georgiev, Varna, Bulgaria)
+
+       push    eax
+       pop     ax
+       push    edx
+       pop     dx
+       push    ecx
+;      pop     cx
+;      push    cx
+       push    bx
+       pop     ecx
+       push    dx
+       push    ax
+       pop     eax
+       xor     edx,edx
+       div     ecx
+       push    edx
+       pop     bx
+       pop     cx
+       push    eax
+       pop     ax
+       pop     dx
+       push    cx
+       pop     ecx
+       push    dx
+       pop     edx
+       push    ax
+       pop     eax
+       ret
+
+%endif
+%endmacro

--- End Message ---

Reply via email to