diff --git a/assemble.c b/assemble.c index 01285ee..a1a90f2 100644 --- a/assemble.c +++ b/assemble.c @@ -1241,7 +1241,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... */ } diff --git a/tests/RunTests b/tests/RunTests index fbebf29..b80f350 100755 --- a/tests/RunTests +++ b/tests/RunTests @@ -6,7 +6,7 @@ # If there is a .objd.ok file, it compares the result of dumpobj. # -TESTS="test-asciz test-backpatch test-bsl-mac-arg test-complex-reloc test-endm test-include test-locals test-macro-comma test-undef test-word-comma" +TESTS="test-asciz test-backpatch test-bsl-mac-arg test-complex-reloc test-endm test-include test-jmp test-locals test-macro-comma test-undef test-word-comma" for t in $TESTS do diff --git a/tests/test-jmp.mac b/tests/test-jmp.mac new file mode 100644 index 0000000..d9b0ca9 --- /dev/null +++ b/tests/test-jmp.mac @@ -0,0 +1,17 @@ +;;;;; +; +; Tests the addressing modes for JMP. +; JMP Rx is not allowed, all other modes are. +; + +start: jmp end + jmp r1 ; must fail + jmp (r1) + jmp (r1)+ + jmp @(r1)+ + jmp -(r1) + jmp @-(r1) + jmp 1234(r1) + jmp @1234(r1) + +end: