summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2023-08-12 23:50:12 +0300
committerOxore <oxore@protonmail.com>2023-08-12 23:55:42 +0300
commitbac14a58c850e4b3b7fad4e145952c6fd0725015 (patch)
tree72015d94b5b96d7a390c89ff50a6c61510c78ad2
parent2c7aba23cbb753860cd3a16e202239061797826e (diff)
Fix (d8,An,Xi) parsing, just a bit
-rw-r--r--main.c3
-rwxr-xr-xtest.sh1
-rw-r--r--tests/test4.S2
3 files changed, 6 insertions, 0 deletions
diff --git a/main.c b/main.c
index 3cac095..f718149 100644
--- a/main.c
+++ b/main.c
@@ -2401,6 +2401,9 @@ static int pars_parse_arg_inside_parens(
// It is (d8,An,Xn)
assert((state.an2_found && !state.dn_found) || (!state.an2_found && state.dn_found));
arg->type = ARG_AN_ADDR_8_XI;
+ // FIXME an1 can be just an index register if it has size specifier, in
+ // that case an2 should be used here
+ arg->xn = state.an1;
arg->xi = state.an2_found ? (state.an2 | 0x8) : state.dn;
arg->num_tokens = self->cur_tok_id - arg->first_token;
arg->briefext_size = state.size;
diff --git a/test.sh b/test.sh
index acc8151..5fe9d5c 100755
--- a/test.sh
+++ b/test.sh
@@ -13,4 +13,5 @@ END
echo "asm68 -l -Q -o test1.o test1.S" >>"$dosbuild_dir/build.bat"
echo "asm68 -l -Q -o test2.o test2.S" >>"$dosbuild_dir/build.bat"
echo "asm68 -l -Q -o test3.o test3.S" >>"$dosbuild_dir/build.bat"
+echo "asm68 -l -Q -o test4.o test4.S" >>"$dosbuild_dir/build.bat"
dosemu -quiet -K "$dosbuild_dir" -E'build.bat'
diff --git a/tests/test4.S b/tests/test4.S
new file mode 100644
index 0000000..cadc9c2
--- /dev/null
+++ b/tests/test4.S
@@ -0,0 +1,2 @@
+ move.b 0(a3,d0.w),-(a2)
+ move.b 0(a4.w,a3),-(a2)