|
This is the result if we have paging
movw r0, #:lower16:x movt r0, #:upper16:x ldr rr, [r0] // r0 contains the address of x .... .... x: .4bytes 7777 |
Suppose the variable
x: .4byte 7777 |
is stored at memory address 34708.
Then the symbol x is equal to the numeric value 34708
Address What is stored in memory at this address ========================================================== 0: movw r0, #:lower16:34708 (in binary) 4: movt r0, #:upper16:34708 (in binary) 8: ldr rr, [r0] // r0 contains 34708 .... .... 34708: 7777 (in binary) --- 4 byte memory for variable x |
(Each ARM instruction occupies 4 bytes of memory)
We keep things simple so focus teaching assembler programming....
Suppose we load the program at memory location 51200 and executed it:
|