shattered / macro11

A MACRO-11 assembler for the PDP-11 in portable C source code. Copyright (c) 2001, Richard Krehbiel
BSD 3-Clause "New" or "Revised" License
28 stars 9 forks source link

bug: can't assemble 'jmp (r0)' #6

Closed bjorend closed 4 years ago

bjorend commented 4 years ago

The assembler can't handle the following instruction:

jmp (r0)

It issues the error:

JMP Rn is illegal

I believe the error is in assemble.c:

diff --git a/assemble.c b/assemble.c index 67f0052..47856b1 100644 --- a/assemble.c +++ b/assemble.c @@ -1136,7 +1136,7 @@ static int assemble( return 0; } ` - if (op->value == 0100 && (mode.type & 07) == 0) { + if (op->value == 0100 && (mode.type & 070) == 0) { report(stack->top, "JMP Rn is illegal\n"); / But encode it anyway... / }`

which is meant to detect attempts to assemble unexecutable instructions like: jmp r0

Rhialto commented 4 years ago

Hi @bjorend, I don't think this repo is being maintained any more, but there is my fork: https://gitlab.com/Rhialto/macro11 where this bug has been fixed in commit https://gitlab.com/Rhialto/macro11/-/commit/a24e3ba3 .

shattered commented 4 years ago

Closing, please follow Rhialto's fork as mentioned above.