shithub: riscv

ref: 6f15a730f351b75f24286cb937a96db1ee9e5b82
dir: /sys/src/libc/68000/strcmp.s/

View raw version
	TEXT	strcmp(SB), $0
	MOVL	s1+0(FP), A2
	MOVL	s2+4(FP), A1

l1:	MOVB	(A1)+, R0
	BEQ	end
	CMPB	R0, (A2)+
	BEQ	l1

	BCS	gtr
	MOVL	$-1, R0
	RTS

gtr:	MOVL	$1, R0
	RTS

end:	TSTB	(A2)
	BNE	gtr
	CLRL	R0
	RTS