4/24/2023 0 Comments Jmp assembly![]() The JMP (addr,X) instruction is present in later 65xx processors (65C02, 65C802/65C816). This will first print out the required character, but when the CPU encounters the "final RTS" at the end of the CHROUT routine, this serves to return from not just CHROUT, but of the entire message-printing routine.Įmulating JMP (addr,X) LDA #13 Print carriage return JMP CHROUT Leave this routine through CHROUT LDA #13 Print carriage return JSR CHROUT using CHROUT RTS Message done - return to caller.īut since the call to a subroutine (the JSR CHROUT) is immediately followed by an RTS, there is the option of saving a byte and 9 machine cycles by JuMP-ing directly into the subroutine: The "standard way" to print the this would be: After printing all characters of the messages, a carriage return control character is to be printed, before the message routine ends in an RTS. fetched from a table of several messages. ![]() Normally, subroutines are called with a JSR, but consider some routine that prints out a message, e.g. This allows the user to "divert" parts of BASIC or KERNAL to custom routines. ![]() JMP is the only instruction in the 65xx instruction set which supports the purely indirect addressing mode, and this indirect JMP provides for the use of vectors: While the user has no easy access to modify the contents of either BASIC or KERNAL ROM, both these parts of the system makes ample use of vectors, set in RAM that the user can modify. To those familiar with BASIC programming this is the machine language equivalent to GOTO. JMP (short for " Ju MP") is the mnemonic for a machine language instruction which unconditionally transfers program execution to the specified address.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |