Class_FullRamMarchC
PUSH {R4-R7}
MOVS R4, #0x1 ; Test success status by default
MOVS R3,R2 ; setup inverted background pattern
RSBS R3, R3, #0
SUBS R3,R3, #1
; *** Step 1 ***
; Write background pattern with addresses increasing
MOVS R5,R0
__FULL1_LOOP
CMP R5,R1
BHI __FULL_RET
LDR R7,[R5, #+0]
STR R2,[R5, #+0]
LDR R6,[R5, #+0]
CMP R2,R6
BNE __FULL_ERR
STR R3,[R5, #+0]
LDR R6,[R5, #+0]
CMP R3,R6
BNE __FULL_ERR
STR R7,[R5, #+0]
ADDS R5,R5,#+4
B __FULL1_LOOP
; *** Step 2 ***
; Write background pattern with addresses decreasing
MOVS R5,R1
SUBS R5,R5,#+4
__FULL2_LOOP
CMP R5,R0
BLO __FULL_RET
LDR R7,[R5, #+0]
STR R2,[R5, #+0]
LDR R6,[R5, #+0]
CMP R2,R6
BNE __FULL_ERR
STR R3,[R5, #+0]
LDR R6,[R5, #+0]
CMP R3,R6
BNE __FULL_ERR
STR R7,[R5, #+0]
SUBS R5,R5,#+4
B __FULL2_LOOP
__FULL_ERR
MOVS R4,#0 ; error result
__FULL_RET
MOVS R0,R4
POP {R4-R7}
BX LR ; return to the caller
|