I'm quite new to programming and I was wondering what STRB exactly doing in this decompiled code, as i understand LSRS is a shifting to the right, ADDS is incrementing the r3 by 8 each loop because BNE is checking here for R3 equals 0x20, if not then continue looping :
loc_4EE
LSRS.W R1, R5, R3
LSRS.W R2, R6, R3
ADDS R3, #8
STRB R1, [R7,#0x40+var_40]
STRB R2, [R7,#0x40+var_3C]
ADDS R7, #1
CMP R3, #0x20 ; ' '
BNE loc_4EE
and here is the whole code with variable initialization (put it here, guess it can be important)
CODE16
EXPORT SEC_calc_erc
SEC_calc_erc
s= -0x68
var_64= -0x64
var_60= -0x60
var_5C= -0x5C
var_58= -0x58
var_54= -0x54
var_50= -0x50
var_40= -0x40
var_3C= -0x3C
var_30= -0x30
anonymous_3= -0x2C
anonymous_4= -0x28
anonymous_5= -0x24
var_20= -0x20
anonymous_0= -0x1C
anonymous_1= -0x18
anonymous_2= -0x14
var_10= -0x10
var_F= -0xF
var_E= -0xE
var_D= -0xD
var_8= -8
var_4= -4
; __unwind {
LDR R3, =(_GLOBAL_OFFSET_TABLE_ - 0x494)
PUSH {R4-R7,LR}
MOV R6, R0
LDR R0, =(unk_63C - 0x87B8)
ADR R4, 0x494
ADDS R3, R3, R4 ; _GLOBAL_OFFSET_TABLE_
MOV R5, R1
MOV R4, R2
SUB SP, SP, #0x6C
ADDS R7, R3, R0 ; unk_63C
ADD.W LR, SP, #0x6C+var_20
LDMIA.W R7, {R0-R3}
ADD.W R12, R7, #0x10
ADD R7, SP, #0x2C
STMIA.W LR, {R0-R3}
ADD.W LR, SP, #0x6C+var_30
LDMIA.W R12, {R0-R3}
STMIA.W LR, {R0-R3}
MOVS R1, #0 ; c
MOVS R2, #0x18 ; n
ADD R0, SP, #0x6C+s ; s
BLX memset
MOVS R1, #0 ; c
MOVS R2, #0x10 ; n
MOV R0, R7 ; s
BLX memset
MOVS R1, #0 ; c
MOVS R2, #0x10 ; n
ADD R0, SP, #0x6C+var_50 ; s
BLX memset
MOVS R1, #0 ; c
MOVS R2, #8 ; n
ADD R0, SP, #0x6C+var_10 ; s
BLX memset
ADD R0, SP, #0x6C+var_8 ; s
MOVS R1, #0 ; c
MOVS R2, #4 ; n
BLX memset
MOVS R3, #0
loc_4EE
LSRS.W R1, R5, R3
LSRS.W R2, R6, R3
ADDS R3, #8
STRB R1, [R7,#0x40+var_40]
STRB R2, [R7,#0x40+var_3C]
ADDS R7, #1
CMP R3, #0x20 ; ' '
BNE loc_4EE
question from:
https://stackoverflow.com/questions/65943308/strange-strb-in-arm-assembly