Skip to content

Add RJMP and RCALL as aliases for JMP and CALL #50

@Flu

Description

@Flu

Is your feature request related to a problem? Please describe.
When taking assembly files, usually compilers/people use RJMP and RCALL when they're not jumping far. We don't have these instructions and therefore the parser will reject them.

Describe the solution you'd like
Since all our branch and jump instructions function on the same technique (i.e. jumping to a relative position to the PC), there is no architecture change needed. They will function exactly as their non-relative cousins, JMP and CALL, just with different names. In an actual pocessor, they would be implemented differently, since JMP holds the address to jump to as an immediate value instead of a relative address. Ours don't. But it doesn't make any difference from the perspective of the programmer, behaviour-wise.

So what I propose is to add parsers for RJMP and RCALL that will return JMP and CALL instructions instead, therefore eliminating the issue. Nothing else needs to be changed, since JMP and CALL are already implemented.

Describe alternatives you've considered
I debated whether to overhaul the jump mechanism, and we will probably do that in the future, but for now, this works fine and has the same result.

Additional context
Don't forget to add the new instructions to the README.md and make tests for these new instructions. You can more or less just copy the already made test files for CALL and JMP and modify them to use RCALL and RJMP, and they should behave the same. If there are any questions, leave them here as comments.

Also, please leave a comment if you want to work on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershacktoberfest-2025Perfect bugs/enhancements for Hacktoberfest 2025parserConcerning the parser/fron-end

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions