shithub: riscv

ref: 9e8fc02528d531c922e75395b5a7037904445d4b
dir: /sys/src/ape/lib/ap/68020/strlen.s/

View raw version
	TEXT	strlen(SB), $0
	MOVL	s+0(FP), A1

	TSTB	(A1)+
	BEQ	null
	MOVL	A1, A2

l1:
	TSTB	(A1)+
	BNE	l1

	SUBL	A2, A1
	MOVL	A1, R0
	RTS

null:
	MOVL	$0, R0
	RTS