|ARM Technical Support Knowledge Articles|
Applies to: A51 Macro Assembler
Information in this article applies to:
How can I get the address currently in the program counter?
The 8051 has no direct way to read the program counter. However, there are several tricks you can use to get the contents of the program counter. Note that the address in the program counter is a 16-bit value. And, the program counter changes while executing code to get its address.
At this point, DPTR contains the address of the MOV DPTR instruction.
LCALL here here: POP DPH POP DPL
At this point, DPTR contains the address of the here label.
Article last edited on: 2007-01-08 15:41:49
Did you find this article helpful? Yes No
How can we improve this article?