/* save to stack so we can use the register */ STP X25, X26, [SP,#-0x90] /* get relative address to memory available for use */ ADRP X25, (data_start & 0xFFFFFFFF000) /* load from this memory we save something */ ldr x26, [X25, (data_start & 0xFFF)] /* nothing was written as it is 0 */ cbz x26,p1_init /* compared with stored value */ cmp x26,x0 /* don't match means p2*/ b.ne p2 p1: ldr s0, [x0, #0xcc] /* load max */ str s0, [x0, #0xc8] /* store current */ b return p2: str wzr, [x0, #0xc8] /* sabo opponent */ b return p1_init: /* save that value */ STR x0, [X25, (data_start & 0xFFF)] return: /* perform original code */ ldr s0, [x0, #0xc8] /* uncorrupt these register by loading it */ LDP X25, X26, [SP,#-0x90] b code1+4 /* return to game code */ a:.word 100 /* example of defining a value */