From 4b0a1feb2a2a12cec9ffc76f4a34e88b5e53a604 Mon Sep 17 00:00:00 2001 From: wfjm Date: Sun, 22 Jan 2023 09:32:48 +0100 Subject: [PATCH] asm-11 BUGFIX: misused # and @ don't cause BUGCHECKs anymore --- doc/CHANGELOG.md | 4 +++- tools/asm-11/tests/zbug_0005.mac | 20 ++++++++++++++++++++ tools/bin/asm-11 | 11 ++++++----- 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 tools/asm-11/tests/zbug_0005.mac diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index a0268459..896cc65f 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -31,7 +31,9 @@ The full set of tests is only run for tagged releases. ### New features ### Changes ### Bug Fixes - - tools/bin/asm-11: BUGFIX: support @(R) modifier with omitted offset + - tools/bin/asm-11: + - BUGFIX: support @(R) modifier with omitted offset + - BUGFIX: misused # and @ don't cause BUGCHECKs anymore --- diff --git a/tools/asm-11/tests/zbug_0005.mac b/tools/asm-11/tests/zbug_0005.mac new file mode 100644 index 00000000..d2009cee --- /dev/null +++ b/tools/asm-11/tests/zbug_0005.mac @@ -0,0 +1,20 @@ +; $Id: zbug_0005.mac 1352 2023-01-22 08:29:50Z mueller $ +; SPDX-License-Identifier: GPL-3.0-or-later +; Copyright 2023- by Walter F.J. Mueller +; +; for asm-11 prior rev 1350 +; +; ISSUE: faulty @(R) handling +; - asm-11 refused with a 'Q' error +; - macro-11 accepts as equivalent to @0(R) +; +; REASON: parser error +; + .asect + . = 400 + + mov r0,@(r1) ;;!! 000400: 010071 000000 + cmp @(r2),r0 ;;!! 000404: 027200 000000 + cmp @(r2),@(r3) ;;!! 000410: 027273 000000 000000 + + .end diff --git a/tools/bin/asm-11 b/tools/bin/asm-11 index 95db4988..5d795e80 100755 --- a/tools/bin/asm-11 +++ b/tools/bin/asm-11 @@ -1,10 +1,11 @@ #!/usr/bin/perl -w -# $Id: asm-11 1351 2023-01-13 08:38:27Z mueller $ +# $Id: asm-11 1352 2023-01-22 08:29:50Z mueller $ # SPDX-License-Identifier: GPL-3.0-or-later # Copyright 2013-2023 by Walter F.J. Mueller # # Revision History: # Date Rev Version Comment +# 2023-01-13 1352 1.1.5 BUGFIX: misused # and @ don't cause BUGCHECKs anymore # 2023-01-12 1351 1.1.4 BUGFIX: support @(R) modifier with omitted offset # 2022-07-28 1264 1.1.3 add -E and -M options # 2022-07-23 1262 1.1.2 BUGFIX: '100(pc)' was compiled as '100' @@ -1735,8 +1736,8 @@ sub get_token1 { if ($c =~ m/^(\*|\/|\&|\!)$/ ) { # binary operators return finish_token(\%t, tag=> 'OP', typ=> 'b', val=> shift @$rcl); } - if ($c =~ m/^(\#|\@)$/ ) { # unary operators - return finish_token(\%t, tag=> 'OP', typ=> 'u', val=> shift @$rcl); + if ($c =~ m/^(\#|\@)$/ ) { # prefix operators + return finish_token(\%t, tag=> 'OP', typ=> 'p', val=> shift @$rcl); } # ' and " operator @@ -2547,8 +2548,8 @@ sub dump_rl { $$rl{psect}, $$rl{dot}; my $i = 0; foreach my $rt (@{$$rl{tl}}) { - printf " tl[%2d]: tag=%-4s, om=%-2s, em=%-2s, val='%s'", - $i, $$rt{tag}, savestr1($$rt{om}), savestr1($$rt{em}), + printf " tl[%2d]: tag=%-4s, typ=%-2s, om=%-2s, em=%-2s, val='%s'", + $i, $$rt{tag}, savestr1($$rt{typ}), savestr1($$rt{om}), savestr1($$rt{em}), savestr($$rt{val}); printf ", nval=%6.6o",$$rt{nval} if defined $$rt{nval}; printf ", pend=%d",$$rt{pend} if defined $$rt{pend};