aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/libc/memset.s
blob: b3a3af3b06d302372b36d73b971a702e9890b0d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# High speed ASM memset implementation by Lameguy64
#
# Part of PSn00bSDK

.set noreorder

.section .text

# Arguments:
#	a0 - address to buffer
#	a1 - value to set
#	a2 - bytes to set
.global memset
.type memset,@function
memset:
	move	$v0, $a0
	blez	$a2, .Lexit
	addi	$a2, -1
	sb		$a1, 0($a0)
	b		memset
	addiu	$a0, 1
.Lexit:
	jr		$ra
	nop