Plan 9 from Bell Labs’s /usr/web/sources/plan9/sys/src/libc/power/memccpy.s

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


	TEXT	memccpy(SB), $0
#define	BDNZ	BC	16,0,
	MOVW	R3, s1+0(FP)
	MOVW	n+12(FP), R7
	MOVW	s2+4(FP), R4
	MOVBZ	c+11(FP), R5
	CMP	R7, $0
	BEQ	nf
	MOVW	R7, CTR
	SUB	$1, R3
	SUB	$1, R4
l1:
	MOVBZU	1(R4), R6
	CMP	R6, R5
	MOVBZU	R6, 1(R3)
	BEQ	eq
	BDNZ	l1
nf:
	MOVW	$0, R3
	RETURN
eq:
	ADD	$1, R3
	RETURN

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].