Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Non PC-relative branch targets are incorrect #83

Open
@dylanmckay

Description

@dylanmckay

RJMP .+12 is properly encoded.
RJMP 12 is not.

In fact they are treated and encoded the same.

All relative jump targets act as if there is an implicit .[+][-] in front of them.

rjmp 12 is currently the same as rjmp .+2.

GCC does not do this. It treats 12 as an absolute address, and then subtracts it from the program counter to create a relative address, and this will then be the operand to the relative branch.

I don't think this is particularly high priority, as it is very uncommon (and bad practice) to use magic numbers in branch instructions (labels should be used instead). However, this is still not the correct output so it's still very important.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions