diff options
author | Oxore <oxore@protonmail.com> | 2023-04-29 12:40:11 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2023-04-29 12:40:11 +0300 |
commit | e8db23a8b94edad65dfede4ae2077c6788e53de0 (patch) | |
tree | 77cd1b4f3ea1a6ec5d2acceff1ec237cf6aa2764 | |
parent | 4fd3c8816225d8241b4ba8e6e87722992fa7171e (diff) |
Fix some edge case for dbcc found on random tests
-rw-r--r-- | disasm.cpp | 2 | ||||
-rw-r--r-- | test.bash | 7 |
2 files changed, 7 insertions, 2 deletions
@@ -728,7 +728,7 @@ static void disasm_dbcc(DisasmNode& node, uint16_t instr, const DataBuffer &code const uint32_t branch_addr = static_cast<uint32_t>(node.offset + dispmt_raw); node.branch_addr = branch_addr; node.has_branch_addr = true; - const int16_t dispmt = dispmt_raw + kInstructionSizeStepBytes; + const int32_t dispmt = dispmt_raw + kInstructionSizeStepBytes; snprintf(node.mnemonic, kMnemonicBufferSize, "%s", mnemonic); const char * const sign = dispmt >= 0 ? "+" : ""; // FIXME support s.rel_marks option for this instruction @@ -32,7 +32,7 @@ run_test_simple() { echo -ne "Test \"${test_name}\"... " echo -ne "${data}" >${file_orig_bin} ${DISASM} -t ${TRACE_FILE} -o ${file_asm} ${file_orig_bin} - ${AS} -o ${file_as_o} ${file_asm} + ${AS} -m68000 -o ${file_as_o} ${file_asm} ${LD} -o ${file_as_elf} ${file_as_o} ${OBJCOPY} ${file_as_elf} -O binary ${file_as_bin} if ! cmp ${file_orig_bin} ${file_as_bin} >/dev/null 2>&1; then @@ -157,6 +157,11 @@ run_test_iterative "seq Xn" "\x57" 0xc0 8 1 run_test_simple "dbt negative displacement" "\x50\xcf\xff\xfc" run_test_simple "dbt positive displacement" "\x50\xcf\x01\x08" +# 50c9 7ffe +# +# From random tests +run_test_simple "dbt %d1,.+32768" "\x50\xc9\x7f\xfe" + # 60xx # run_test_simple "bras negative displacement" "\x60\xfc" |