Tutorial Returning Int64/long in ARMv7/ARM64

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,757
301,568
1,213
Modding World
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
 

komik

Awesome Active Platinian
Jul 16, 2017
145
39
63
33
return? mean like keep value or just add value? or what?
 

GreatBigPanda

Platinian
Jul 24, 2019
5
2
3
26
In the middle of nowhere
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 :/
 
  • Like
Reactions: komik

TheArmKing

iPMT Elite Modder
Staff member
iOS Team Leader
Modding-Team
Jul 13, 2017
5,395
361,587
1,213
BUSY
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?
 

EpicCode

1/3 Games Approved
Oct 30, 2018
39
7
83
39
Usa
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.
 

HazkeLs

Rookie
Jan 22, 2021
1
0
1
31
Spain
Does anyone have some code for x64 that returns a large value in String and another to return an Int ?, Thanks in advance!
 
Tags
arm64 armv7 int64 long