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

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

Minix 3.1.2a

File size: 649 bytes
Line 
1! cmp64*() - 64 bit compare Author: Kees J. Bot
2! 7 Dec 1995
3.sect .text
4.define _cmp64, _cmp64u, _cmp64ul
5
6_cmp64: ! int cmp64(u64_t i, u64_t j);
7 mov ecx, esp
8cmp64: xor eax, eax
9 mov edx, 4(ecx)
10 sub edx, 12(ecx)
11 mov edx, 8(ecx)
12 sbb edx, 16(ecx)
13 sbb eax, eax ! eax = - (i < j)
14 mov edx, 12(ecx)
15 sub edx, 4(ecx)
16 mov edx, 16(ecx)
17 sbb edx, 8(ecx)
18 adc eax, 0 ! eax = (i > j) - (i < j)
19 ret
20
21_cmp64u: ! int cmp64u(u64_t i, unsigned j);
22_cmp64ul: ! int cmp64ul(u64_t i, unsigned long j);
23 mov ecx, esp
24 push 16(ecx)
25 mov 16(ecx), 0
26 call cmp64
27 pop 16(ecx)
28 ret
29
30!
31! $PchId: cmp64.ack.s,v 1.2 1996/04/11 18:59:57 philip Exp $
Note: See TracBrowser for help on using the repository browser.