daniilS
busy trying to do stuff not done yet
- 409
- Posts
- 11
- Years
- Seen Jan 29, 2024
I read some tutorials on ASM, but there are many things that I don't understand. So, I decided to do something with ASM, something very simple but to no avail. I wanted to do a routine that adds 2 numbers and then create a script using XSE and insert it to somebody.
Here's my ASM:
Spoiler:.text
.align 2
.thumb
.thumb_func
main:
push {r0-r2,lr}
sub r1, r1, r1 @ cleans r1, so it's now 0
add r1, #0xF @ adds F/15 to r1 which means r1 = 15 now
sub r0, r0, r0 @ r0 = 0
add r0, #0xC @ adds C/12 to r0 so r0 = 12 now
add r2, r0, r1 @ adds F and C to r2, so r2 = 1B/27
pop {r0-r2,pc}
.align 2
I also don't know why, but sometimes this code couldn't compile. I had to change some lines(for example adding r2 register). Oh and is pushing and popping necessary here? FBI mentioned earlier that registers r0-r4 don't have to be pushed.
I inserted this routine at 0x8378D0.
And here's my XSE code:
Spoiler:#dynamic 0x800000
#org @start
callasm 0x8378D1
buffernumber 0x0 LASTRESULT
msgbox @a 0x2
end
#org @a
= Does it work? [buffer1]
Unfortunately it doesn't work. When I talk with a person who I assigned the script to I get "Does it work? 1".
Could someone help, please?
I've sent you a vm