Skip to content

Instantly share code, notes, and snippets.

@astroza
Created April 16, 2021 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astroza/892db7db85078e067caf569974547508 to your computer and use it in GitHub Desktop.
Save astroza/892db7db85078e067caf569974547508 to your computer and use it in GitHub Desktop.
ReformString
.arch armv5t
.fpu softvfp
.text
.syntax unified
.align 2
.global ReformString
.type ReformString, %function
ReformString:
push {r2, r3}
cmp r1, #0
cmpne r0, #0
push {r0, r1, r2, lr}
ldr ip, [sp, #16]
moveq r3, #1
movne r3, #0
moveq r0, #0
beq jmp1
add r2, sp, #20
str r2, [sp, #4]
jmp2:
cmp r3, ip
ldrne lr, [r2], #4
ldrbne lr, [r1, lr]
strbne lr, [r0, r3]
addne r3, r3, #1
bne jmp2
mov r2, #0
strb r2, [r0, r3]
jmp1:
add sp, sp, #12
pop {lr}
add sp, sp, #8
bx lr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment