annotate lib/kreiderclib/ltol3.as @ 2981:9550602c9a0b

sierra/objs_lsl/mnln.asm: Use division quotient, not remainder It calls a routine twice to make a division (L125C) but doesn't check the right register for the result. The result is returned in reg U and the remainder in reg D but the procedure expect the result to be returned in reg D. The divison routine seems to be correct because it is properly used elsewhere in the code. Patch by Guillaume Major and Robert Gault.
author Guillaume Major <guillaume.major@gmail.com>
date Sat, 12 Apr 2014 15:30:03 +0200
parents 1647f1874cdf
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2824
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
1 * Disassembly by Os9disasm of ltol3.r
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
2
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
3 section code
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
4
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
5 ltol3: pshs u
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
6 ldu 4,s
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
7 leau 1,u
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
8 bra L001d
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
9 L0008 ldx 6,s
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
10 ldb 1,x
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
11 stb -1,u
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
12 ldx 6,s
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
13 ldd 2,x
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
14 std ,u
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
15 ldd 6,s
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
16 addd #4
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
17 std 6,s
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
18 leau 3,u
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
19 L001d ldd 8,s
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
20 addd #-1
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
21 std 8,s
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
22 subd #-1
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
23 bgt L0008
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
24 puls u,pc
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
25
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
26 endsect
1647f1874cdf Added Kreidier C library
Boisy Pitre <boisy.pitre@nuance.com>
parents:
diff changeset
27