diff options
| author | John Wilbert M. Villamor <lameguy64@gmail.com> | 2019-04-06 10:11:07 +0800 |
|---|---|---|
| committer | John Wilbert M. Villamor <lameguy64@gmail.com> | 2019-04-06 10:11:07 +0800 |
| commit | f3e040230772f978540a71aea43dfde200992922 (patch) | |
| tree | bd8ca31b72dd01e24980b073854e263589530f56 /libpsn00b/libc/memmove.s | |
| download | psn00bsdk-f3e040230772f978540a71aea43dfde200992922.tar.gz | |
First commit
Diffstat (limited to 'libpsn00b/libc/memmove.s')
| -rw-r--r-- | libpsn00b/libc/memmove.s | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libpsn00b/libc/memmove.s b/libpsn00b/libc/memmove.s new file mode 100644 index 0000000..961e71f --- /dev/null +++ b/libpsn00b/libc/memmove.s @@ -0,0 +1,29 @@ +.set noreorder + +.section .text + +# Arguments +# a0 - destination address +# a1 - source address +# a2 - bytes to move +.global memmove +.type memmove, @function +memmove: + move $v0, $a0 + addu $a0, $a2 + addu $a1, $a2 + addiu $a0, -1 + addiu $a1, -1 +.loop: + blez $a2, .exit + addi $a2, -1 + lbu $v1, 0($a1) + addiu $a1, -1 + sb $v1, 0($a0) + addiu $a0, -1 + b .loop + nop +.exit: + jr $ra + nop +
\ No newline at end of file |
