File: arith.s

package info (click to toggle)
binutils 2.31.1-11
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 307,644 kB
  • sloc: ansic: 1,161,122; asm: 638,494; cpp: 128,815; exp: 68,557; makefile: 55,816; sh: 22,360; yacc: 14,238; lisp: 13,272; perl: 2,111; ada: 1,681; lex: 1,652; pascal: 1,446; cs: 879; sed: 195; python: 154; xml: 95; awk: 25
file content (162 lines) | stat: -rw-r--r-- 1,354 bytes parent folder | download | duplicates (27)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
	.text
	.org 0
;;; 8-bit arithmetic and logic
	add a,a
	add a,b
	add a,c
	add a,d
	add a,e
	add a,h
	add a,l
	add a,(hl)
	add a,(ix+5)
	add a,(iy+5)
	add a,17

	adc a,a
	adc a,b
	adc a,c
	adc a,d
	adc a,e
	adc a,h
	adc a,l
	adc a,(hl)
	adc a,(ix+5)
	adc a,(iy+5)
	adc a,17

	sub a
	sub b
	sub c
	sub d
	sub e
	sub h
	sub l
	sub (hl)
	sub (ix+5)
	sub (iy+5)
	sub 17

	sbc a,a
	sbc a,b
	sbc a,c
	sbc a,d
	sbc a,e
	sbc a,h
	sbc a,l
	sbc a,(hl)
	sbc a,(ix+5)
	sbc a,(iy+5)
	sbc a,17

	and a
	and b
	and c
	and d
	and e
	and h
	and l
	and (hl)
	and (ix+5)
	and (iy+5)
	and 17

	xor a
	xor b
	xor c
	xor d
	xor e
	xor h
	xor l
	xor (hl)
	xor (ix+5)
	xor (iy+5)
	xor 17

	or a
	or b
	or c
	or d
	or e
	or h
	or l
	or (hl)
	or (ix+5)
	or (iy+5)
	or 17

	cp a
	cp b
	cp c
	cp d
	cp e
	cp h
	cp l
	cp (hl)
	cp (ix+5)
	cp (iy+5)
	cp 17

	inc a
	inc b
	inc c
	inc d
	inc e
	inc h
	inc l
	inc (hl)
	inc (ix+5)
	inc (iy+5)

	dec a
	dec b
	dec c
	dec d
	dec e
	dec h
	dec l
	dec (hl)
	dec (ix+5)
	dec (iy+5)

;;; 16-bit arithmetic anmd logic
	add hl,bc
	add hl,de
	add hl,hl
	add hl,sp
	
	add ix,bc
	add ix,de
	add ix,ix
	add ix,sp
	
	add iy,bc
	add iy,de
	add iy,iy
	add iy,sp
	
	adc hl,bc
	adc hl,de
	adc hl,hl
	adc hl,sp

	sbc hl,bc
	sbc hl,de
	sbc hl,hl
	sbc hl,sp

	inc bc
	inc de
	inc hl
	inc sp
	inc ix
	inc iy

	dec bc
	dec de
	dec hl
	dec sp
	dec ix
	dec iy