- 325
- Posts
- 10
- Years
- Antarctica
- Seen Apr 1, 2020
Ah well, had to start somewhere, even if it was 'get good scrub'.I can't even tell what you are trying to do, but I'll do my best. It looks as though you are loading a ROM offset rather than an address. ROM is prefixed by 08/09, you have prefixed it with 00 (BIOS). In fact this address is invalid and will be ignored by VBA - the bios is only 16kb. Hardware will do weird things.
Next, you load two half words, add 5, then load the addresses again? Why? I think what you are trying to do is store to those addresses, but you'd need str, strh or strb to do that. If I'm right about these being ROM offsets, then you clearly don't understand the concept of ROM. You can't right to it. Ever. There are a few bytes of ROM address space reserved for GPIO for sensors, and this is the only exception.
Lastly, you're wasting stack space. Neither R0, R1 or LR need to be pushed.
I suggest you read some tutorials and look at existing code so you actually understand what you're doing, rather than fumbling around in the dark.
Thank you for the information on the ROM offsets. I actually had no idea that it had to be 08. And I think I understand that more now, thanks.