Tutorial Returning Int64/long in ARMv7/ARM64

AndnixSH

PMT Elite Modder
Staff member
Modding-Team
As requested by some modders.
I used Unity to compile my own il2cpp game just to check the lib lol

C#:
C#:
return 99l;

ARMv7:
C++:
MOV             R0, #0x63 ; 'c'
MOV             R1, #0
BX              LR

Code:
63 00 A0 E3  00 10 A0 E3  1E FF 2F E1

ARM64:
C++:
MOV             W0, #0x63
RET

Code:
60 0C 80 52  C0 03 5F D6



---------------------------------------------------------------------------------------------------------------



C#:
C#:
return 999999l;

ARMv7:
C++:
MOV             R0, #0x423F
MOV             R1, #0
MOVT            R0, #0xF
BX              LR

Code:
3F 02 04 E3  00 10 A0 E3  0F 00 40 E3  1E FF 2F E1

ARM64:
C++:
MOV             W0, #0x423F
MOVK            W0, #0xF,LSL#16
RET


Code:
E0 47 88 52  E0 01 A0 72  C0 03 5F D6



---------------------------------------------------------------------------------------------------------------



C#:
C#:
return 999999999l;

ARMv7:
C++:
MOV             R0, #0xC9FF
MOV             R1, #0
MOVT            R0, #0x3B9A
BX              LR

Code:
FF 09 0C E3 00 10 A0 E3 9A 0B 43 E3  1E FF 2F E1

ARM64:
C++:
MOV             W0, #0xC9FF
MOVK            W0, #0x3B9A,LSL#16
RET

Code:
E0 3F 99 52  40 73 A7 72  C0 03 5F D6



---------------------------------------------------------------------------------------------------------------



C#:
C#:
return 999999999999l;

ARMv7:
C++:
MOV             R0, #0xFFF
MOV             R1, #0xE8
MOVT            R0, #0xD4A5
BX              LR

Code:
FF 0F 00 E3  E8 10 A0 E3  A5 04 4D E3  1E FF 2F E1

ARM64:
C++:
MOV             X0, #0xFFF
MOVK            X0, #0xD4A5,LSL#16
MOVK            X0, #0xE8,LSL#32
RET

Code:
E0 FF 81 D2  A0 94 BA F2  00 1D C0 F2  C0 03 5F D6
 
what about just a return, like if I have a method that is damage I just want to put a return on it so it does nothing but in ARMv7 I cant find it anything that can give me a ARMv7 return cause the online hex converter can convert it :/
 
what about just a return, like if I have a method that is damage I just want to put a return on it so it does nothing but in ARMv7 I cant find it anything that can give me a ARMv7 return cause the online hex converter can convert it :/
BX LR?
 
Need to know how to do int16 or a short variable.
This is good info if I ever need to work with a long variable.

If you can do this for short I'll be in your debt haha. Seriously though I'm failing miserably and can't compile code to check it myself or I would. I'm just a c# guy.
 
Tags Tags
arm64 armv7 int64 long
Back
Top Bottom