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

program counter

can the value in program counter be accessed,stored and modified while programming a p89lpc935..?? pls tel me how can PC be accessed since it is not listed in SFRs...

Parents
  • I'm very interested too in the reason for this need.

    Accessingthe PC while programming the chip does not sound like something anyone wants to do. It would not survive a reset. The only time it would be meaningful to set the PC externally would be in a debug session, when using a processor that can run the code from RAM.

    Or when having a setup with a boot loader, but wanting to skip the boot loader and directly debug the application.

    I can see zero reason for reading the PC while programming the chip.

    But "accessed, stored and modified" sounds more like an interest in saving the PC somewhere, then reprogram the chip, and then restore the PC to the original value. Similar to Visual Studio where a function can be modified while debugging, and the program then continue the debugging after the changes have been patched into the currently running binary.

    Alas, that requires special support from compiler/linker and in some part also from the OS/boot loader/ISP/IAP or whatever is used to control what program code the chip has.

Reply
  • I'm very interested too in the reason for this need.

    Accessingthe PC while programming the chip does not sound like something anyone wants to do. It would not survive a reset. The only time it would be meaningful to set the PC externally would be in a debug session, when using a processor that can run the code from RAM.

    Or when having a setup with a boot loader, but wanting to skip the boot loader and directly debug the application.

    I can see zero reason for reading the PC while programming the chip.

    But "accessed, stored and modified" sounds more like an interest in saving the PC somewhere, then reprogram the chip, and then restore the PC to the original value. Similar to Visual Studio where a function can be modified while debugging, and the program then continue the debugging after the changes have been patched into the currently running binary.

    Alas, that requires special support from compiler/linker and in some part also from the OS/boot loader/ISP/IAP or whatever is used to control what program code the chip has.

Children
No data