Skip to content

Labels should not appear as instructions when using REPL #55

@Flu

Description

@Flu

Is your feature request related to a problem? Please describe.
When using the REPL, or in general executing any program, labels in the source code appear as if they were instructions. This is a problem with the resolveLabels functions, as it does not remove the labels from the program when trying to figure out what address each label corresponds to.

Describe the solution you'd like
The resolveLabel function and its associated functionality should first store where the labels are, delete the labels entirely from the program and build the jump table, then start replacing the instructions so an instruction of type JMP label gets translated to a JMPR relative_address.

Doing it this way would unfortunately not show labels anymore when debugging, but that could be fixed in another issue. However, it would make the PC register accurate for once.

Describe alternatives you've considered
One alternative was to just skip printing labels, but that was more of a hack and would still update the PC and when stepping once, from the point of the user it would appear like no step was taken. That would be completely unacceptable behaviour.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthacktoberfest-2025Perfect bugs/enhancements for Hacktoberfest 2025needs-discussionNeed of further discussion by the contributors

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions