aboutsummaryrefslogtreecommitdiff
path: root/misc/string.s
blob: 0ed7ca36cc70134de14e20ca20e57bb7c10640ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// R0 : string1 address
// R1 : string2 address
// Result in R0
string_compare:
  MOVS R4, 0
loop:
  LDRB R2, [R0, R4]
  LDRB R3, [R1, R4]
  CMP R2, R3
  BNE done
  CMP R2, 0
  BEQ done
  ADDS R4, 1
  B loop
done:
  BX LR