Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paasm: brnd using wrong relocation #26

Open
Emoun opened this issue Sep 4, 2023 · 0 comments
Open

paasm: brnd using wrong relocation #26

Emoun opened this issue Sep 4, 2023 · 0 comments

Comments

@Emoun
Copy link
Member

Emoun commented Sep 4, 2023

The brnd instruction does not assemble correctly when using paasm.

Example:

                .word   100;
                addi	r1 = r0, 123;
                addi	r2 = r0, 0;
                brnd branch_tar;           #1
                nop;
                nop;
                nop;
                halt;
                nop;
                nop;
                nop;
branch_tar:
                addi	r2 = r0, 456;
                halt;
                nop;
                nop;
                nop;

If this code is run on pasim, the following error is thrown: Program counter outside current method: 00000004

Here, #1 seems to assemble to brnd 14, however, the correct value should be brnd 8. This can also be checked by switching to br branch_tar, which produces br 8 and runs correctly on pasim. (Expect r2=456)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant