Jump to content

ARM Code Cheat Sheet


XEKEX
 Share

Recommended Posts

Collen
This post was recognized by Collen!

XEKEX was awarded the badge 'Helpful' and 10 points.


X32
True : 

~A MOV R0, #0x1
~A BX LR

False : 

~A MOV R0, #0x0
~A BX LR

Int : 

--------------------------------
-- 9999
~A MOVW R0, #0x270F 
~A BX LR
--------------------------------
-- 99999999
~A MOVW R0, #0xE0FF
~A MOVT R0, #0x05F5
~A BX LR

Float

--100
~A MOVT R0, #0x42C8
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--50
~A MOVT R0, #0x4248
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--10
~A MOVT R0, #0x4120
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--0.1
~A MOVW R0, #0xCCCD
~A MOVT R0, #0x3DCC
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--0.01
~A MOVW R0, #0xD70A
~A MOVT R0, #0x3C23
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--999999999.999999999
~A MOVW R0, #0x6B28
~A MOVT R0, #0x4E6E
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR

Double : 

--100
~A MOV R0, #0x0
~A MOVT R1, #0x4059
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--50
~A MOV R0, #0x0
~A MOVT R1, #0x4049
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--10
~A MOV R0, #0x0
~A MOVT R1, #0x4024
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--0.1
~A MOVW R0, #0x999A
~A MOVT R0, #0x9999
~A MOVW R1, #0x9999
~A MOVT R1, #0x3FB9
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--0.01
~A MOVW R0, #0x999A
~A MOVT R0, #0x9999
~A MOVW R1, #0x9999
~A MOVT R1, #0x3FB9
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--999999999.999999999
~A MOV R0, #0x0
~A MOVW R1, #0xCD65
~A MOVT R1, #0x41CD
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR

X64
True : 

~A8 MOV R0, #0x1
~A8 RET


False : 

~A8 MOV R0, #0x0
~A8 RET


Int : 

-- 9999
~A8 MOVK R0, #0x270F
~A8 RET
--99999999
~A8 MOVK W0, #0xE0FF, LSL #16
~A8 MOVK W0, #0x05F5, LSL #32
~A8 RET


Float : 

--100
~A8 MOVK W0, #0x0000, LSL #16
~A8 MOVK W0, #0x42C8, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--50
~A8 MOVK W0, #0x0000, LSL #16
~A8 MOVK W0, #0x4248, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--10
~A8 MOVK W0, #0x0000, LSL #16
~A8 MOVK W0, #0x4120, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--0.1
~A8 MOVK W0, #0xCCCD, LSL #16
~A8 MOVK W0, #0x3DCC, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--0.01
~A8 MOVK W0, #0xD70A, LSL #16
~A8 MOVK W0, #0x3C23, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--99999999.99999999
~A8 MOVK W0, #0xBC20, LSL #16
~A8 MOVK W0, #0x4CBE, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET


Double : 

--100
~A8 MOVZ X0, #0x0
~A8 MOVK X0, #0x0, LSL #16
~A8 MOVK X0, #0x0, LSL #32
~A8 MOVK X0, #0x4059, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--50
~A8 MOVZ X0, #0x0
~A8 MOVK X0, #0x0, LSL #16
~A8 MOVK X0, #0x0, LSL #32
~A8 MOVK X0, #0x4049, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--10
~A8 MOVZ X0, #0x0
~A8 MOVK X0, #0x0, LSL #16
~A8 MOVK X0, #0x0, LSL #32
~A8 MOVK X0, #0x4024, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--0.1
~A8 MOVZ X0, #0x999A
~A8 MOVK X0, #0x9999, LSL #16
~A8 MOVK X0, #0x9999, LSL #32
~A8 MOVK X0, #0x3FB9, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--0.01
~A8 MOVZ X0, #0x147B
~A8 MOVK X0, #0x47AE, LSL #16
~A8 MOVK X0, #0x7AE1, LSL #32
~A8 MOVK X0, #0x3F84, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--99999999.99999999
~A8 MOVZ X0, #0xFFFF
~A8 MOVK X0, #0xFFFF, LSL #16
~A8 MOVK X0, #0xD783, LSL #32
~A8 MOVK X0, #0x4197, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET

• You can find lua code to convert any value to ARM -> HERE

----> If you get an error comment it out

Edited by XEKEX
Link to comment
Share on other sites

  • 8 months later...
On 5/22/2023 at 9:17 AM, XEKEX said:


X32
True : 

~A MOV R0, #0x1
~A BX LR

False : 

~A MOV R0, #0x0
~A BX LR

Int : 

--------------------------------
-- 9999
~A MOVW R0, #0x270F 
~A BX LR
--------------------------------
-- 99999999
~A MOVW R0, #0xE0FF
~A MOVT R0, #0x05F5
~A BX LR

Float

--100
~A MOVT R0, #0x42C8
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--50
~A MOVT R0, #0x4248
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--10
~A MOVT R0, #0x4120
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--0.1
~A MOVW R0, #0xCCCD
~A MOVT R0, #0x3DCC
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--0.01
~A MOVW R0, #0xD70A
~A MOVT R0, #0x3C23
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR
-------------------
--999999999.999999999
~A MOVW R0, #0x6B28
~A MOVT R0, #0x4E6E
~A VMOV S15, R0
~A VMOV.F32 S0, S15
~A BX LR

Double : 

--100
~A MOV R0, #0x0
~A MOVT R1, #0x4059
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--50
~A MOV R0, #0x0
~A MOVT R1, #0x4049
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--10
~A MOV R0, #0x0
~A MOVT R1, #0x4024
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--0.1
~A MOVW R0, #0x999A
~A MOVT R0, #0x9999
~A MOVW R1, #0x9999
~A MOVT R1, #0x3FB9
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--0.01
~A MOVW R0, #0x999A
~A MOVT R0, #0x9999
~A MOVW R1, #0x9999
~A MOVT R1, #0x3FB9
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR
-------------------
--999999999.999999999
~A MOV R0, #0x0
~A MOVW R1, #0xCD65
~A MOVT R1, #0x41CD
~A VMOV D16, R1, R0
~A VMOV.F64 D0, D16
~A BX LR

X64
True : 

~A8 MOV R0, #0x1
~A8 RET


False : 

~A8 MOV R0, #0x0
~A8 RET


Int : 

-- 9999
~A8 MOVK R0, #0x270F
~A8 RET
--99999999
~A8 MOVK W0, #0xE0FF, LSL #16
~A8 MOVK W0, #0x05F5, LSL #32
~A8 RET


Float : 

--100
~A8 MOVK W0, #0x0000, LSL #16
~A8 MOVK W0, #0x42C8, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--50
~A8 MOVK W0, #0x0000, LSL #16
~A8 MOVK W0, #0x4248, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--10
~A8 MOVK W0, #0x0000, LSL #16
~A8 MOVK W0, #0x4120, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--0.1
~A8 MOVK W0, #0xCCCD, LSL #16
~A8 MOVK W0, #0x3DCC, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--0.01
~A8 MOVK W0, #0xD70A, LSL #16
~A8 MOVK W0, #0x3C23, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET
-----------------------------
--99999999.99999999
~A8 MOVK W0, #0xBC20, LSL #16
~A8 MOVK W0, #0x4CBE, LSL #32
~A8 FMOV S15, W0
~A8 VMOV.F32 S0, S15
~A8 RET


Double : 

--100
~A8 MOVZ X0, #0x0
~A8 MOVK X0, #0x0, LSL #16
~A8 MOVK X0, #0x0, LSL #32
~A8 MOVK X0, #0x4059, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--50
~A8 MOVZ X0, #0x0
~A8 MOVK X0, #0x0, LSL #16
~A8 MOVK X0, #0x0, LSL #32
~A8 MOVK X0, #0x4049, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--10
~A8 MOVZ X0, #0x0
~A8 MOVK X0, #0x0, LSL #16
~A8 MOVK X0, #0x0, LSL #32
~A8 MOVK X0, #0x4024, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--0.1
~A8 MOVZ X0, #0x999A
~A8 MOVK X0, #0x9999, LSL #16
~A8 MOVK X0, #0x9999, LSL #32
~A8 MOVK X0, #0x3FB9, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--0.01
~A8 MOVZ X0, #0x147B
~A8 MOVK X0, #0x47AE, LSL #16
~A8 MOVK X0, #0x7AE1, LSL #32
~A8 MOVK X0, #0x3F84, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET
-----------------------------
--99999999.99999999
~A8 MOVZ X0, #0xFFFF
~A8 MOVK X0, #0xFFFF, LSL #16
~A8 MOVK X0, #0xD783, LSL #32
~A8 MOVK X0, #0x4197, LSL #48
~A8 FMOV D16, X0
~A8 VMOV.F64 D0, D16
~A8 RET

• You can find lua code to convert any value to ARM -> HERE

----> If you get an error comment it out

Bro theres errors on THE OPCODES

~A8 MOVZ X0, #0xFFFF

~A8 MOVK X0, #0xFFFF, LSL #16

~A8 MOVK X0, #0xD783, LSL #32

~A8 VMOV.F64 D0, D16

They're all giving errors 'the errors tells me to correct them"

Link to comment
Share on other sites

  • 4 months later...
On 2/8/2024 at 6:54 AM, ZA4R said:

Bro theres errors on THE OPCODES

~A8 MOVZ X0, #0xFFFF

~A8 MOVK X0, #0xFFFF, LSL #16

~A8 MOVK X0, #0xD783, LSL #32

~A8 VMOV.F64 D0, D16

They're all giving errors 'the errors tells me to correct them"

you forget to put ~A8 FMOV D16, X0 befor the last line

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.