ADR r0, EnvName MOV r1, #0 MVN r2, #-1 ; get length MOV r3, #0 MOV r4, #0 SWI XOS_ReadVarVal ; CMP r2, #0 ; 0 == doesn't exist ; LDREQ pc, [r13], #4 ; just be dormant and useless ; NOT (length) is now in r2 MOV r0, #6 ; OS_Module claim MVN r3, r2 ADD r3, r3, #4 ; space for the length at the start SWI OS_Module STR r2, [r12] ADR r0, EnvName ADD r1, r2, #4 SUB r2, r3, #0 ;4 ; buffer size - length word STR r2, [r1, #-4] ; store the length MOV r3, #0 ; 1st call MOV r4, #0 ; blah! SWI XOS_ReadVarVal ; read it into our buffer space