kravitz
By looking on your patch (ebook1.zip, but still valid for the following) I recognize that
.text:0000CE28 LDR R1, =aKholdD ; char *
seams to miss the [ ], thus loading the constant value 0x1160A and not the stringreference at this address.
[UPDATE] I'am wrong with this, as 0x1160a is already the string reference it should work, as the reference to .got would load the same value to the register
[/UPDATE]
IMHO it should read LDR R1, [aKhold], if this is possible.
Or maybe
LDR R3, =aKholdD
LDR R1, [R3]
My reference states:
Quote:
3.8 Load and store instructions
The ARM architecture supports two broad types of instruction which load or store the value of a single
register from or to memory:
• The first type can load or store a 32-bit word or an 8-bit unsigned byte.
• The second type can load or store a 16-bit unsigned halfword, and can load and sign extend a 16-bit
halfword or an 8-bit byte. This type of instruction is only available in ARM architecture version 4
and above.
3.8.1 Addressing modes
In both types of instruction, the addressing mode is formed from two parts:
• the base register
• the offset.
The base register can be any one of the general-purpose registers (including the PC, which allows
PC-relative addressing for position-independent code).
The offset takes one of three formats:
Immediate The offset is an unsigned number that can be added to or subtracted from the base
register. Immediate offset addressing is useful for accessing data elements that are
a fixed distance from the start of the data object, such as structure fields, stack
offsets and input/output registers.
For the word and unsigned byte instructions, the immediate offset is a 12-bit
number. For the halfword and signed byte instructions, it is an 8-bit number.
Register The offset is a general-purpose register (not the PC), that can be added to or
subtracted from the base register. Register offsets are useful for accessing arrays or
blocks of data.
Scaled register The offset is a general-purpose register (not the PC) shifted by an immediate value,
then added to or subtracted from the base register. The same shift operations used
for data-processing instructions can be used (Logical Shift Left, Logical Shift Right,
Arithmetic Shift Right and Rotate Right), but Logical Shift Left is the most useful
as it allows an array indexed to be scaled by the size of each array element.
Scaled register offsets are only available for the word and unsigned byte
instructions.
As well as the three types of offset, the offset and base register are used in three different ways to form the
memory address. The addressing modes are described as follows:
Offset The base register and offset are added or subtracted to form the memory address.
|
PS: just working on Joystick-hold for the 505