@eamon Yep, exactly. Unless you need to do pointer arithmetic(like get the routine address dynamically) you should always use immediate calls. In this case, I wouldn't manually choose to JSR to it, I'd use a relative immediate call.
Top-level
@eamon Yep, exactly. Unless you need to do pointer arithmetic(like get the routine address dynamically) you should always use immediate calls. In this case, I wouldn't manually choose to JSR to it, I'd use a relative immediate call. 2 comments
|
@eamon JSR/JMP/JCN opcodes are so you can run routines from a pointer, but in normal times, you should almost never use those. Left has a single JSR2 opcode for example:
https://git.sr.ht/~rabbits/left/tree/main/item/src/left.tal#L174