#9760 - Omega81 - Sat Aug 16, 2003 3:47 pm
Hello everyone.
I have a little problem (a few to be exact but that will be for later). the LDR insuct is only support to be used for loading data from memory to a register isn't it? I mean in Gbaguy's tutorial (http://k2pts.home.comcast.net/gbaguy/day23.htm) he use it to load immediate data directory to a register, this should work as there is only 12bit in the instruction encoding for immedate address so a 26bit address should fail (e.g. ldr r2,=0x6000200). Well my problem is it doesn't and I don't understand why, I am guessing the assembler treats the inclusion of the '=' sign as an immediate assignment and works out the shifts itself. please can anyone correct me if I am wrong or verifiy I am right.
thank you
I have a little problem (a few to be exact but that will be for later). the LDR insuct is only support to be used for loading data from memory to a register isn't it? I mean in Gbaguy's tutorial (http://k2pts.home.comcast.net/gbaguy/day23.htm) he use it to load immediate data directory to a register, this should work as there is only 12bit in the instruction encoding for immedate address so a 26bit address should fail (e.g. ldr r2,=0x6000200). Well my problem is it doesn't and I don't understand why, I am guessing the assembler treats the inclusion of the '=' sign as an immediate assignment and works out the shifts itself. please can anyone correct me if I am wrong or verifiy I am right.
thank you