Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/23/04 06:36
Read: times


 
#77985 - RE: Modifying the program counter
Responding to: ???'s previous message
hi,
	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
The idea is right but just do not forget '#' next time:
	add	a,#low(base_addr)	;Calculate low order address
	push	acc			;put it on the stack
	clr	a
	addc	a,#high(base_addr)	;Calculate high order address
	push	acc			;Both bytes on the stack now
	ret
...and do correct calculations as well.

Regards,
Oleg

List of 14 messages in thread
TopicAuthorDate
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      

Back to Subject List