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

Store PC to different from memory and register?

I,m using keil uVison4.22 and the device is arm7 ,I am testing about SubroutineCall,but found a doubt that the code store the r15(PC) to the address r13 of memory,and the value is PC + 12 ,if i use mov instructions to anyOne register is PC + 8 correct . but why?

AREA SubroutineCall,CODE,READWRITE

	ENTRY

	ADR r13,Stack
	
	SUB r13,r13,#4
	
	STR r15,[r13] 
	
	B Target
	
	MOV r0,#0xFF
	
	MOV r0,#0x18
	
	LDR r1,=0x20026
	
	SVC #123456
	
Target MOV r1,#0xAA
	
	LDR r12,[r13],#+4
	
	SUB r12,r12,#4
	
	MOV r15,r12



	AREA SubroutineCall,DATA,READWRITE
	
	SPACE 64
	
Stack DCD 0x00000000
	
	END

so, what is the different store PC into between memory and register? because of the pipeline?

Parents Reply Children
No data