Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_fixcpp/sys/src/libc/386/memcmp.s – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
	TEXT	memcmp(SB),$0
2
 
3
	MOVL	n+8(FP), BX
4
	CMPL	BX, $0
5
	JEQ	none
6
	MOVL	p1+0(FP), DI
7
	MOVL	p2+4(FP), SI
8
	CLD
9
/*
10
 * first by longs
11
 */
12
 
13
	MOVL	BX, CX
14
	SHRL	$2, CX
15
 
16
	REP;	CMPSL
17
	JNE	found
18
 
19
/*
20
 * then by bytes
21
 */
22
	ANDL	$3, BX
23
	MOVL	BX, CX
24
	REP;	CMPSB
25
	JNE	found1
26
 
27
none:
28
	MOVL	$0, AX
29
	RET
30
 
31
/*
32
 * if long found,
33
 * back up and look by bytes
34
 */
35
found:
36
	MOVL	$4, CX
37
	SUBL	CX, DI
38
	SUBL	CX, SI
39
	REP;	CMPSB
40
 
41
found1:
42
	JLS	lt
43
	MOVL	$-1, AX
44
	RET
45
lt:
46
	MOVL	$1, AX
47
	RET