We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have an Atmel t89c51cc01 microcontroller. Now i want to write something in the PC (program counter. How can i do this and what is the adress of the PC???
why?
The PC is not an SFR so you can't change it that way. There is a really cool instruction that changes the PC. It's called JMP. When you use the JMP instruction, the number you specify after the JMP is loaded into the PC. For example, the following:
JMP 1234h
PUSH the two bytes of the new PC value on the stack (in the same order a CALL would) and execute a RET instruction.
Or put the required address in the A+DPTR and use JMP @A+DPTR.