--- /dev/null
+;
+; Ullrich von Bassewitz, 2009-11-04
+;
+; CC65 library: 32by16 => 16 signed division
+;
+
+ .export _idiv32by16r16
+ .import idiv32by16r16, incsp4
+
+ .include "zeropage.inc"
+
+
+;---------------------------------------------------------------------------
+; 32by16 division.
+
+.proc _idiv32by16r16
+
+ pha ; Save rhs
+
+; Copy from stack to zeropage. This assumes ptr1 and ptr2 are adjacent.
+
+ ldy #3
+@L1: lda (sp),y
+ sta ptr1,y
+ dey
+ bpl @L1
+
+ lda #4
+ clc
+ adc sp
+ sta sp
+ bcc @L2
+ inc sp+1
+
+@L2: pla ; Old rhs
+ jmp idiv32by16r16
+
+.endproc
+
--- /dev/null
+;
+; Ullrich von Bassewitz, 2010-11-03
+;
+; CC65 library: 16x16 => 32 signed multiplication
+;
+
+ .export _imul16x16r32
+ .import imul16x16r32, popax
+
+ .include "zeropage.inc"
+
+
+;---------------------------------------------------------------------------
+; 16x16 => 32 signed multiplication routine.
+
+
+.proc _imul16x16r32
+
+ sta ptr1
+ stx ptr1+1
+ jsr popax
+ jmp imul16x16r32
+
+.endproc
+
--- /dev/null
+;
+; 2014-03-27, Oliver Schmidt
+; 2014-05-08, Greg King
+;
+; CC65 library: 8x8 => 16 signed multiplication
+;
+
+ .export _imul8x8r16
+ .import imul8x8r16, popa, ptr1:zp
+
+
+;---------------------------------------------------------------------------
+; 8x8 => 16 signed multiplication routine.
+
+
+.proc _imul8x8r16
+
+ sta ptr1
+ jsr popa
+ jmp imul8x8r16
+
+.endproc
--- /dev/null
+;
+; Ullrich von Bassewitz, 2009-11-04
+;
+; CC65 library: 32by16 => 16 unsigned division
+;
+
+ .export _udiv32by16r16
+ .import udiv32by16r16m, incsp4
+
+ .include "zeropage.inc"
+
+
+;---------------------------------------------------------------------------
+; 32by16 division.
+
+.proc _udiv32by16r16
+
+ sta ptr3
+ stx ptr3+1 ; Store rhs
+
+; Copy from stack to zeropage. This assumes ptr1 and ptr2 are adjacent.
+
+ ldy #3
+@L1: lda (sp),y
+ sta ptr1,y
+ dey
+ bpl @L1
+
+ lda #4
+ clc
+ adc sp
+ sta sp
+ bcc @L2
+ inc sp+1
+
+@L2: jmp udiv32by16r16m
+
+.endproc
+
--- /dev/null
+;
+; Ullrich von Bassewitz, 2010-11-03
+;
+; CC65 library: 16x16 => 32 unsigned multiplication
+;
+
+ .export _umul16x16r32
+ .import umul16x16r32, popax
+
+ .include "zeropage.inc"
+
+
+;---------------------------------------------------------------------------
+; 16x16 => 32 unsigned multiplication routine.
+
+.proc _umul16x16r32
+
+ sta ptr1
+ stx ptr1+1
+ jsr popax
+ jmp umul16x16r32
+
+.endproc
+
+
--- /dev/null
+;
+; Ullrich von Bassewitz, 2011-07-10
+;
+; CC65 library: 16x8 => 32 unsigned multiplication
+;
+
+ .export _umul16x8r32
+ .import umul8x16r24, popax
+
+ .include "zeropage.inc"
+
+
+;---------------------------------------------------------------------------
+; 16x8 => 32 unsigned multiplication routine. We use 8x16 => 24 and clear
+; the high byte of the result
+
+.proc _umul16x8r32
+
+ sta ptr1
+ lda #0
+ sta sreg+1 ; Clear high byte of result
+ jsr popax
+ jmp umul8x16r24
+
+.endproc
+
+
--- /dev/null
+;
+; Oliver Schmidt, 2014-03-27
+;
+; CC65 library: 8x8 => 16 unsigned multiplication
+;
+
+ .export _umul8x8r16
+ .import umul8x8r16, popa, ptr1:zp
+
+
+;---------------------------------------------------------------------------
+; 8x8 => 16 unsigned multiplication routine.
+
+
+.proc _umul8x8r16
+
+ sta ptr1
+ jsr popa
+ jmp umul8x8r16
+
+.endproc
+++ /dev/null
-;
-; Ullrich von Bassewitz, 2009-11-04
-;
-; CC65 library: 32by16 => 16 signed division
-;
-
- .export _idiv32by16r16
- .import idiv32by16r16, incsp4
-
- .include "zeropage.inc"
-
-
-;---------------------------------------------------------------------------
-; 32by16 division.
-
-.proc _idiv32by16r16
-
- pha ; Save rhs
-
-; Copy from stack to zeropage. This assumes ptr1 and ptr2 are adjacent.
-
- ldy #3
-@L1: lda (sp),y
- sta ptr1,y
- dey
- bpl @L1
-
- lda #4
- clc
- adc sp
- sta sp
- bcc @L2
- inc sp+1
-
-@L2: pla ; Old rhs
- jmp idiv32by16r16
-
-.endproc
-
+++ /dev/null
-;
-; Ullrich von Bassewitz, 2010-11-03
-;
-; CC65 library: 16x16 => 32 signed multiplication
-;
-
- .export _imul16x16r32
- .import imul16x16r32, popax
-
- .include "zeropage.inc"
-
-
-;---------------------------------------------------------------------------
-; 16x16 => 32 signed multiplication routine.
-
-
-.proc _imul16x16r32
-
- sta ptr1
- stx ptr1+1
- jsr popax
- jmp imul16x16r32
-
-.endproc
-
+++ /dev/null
-;
-; 2014-03-27, Oliver Schmidt
-; 2014-05-08, Greg King
-;
-; CC65 library: 8x8 => 16 signed multiplication
-;
-
- .export _imul8x8r16
- .import imul8x8r16, popa, ptr1:zp
-
-
-;---------------------------------------------------------------------------
-; 8x8 => 16 signed multiplication routine.
-
-
-.proc _imul8x8r16
-
- sta ptr1
- jsr popa
- jmp imul8x8r16
-
-.endproc
+++ /dev/null
-;
-; Ullrich von Bassewitz, 2009-11-04
-;
-; CC65 library: 32by16 => 16 unsigned division
-;
-
- .export _udiv32by16r16
- .import udiv32by16r16m, incsp4
-
- .include "zeropage.inc"
-
-
-;---------------------------------------------------------------------------
-; 32by16 division.
-
-.proc _udiv32by16r16
-
- sta ptr3
- stx ptr3+1 ; Store rhs
-
-; Copy from stack to zeropage. This assumes ptr1 and ptr2 are adjacent.
-
- ldy #3
-@L1: lda (sp),y
- sta ptr1,y
- dey
- bpl @L1
-
- lda #4
- clc
- adc sp
- sta sp
- bcc @L2
- inc sp+1
-
-@L2: jmp udiv32by16r16m
-
-.endproc
-
+++ /dev/null
-;
-; Ullrich von Bassewitz, 2010-11-03
-;
-; CC65 library: 16x16 => 32 unsigned multiplication
-;
-
- .export _umul16x16r32
- .import umul16x16r32, popax
-
- .include "zeropage.inc"
-
-
-;---------------------------------------------------------------------------
-; 16x16 => 32 unsigned multiplication routine.
-
-.proc _umul16x16r32
-
- sta ptr1
- stx ptr1+1
- jsr popax
- jmp umul16x16r32
-
-.endproc
-
-
+++ /dev/null
-;
-; Ullrich von Bassewitz, 2011-07-10
-;
-; CC65 library: 16x8 => 32 unsigned multiplication
-;
-
- .export _umul16x8r32
- .import umul8x16r24, popax
-
- .include "zeropage.inc"
-
-
-;---------------------------------------------------------------------------
-; 16x8 => 32 unsigned multiplication routine. We use 8x16 => 24 and clear
-; the high byte of the result
-
-.proc _umul16x8r32
-
- sta ptr1
- lda #0
- sta sreg+1 ; Clear high byte of result
- jsr popax
- jmp umul8x16r24
-
-.endproc
-
-
+++ /dev/null
-;
-; Oliver Schmidt, 2014-03-27
-;
-; CC65 library: 8x8 => 16 unsigned multiplication
-;
-
- .export _umul8x8r16
- .import umul8x8r16, popa, ptr1:zp
-
-
-;---------------------------------------------------------------------------
-; 8x8 => 16 unsigned multiplication routine.
-
-
-.proc _umul8x8r16
-
- sta ptr1
- jsr popa
- jmp umul8x8r16
-
-.endproc