OpenCores
URL https://opencores.org/ocsvn/zet86/zet86/trunk

Subversion Repositories zet86

[/] [zet86/] [trunk/] [tests/] [18_div.s] - Blame information for rev 55

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 zeus
.code16
2
start:
3
movw $208, %sp
4
 
5
# Exception 0 handler
6
movw $0x1000, (0)
7
movw $0xf000, (2)
8
 
9
movw $208, %bp
10
 
11
# div word tests
12
# easy test
13
movw $0x0, %dx
14
movw $0x14, %ax
15
movw $0x5, %bx
16
 
17
movw $0x2, (%bp)
18
divw %bx
19
addw $0x2, %bp
20
 
21
movw %ax, (128)
22
movw %bx, (130)
23
movw %dx, (4)
24
pushf
25
 
26
 
27
movw $0xa320, %dx
28
movw $0xc3da, %ax
29
movw $0xffff, (6)
30
 
31
movw $0x4, (%bp)
32
divw (6)
33
addw $0x2, %bp
34
 
35
movw %ax, (8)
36
movw %dx, (10)
37
pushf
38
 
39
 
40
movw $0xffff, %dx
41
movw $0xffff, %ax
42
movw $0x1, %cx
43
 
44
movw $0x2, (%bp)
45
divw %cx
46
addw $0x2, %bp
47
 
48
movw %ax, (12)
49
movw %cx, (14)
50
movw %dx, (16)
51
pushf
52
 
53
 
54
movw $0xffff, %dx
55
movw $0xffff, %ax
56
movw $0xffff, (18)
57
 
58
movw $0x4, (%bp)
59
divw (18)
60
addw $0x2, %bp
61
 
62
movw %ax, (20)
63
movw %dx, (22)
64
pushf
65
 
66
 
67
movw $0xfbb4, %dx
68
movw $0xc3da, %ax
69
movw $0xae8e, %cx
70
 
71
movw $0x2, (%bp)
72
divw %cx
73
addw $0x2, %bp
74
 
75
movw %ax, (24)
76
movw %cx, (26)
77
movw %dx, (28)
78
pushf
79
 
80
 
81
movw $0x25c9, %dx
82
movw $0xf110, %ax
83
 
84
movw $0x2, (%bp)
85
divw %ax
86
addw $0x2, %bp
87
 
88
movw %ax, (30)
89
movw %dx, (32)
90
pushf
91
 
92
 
93
# div byte tests
94
# easy test
95
movw $0x14, %ax
96
movw $0x5, %bx
97
 
98
movw $0x2, (%bp)
99
divb %bl
100
addw $0x2, %bp
101
 
102
movw %ax, (34)
103
movw %bx, (36)
104
movw %dx, (38)
105
pushf
106
 
107
movw $0xa320, %dx
108
movw $0xc3da, %ax
109
movw $0xff, (40)
110
 
111
movw $0x4, (%bp)
112
divb (40)
113
addw $0x2, %bp
114
 
115
movw %ax, (42)
116
movw %dx, (44)
117
pushf
118
 
119
movw $0xffff, %ax
120
movb $0x1, %dh
121
 
122
movw $0x2, (%bp)
123
divb %dh
124
addw $0x2, %bp
125
 
126
movw %ax, (46)
127
movw %dx, (48)
128
pushf
129
 
130
movw $0xffff, %ax
131
movw $0xffff, (50)
132
 
133
movw $0x4, (%bp)
134
divb (51)
135
addw $0x2, %bp
136
 
137
movw %ax, (52)
138
movw %dx, (54)
139
pushf
140
 
141
movw $0x008a, %ax
142
movw $0xae8e, %cx
143
 
144
movw $0x2, (%bp)
145
divb %cl
146
addw $0x2, %bp
147
 
148
movw %ax, (56)
149
movw %cx, (58)
150
pushf
151
 
152
movw $0x0669, %dx
153
movw $0x89f3, %ax
154
 
155
movw $0x2, (%bp)
156
divb %al
157
addw $0x2, %bp
158
 
159
movw %ax, (60)
160
movw %dx, (62)
161
pushf
162
 
163
# idiv word tests
164
# easy test
165
movw $0x0, %dx
166
movw $0x14, %ax
167
movw $0xfa, %bx
168
 
169
movw $0x2, (%bp)
170
idivw %bx
171
addw $0x2, %bp
172
 
173
movw %ax, (64)
174
movw %bx, (66)
175
movw %dx, (68)
176
pushf
177
 
178
 
179
movw $0xa320, %dx
180
movw $0xc3da, %ax
181
movw $0xffff, (70)
182
 
183
movw $0x4, (%bp)
184
idivw (70)
185
addw $0x2, %bp
186
 
187
movw %ax, (72)
188
movw %dx, (74)
189
pushf
190
 
191
 
192
movw $0xffff, %dx
193
movw $0xffff, %ax
194
movw $0x1, %cx
195
 
196
movw $0x2, (%bp)
197
idivw %cx
198
addw $0x2, %bp
199
 
200
movw %ax, (76)
201
movw %cx, (78)
202
movw %dx, (80)
203
pushf
204
 
205
 
206
movw $0xffff, %dx
207
movw $0xffff, %ax
208
movw $0xffff, (82)
209
 
210
movw $0x4, (%bp)
211
idivw (82)
212
addw $0x2, %bp
213
 
214
movw %ax, (84)
215
movw %dx, (86)
216
pushf
217
 
218
 
219
movw $0xfbb4, %dx
220
movw $0xc3da, %ax
221
movw $0xae8e, %cx
222
 
223
movw $0x2, (%bp)
224
idivw %cx
225
addw $0x2, %bp
226
 
227
movw %ax, (88)
228
movw %cx, (90)
229
movw %dx, (92)
230
pushf
231
 
232
 
233
movw $0x25c9, %dx
234
movw $0xf110, %ax
235
 
236
movw $0x2, (%bp)
237
idivw %ax
238
addw $0x2, %bp
239
 
240
movw %ax, (94)
241
movw %dx, (96)
242
pushf
243
 
244
# idiv byte tests
245
# easy test
246
movw $0x14, %ax
247
movw $0x5, %bx
248
 
249
movw $0x2, (%bp)
250
idivb %bl
251
addw $0x2, %bp
252
 
253
movw %ax, (98)
254
movw %bx, (100)
255
movw %dx, (102)
256
pushf
257
 
258
 
259
movw $0xa320, %dx
260
movw $0xc3da, %ax
261
movw $0xff, (104)
262
 
263
movw $0x4, (%bp)
264
idivb (104)
265
addw $0x2, %bp
266
 
267
movw %ax, (106)
268
movw %dx, (108)
269
pushf
270
 
271
 
272
movw $0xffff, %ax
273
movb $0x1, %dh
274
 
275
movw $0x2, (%bp)
276
idivb %dh
277
addw $0x2, %bp
278
 
279
movw %ax, (110)
280
movw %dx, (112)
281
pushf
282
 
283
 
284
movw $0xffff, %ax
285
movw $0xffff, (114)
286
 
287
movw $0x4, (%bp)
288
idivb (115)
289
addw $0x2, %bp
290
 
291
movw %ax, (116)
292
movw %dx, (118)
293
pushf
294
 
295
 
296
movw $0x008a, %ax
297
movw $0xae8e, %cx
298
 
299
movw $0x2, (%bp)
300
idivb %cl
301
addw $0x2, %bp
302
 
303
movw %ax, (120)
304
movw %cx, (122)
305
pushf
306
 
307
 
308
movw $0x0669, %dx
309
movw $0x89f3, %ax
310
 
311
movw $0x2, (%bp)
312
idivb %al
313
addw $0x2, %bp
314
 
315
movw %ax, (124)
316
movw %dx, (126)
317
pushf
318
 
319
 
320
# AAM tests
321
movw $0xffff, %ax
322
 
323
movw $0x2, (%bp)
324
aam $0
325
addw $0x2, %bp
326
movw %ax, (132)
327
pushf
328
 
329
movw $0x2, (%bp)
330
aam $1
331
addw $0x2, %bp
332
movw %ax, (134)
333
pushf
334
 
335
movw $0xffff, %ax
336
movw $0x2, (%bp)
337
aam
338
addw $0x2, %bp
339
movw %ax, (136)
340
pushf
341
 
342
movw $0xff00, %ax
343
movw $0x2, (%bp)
344
aam $0
345
addw $0x2, %bp
346
movw %ax, (138)
347
pushf
348
 
349
movw $0x2, (%bp)
350
aam $1
351
addw $0x2, %bp
352
movw %ax, (140)
353
pushf
354
 
355
movw $0x3ffb, %ax
356
movw $0x2, (%bp)
357
aam
358
addw $0x2, %bp
359
movw %ax, (142)
360
pushf
361
 
362
hlt
363
 
364
# Exception handler (int 0)
365
.org 0x1000
366
push %ax
367
push %di
368
movw (%bp), %ax
369
movw %sp, %si
370
addw $4, %si
371
movw (%si), %si
372
movw %si, (%bp)
373
addw %ax, %si
374
movw %sp, %di
375
addw $4, %di
376
movw %si, (%di)
377
pop %di
378
pop %ax
379
iret
380
 
381
.org 65520
382
jmp start
383
.org 65535
384
.byte 0xff

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.