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

Disassembly on Debug

I debug my code and realize that there are some code lines highlighted yellow. I dont know what that means. Also, what is @0x08000038 in the code?

Here is my code:

	AREA RESET, DATA, READONLY
	DCD 0x20001000 ;stack pointer
	DCD MAIN
	
	AREA DATA1, DATA, READONLY
KhoaK
	DCB 5, 10, 15, 20, 25
	DCB 4, 9, 14, 19, 24
	DCB 3, 8, 13, 18, 23
	DCB 2, 7, 12, 17, 22
	DCB 1, 6, 11, 16, 21, 0
XauRo DCB "ABEFZ", 0

	AREA DATA2, DATA, READWRITE
XauMa DCB 0
	AREA MYCODE, CODE, READONLY
	ENTRY
MAIN
	LDR R0, =XauRo
	LDR R1, =KhoaK
	LDR R2, =XauMa
BanDau
	LDRB R3, [R0]
	CMP R3, #0
	BEQ KetThuc
	ADD R0, #1
	SUB R3, #65
	MOV R4, R1
	ADD R4, R3
	LDRB R5, [R4]
	ADD R5, #65
	STRB R5, [R2]
	ADD R2, #1
	B BanDau
KetThuc
	LDR R0, =XauRo
	LDR R1, =XauMa
Stop
	B Stop
	END

Parents
  • An instruction like "ldr r, =constant", for values of "constant" that do not "compress" to the special formats, uses "literal" addressing (see section A7.7.44 of the ARMv7m ARM, for example, although the "standard" syntax is different.)
    In the case of literal addressing, the assembler will find a "convenient" location in the program memory and stick the constants there, and the LDR instruction will use PC relative addressing to load them.  The x08000038 is the address where the constant is stored (your actual LDR instruction is at 0x8000008, and the constants have been placed 0x..34 - 0x..38, well within the range of PC-relative address.  The collection of constants meant to be addressed this was is know as a "literal pool."
    https://developer.arm.com/documentation/dui0473/m/dom1359731147760

Reply
  • An instruction like "ldr r, =constant", for values of "constant" that do not "compress" to the special formats, uses "literal" addressing (see section A7.7.44 of the ARMv7m ARM, for example, although the "standard" syntax is different.)
    In the case of literal addressing, the assembler will find a "convenient" location in the program memory and stick the constants there, and the LDR instruction will use PC relative addressing to load them.  The x08000038 is the address where the constant is stored (your actual LDR instruction is at 0x8000008, and the constants have been placed 0x..34 - 0x..38, well within the range of PC-relative address.  The collection of constants meant to be addressed this was is know as a "literal pool."
    https://developer.arm.com/documentation/dui0473/m/dom1359731147760

Children
No data