scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

memcmp.s (274B)


      1 	.file "memcmp.s"
      2 
      3 	.text
      4 	.globl	memcmp,_memcmp
      5 _memcmp:
      6 memcmp:
      7 	cmpq	$0,%rdx
      8 	je	equa
      9 	cld
     10 	movq	%rdx,%rcx
     11 	movq	%rdi,%r8
     12 	movq	%rsi,%rdi
     13 	movq	%r8,%rsi
     14 	rep
     15 	cmpsb
     16 	je	equa
     17 	jb	less
     18 	ja	grea
     19 
     20 equa:
     21 	movq	$0,%rax
     22 	ret
     23 
     24 less:
     25 	movq	$-1,%rax
     26 	ret
     27 
     28 grea:
     29 	movq	$1,%rax
     30 	ret