source: thomson/code/3rdparty/sources2-hcl/DIVISION.ASM@ ceffc47

main
Last change on this file since ceffc47 was ceffc47, checked in by Adrien Destugues <pulkomandy@…>, 10 years ago

Add that collection of 3rdparty source I had lying on my disk for some time...

git-svn-id: svn://localhost/thomson@51 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

  • Property mode set to 100644
File size: 1.5 KB
Line 
1****************************************
2* Divise un mot de 8 bits par un autre *
3* Le résultat est codé sur 16 bits *
4****************************************
5
6 ORG $9000
7DIR EQU $9F
8Z EQU 0
9
10G ORCC #80
11 LDA #DIR
12 TFR A,DP
13 LDA #4
14 LDB #192
15 STD <Z
16
17
18 CLRB partie entière
19 CMPA <Z+1 sur 8 bits
20 BLO *+7
21 SUBA <Z+1
22 INCB
23 BRA *-7
24 STB <Z+2
25
26 CLRB partie "décimale"
27 ASLA (256èmes)
28 BCS *+6
29 CMPA <Z+1 sur 8 bits
30 BLO *+6
31 SUBA <Z+1
32 ORB #128
33 ASLA
34 BCS *+6
35 CMPA <Z+1
36 BLO *+6
37 SUBA <Z+1
38 ORB #64
39 ASLA
40 BCS *+6
41 CMPA <Z+1
42 BLO *+6
43 SUBA <Z+1
44 ORB #32
45 ASLA
46 BCS *+6
47 CMPA <Z+1
48 BLO *+6
49 SUBA <Z+1
50 ORB #16
51 ASLA
52 BCS *+6
53 CMPA <Z+1
54 BLO *+6
55 SUBA <Z+1
56 ORB #8
57 ASLA
58 BCS *+6
59 CMPA <Z+1
60 BLO *+6
61 SUBA <Z+1
62 ORB #4
63 ASLA
64 BCS *+6
65 CMPA <Z+1
66 BLO *+6
67 SUBA <Z+1
68 ORB #2
69 ASLA
70 BCS *+6
71 CMPA <Z+1
72 BLO *+6
73 SUBA <Z+1
74 ORB #1
75 STB <Z+3
76
77 LDX <Z
78 LDY <Z+2
79 SWI
80
81 END
Note: See TracBrowser for help on using the repository browser.