#name Clear

; * Clear Routine

; Parameters :

; R0 - Start address
; R1 - Number to use as clear value
; R2 - Number of bytes to do

ALIGN

.clearroutine
  STMFD R13!,{R0-R12,R14} 

.loop
  STRB R1,[R0,R2]
  SUBS R2,R2,#1
  BPL loop

  LDMFD R13!,{R0-R12,PC}^