Help! error hex to arm

power2020202020

Solid & Active Platinian
Original poster
Nov 3, 2022
58
15
8
34
brazil
hello, I don't understand until 65 thousand the arm converts more 100000 it gives an error

example

65000

MOV R0, #65000
BX LR

arm

E80D0FE3 1EFF2FE1

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

100000 this error

100000

MOV R0, #18000
MOV R1, #82000
ADD R0, R1
BX LR

arm

50 06 04 E3 **not supported** 01 00 80 E0 1E FF 2F E1
 

Vector4

Platinian
Jun 6, 2022
13
14
3
23
Ireland
The MOV instruction only supports integers from -257 to 65536.
This is because of how the instructions are encoded within 4 bytes.
You can use a relative load with LDR R#, [PC, #offset]

i.e.
Code:
ldr r0, [pc, 0] ; note that due to pipelining PC is always the current instruction + 8, so that's why offset is 0
bx lr
.int 123456789
(armconverter result)