??? 09/23/04 06:26 Read: times |
#77983 - RE: Modifying the program counter Responding to: ???'s previous message |
An alternative to jmp @a+dptr, especially if you need the dptr already for something else, or if you need a bigger range than jmp @a+dptr is capable of is to calculate the address where you want to go, push it on the stack and then execute a RET instruction. This will also get you where you want to go.
Example: add a,low(base_addr) ;Calculate low order address push acc ;put it on the stack mov a,high(base_addr) ;Calculate high order address push acc ;Both bytes on the stack now ret ;Pop them and put them in the PC |
Topic | Author | Date |
Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter![]() | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 | |
RE: Modifying the program counter | 01/01/70 00:00 |