2 ; Ullrich von Bassewitz, 2009-11-04
4 ; CC65 runtime: 32by16 => 16 signed division
8 .import negax, udiv32by16r16m
10 .include "zeropage.inc"
13 ;---------------------------------------------------------------------------
14 ; 32by16 division. Divide ptr1:ptr2 by ptr3. Result is in ptr1, remainder
17 ; lhs rhs result result also in remainder
18 ; -----------------------------------------------------------------------
19 ; ptr1:ptr2 ptr3 ax ptr1 sreg
37 ; Negate the value in ptr1:ptr2
50 ; Call the unsigned division routine
52 @L3: jsr udiv32by16r16m
54 ; Check the sign of the result
60 ; Negate the result. We do this here only for the result, not for the