Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

6502 assembly JMP

If I use this opcode

JMP
Jump to New Location

(PC+1) -> PCL
(PC+2) -> PCH
N   Z   C   I   D   V
-   -   -   -   -   -
addressing  assembler   opc bytes   cycles
absolute    JMP oper    4C  3   3  

and give it a hex value of say 0x0604 will it jump to that location execute what’s there and then continue until it gets back to the JMP statement, or will it execute whats at 0x0604 and then do the next instruction after the JMP

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

A JMP $0604 instruction will change the program counter to the value $0604 and then start executing the instructions starting at address $0604. It will not return back to the instruction after the JMP. To accomplish that you need to change the JMP to a JSR, and make sure the subroutine code at $604 has an RTS instruction to return from the subroutine.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading