This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Basic register write data changes in assembly when NOP added

Hi all,

I am doing a basic register read/write on a custom SoC with ARM Cortex A53 and many other peripherals added with an AXI fabric integrated. 
Using the below code in assembly after bringing up the CPU (proper exception handling and reset vector inits) I could read from a memory mapped location 0x4000_0014 (in my design it is a UART register having data 0x60) and write in the internal memory location 0x400.

// Read the UART LCR REG. expected value is 0x60
MOV R2,#0
LDR R2,=#0x40000014
MOV R3,#0x55
LDR R3,[R2]
NOP
NOP
NOP

// Write whatever found in read (0x60) to memory 0x400
LDR R4,=#0x400
STR R3,[R4]

However if I added a few NOPs between the LDR as shown below, the data that is written becomes different (0x1b8)

// Read the UART LCR REG. expected value is 0x60
MOV R2,#0
LDR R2,=#0x40000014
NOP

MOV R3,#0x55
NOP

LDR R3,[R2]
NOP
NOP
NOP

// Write whatever found in read (0x60) to memory 0x400
LDR R4,=#0x400
STR R3,[R4]

Can someone please explain why this NOP changes the way the data is read?