source: trunk/minix/lib/i86/int64/cmp64.s@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 877 bytes
Line 
1! cmp64*() - 64 bit compare Author: Kees J. Bot
2! 24 Dec 1995
3.sect .text
4.define _cmp64, _cmp64u, _cmp64ul
5
6_cmp64: ! int cmp64(u64_t i, u64_t j);
7 mov bx, sp
8cmp64: xor ax, ax
9 mov dx, 2(bx)
10 sub dx, 10(bx)
11 mov dx, 4(bx)
12 sbb dx, 12(bx)
13 mov dx, 6(bx)
14 sbb dx, 14(bx)
15 mov dx, 8(bx)
16 sbb dx, 16(bx)
17 sbb ax, ax ! ax = - (i < j)
18 mov dx, 10(bx)
19 sub dx, 2(bx)
20 mov dx, 12(bx)
21 sbb dx, 4(bx)
22 mov dx, 14(bx)
23 sbb dx, 6(bx)
24 mov dx, 16(bx)
25 sbb dx, 8(bx)
26 adc ax, #0 ! ax = (i > j) - (i < j)
27 ret
28
29_cmp64u: ! int cmp64u(u64_t i, unsigned j);
30 mov bx, sp
31 push 16(bx)
32 mov 16(bx), #0
33 push 14(bx)
34 mov 14(bx), #0
35 push 12(bx)
36 mov 12(bx), #0
37 call cmp64
38 pop 12(bx)
39 pop 14(bx)
40 pop 16(bx)
41 ret
42
43_cmp64ul: ! int cmp64ul(u64_t i, unsigned long j);
44 mov bx, sp
45 push 14(bx)
46 mov 14(bx), #0
47 push 12(bx)
48 mov 12(bx), #0
49 call cmp64
50 pop 12(bx)
51 pop 14(bx)
52 ret
Note: See TracBrowser for help on using the repository browser.