openc166 0.2.7__tar.gz → 0.2.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openc166-0.2.7 → openc166-0.2.8}/CMakeLists.txt +1 -1
- {openc166-0.2.7 → openc166-0.2.8}/PKG-INFO +1 -1
- {openc166-0.2.7 → openc166-0.2.8}/docs/simulator.md +3 -2
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/cpu.cpp +14 -1
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_sim.cpp +29 -0
- {openc166-0.2.7 → openc166-0.2.8}/.gitattributes +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/.github/workflows/ci.yml +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/.github/workflows/wheels.yml +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/.gitignore +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/LICENSE +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/README.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/boards/5wy19.json +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/boards/c166.json +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/boards/c167.json +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/boards/c167cr.json +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/boards/c167cs.json +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/cli/CMakeLists.txt +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/cli/main.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/cmake/embed_files.cmake +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/boards.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/compatibility.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/debug-info.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/debugger-design.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/ghidra.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/mpl.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/phase1-feasibility.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/releasing.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/docs/tasking.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/editors/vscode/README.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/editors/vscode/extension.js +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/editors/vscode/package.json +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/mtos/README.md +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/mtos/bsl_shim.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/mtos/driver_patch.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/mtos/kline_hello.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/mtos/loader.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/mtos/marker.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/mtos/memory_dump.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/mtos/stage2_hello.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/payload.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/examples/sections.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/inc/REG167.INC +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/include/openc166/openc166.h +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/pyproject.toml +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/openc166/__init__.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/openc166/_native.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/openc166/bridge.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/openc166/dap.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/openc166/ghidra.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/openc166/py.typed +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/openc166/sim.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/tests/test_bridge.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/tests/test_dap.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/tests/test_elf.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/tests/test_ghidra.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/tests/test_openc166.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/tests/test_sim.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/python/tests/test_stock_5wy19.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/CMakeLists.txt +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/assembler.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/assembler.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/bundled.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/bundled.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/capi.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/capi.map +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/capi_sim.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/debuginfo.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/diag.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/disasm.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/disasm.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/disasm_module.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/elf.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/encode.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/encode.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/expr.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/expr.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/isa/c166.tbl +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/isa/isa.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/isa/isa.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/isa/isa_types.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/json.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/json.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/lexer.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/lexer.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/m166.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/m166.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/mpl.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/mpl.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/operand.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/operand.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/output.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/predef.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/predef.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/board_config.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/board_config.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/boards.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/boards.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/debug.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/debug.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/machine.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/machine.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/peripherals.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/sim/peripherals.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/src/value.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/CMakeLists.txt +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/acceptance/minimon.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/capi/test_capi.c +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/check_binary.cmake +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/alignment.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/bit_section_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/bit_sections.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/bits.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/branches.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/cond.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/cond_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/controls.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/defs.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/directives.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/dpp.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/expressions.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/group_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/groups.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/code.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/comments.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/count.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/crlf.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/ignored.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/lit.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/mpl.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/nested.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/noeol.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/regs.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/sub/deep.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/inc/sub/level3.inc +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/include.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/label_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/labels.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/bits/1main.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/bits/2lib.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/bits/3more.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/calls/1main.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/calls/2lib.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/combine/1first.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/combine/2second.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/combine/3third.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/fixups/1use.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/fixups/2def.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/groups/1main.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/groups/2lib.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/mixed/1seg.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/mixed/2flat.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/mixed/3seg.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/regbanks/1main.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/regbanks/2lib.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/sections/1first.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/sections/2second.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/sections/3third.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/segmented/1main.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/segmented/2lib.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/unresolved/1main.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/unresolved/2one.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/unresolved/3two.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/values/1use.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/link/values/2def.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/listing.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/lit.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/lit_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/locate.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/macro_args.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/macro_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/macros.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl_err_exit.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl_err_expr.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl_err_fi.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl_err_meta.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl_err_paren.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl_err_pattern.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl_err_syntax.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/mpl_err_undefined.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/operands.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/primary.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/redefine.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/regbank_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/regbanks.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/reloc.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/section_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/section_length.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/segmented.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/type_operator_errors.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/cases/type_operators.a66 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/gen_sweep.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/diff/keil_diff.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/expected/driver_patch.hex +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/expected/driver_patch.s28 +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/expected/payload.srec +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/helpers.hpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/main.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_assembler.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_bits.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_boards.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_branches.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_cond.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_debug.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_defs.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_dpp.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_encode.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_expr.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_groups.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_include.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_json.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_lexer.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_link.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_listing.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_lit.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_macros.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_mpl.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_output.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_peripherals.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_regbanks.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_sections.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tests/unit/test_tasking.cpp +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/third_party/doctest/LICENSE.txt +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/third_party/doctest/doctest.h +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tools/CMakeLists.txt +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tools/ghidra/ExportOpenc166Symbols.py +0 -0
- {openc166-0.2.7 → openc166-0.2.8}/tools/isagen.cpp +0 -0
|
@@ -182,8 +182,9 @@ they are not part of snapshots, so reverse execution does not replay them.
|
|
|
182
182
|
## What the core models, and how closely
|
|
183
183
|
|
|
184
184
|
- The whole instruction set, decoded from `src/isa/c166.tbl`. Flags follow
|
|
185
|
-
the instruction set manual;
|
|
186
|
-
|
|
185
|
+
the instruction set manual; an instruction that writes PSW itself
|
|
186
|
+
(`POP PSW`, `BCLR PSW.3`) keeps the value written, not its flag
|
|
187
|
+
update. They are checked by unit tests, not yet against a real C167 (design §6: the MiniMon oracle is the next step).
|
|
187
188
|
- Register banks in IRAM through CP; DPP paging; EXTR, EXTP(R), EXTS(R)
|
|
188
189
|
and ATOMIC, which also block interrupts. The debugger steps a sequence as
|
|
189
190
|
one unit.
|
|
@@ -105,6 +105,11 @@ struct Exec {
|
|
|
105
105
|
};
|
|
106
106
|
PostInc post[2] = {};
|
|
107
107
|
int npost = 0;
|
|
108
|
+
// The flag update, applied when the instruction completes unless it
|
|
109
|
+
// wrote PSW itself: the explicit write takes precedence.
|
|
110
|
+
std::uint16_t flags_set = 0;
|
|
111
|
+
std::uint16_t flags_mask = 0;
|
|
112
|
+
bool psw_written = false;
|
|
108
113
|
|
|
109
114
|
// An operand location: a memory address or an immediate.
|
|
110
115
|
struct Loc {
|
|
@@ -194,6 +199,7 @@ struct Exec {
|
|
|
194
199
|
}
|
|
195
200
|
void write(const Loc& l, bool b, std::uint16_t v) {
|
|
196
201
|
if (l.imm) return;
|
|
202
|
+
if (!l.gpr && (l.addr & 0xFFFFFE) == reg::PSW) psw_written = true;
|
|
197
203
|
if (b) return m.write8(l.addr, static_cast<std::uint8_t>(v));
|
|
198
204
|
if ((l.addr & 1) && !l.gpr) throw TrapAbort{kIllopa};
|
|
199
205
|
m.write16(l.addr, v);
|
|
@@ -205,8 +211,13 @@ struct Exec {
|
|
|
205
211
|
}
|
|
206
212
|
|
|
207
213
|
void flags(std::uint16_t set, std::uint16_t mask) {
|
|
214
|
+
flags_set = static_cast<std::uint16_t>((flags_set & ~mask) | (set & mask));
|
|
215
|
+
flags_mask |= mask;
|
|
216
|
+
}
|
|
217
|
+
void commit_flags() {
|
|
218
|
+
if (psw_written || !flags_mask) return;
|
|
208
219
|
const std::uint16_t p = m.psw();
|
|
209
|
-
const std::uint16_t v = static_cast<std::uint16_t>((p & ~
|
|
220
|
+
const std::uint16_t v = static_cast<std::uint16_t>((p & ~flags_mask) | (flags_set & flags_mask));
|
|
210
221
|
m.sfr_set(reg::PSW, v);
|
|
211
222
|
// Flag updates are not bus accesses, but watchpoints on PSW bits
|
|
212
223
|
// must see them.
|
|
@@ -757,8 +768,10 @@ Stop Machine::step() {
|
|
|
757
768
|
const bool starts_sequence = info.op >= Op::Atomic && info.op <= Op::Extsr;
|
|
758
769
|
try {
|
|
759
770
|
ex.run();
|
|
771
|
+
ex.commit_flags();
|
|
760
772
|
ip_ = ex.next_ip;
|
|
761
773
|
} catch (const TrapAbort& t) {
|
|
774
|
+
ex.commit_flags(); // as far as the instruction got
|
|
762
775
|
ip_ = static_cast<std::uint16_t>(ip_ + insn->size);
|
|
763
776
|
raise_trap(t.bit);
|
|
764
777
|
}
|
|
@@ -185,6 +185,35 @@ TEST_CASE("sim: bit instructions") {
|
|
|
185
185
|
CHECK(m->gpr(5) == 0);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
TEST_CASE("sim: an explicit PSW write takes precedence over the flags") {
|
|
189
|
+
// POP sets N, Z and E from the value popped, MOV from the value moved;
|
|
190
|
+
// with PSW as the destination the value written is what stays.
|
|
191
|
+
auto m = load("MOV R4, #0008H\nPUSH R4\nMOV R5, #1\nPOP PSW");
|
|
192
|
+
finish(*m);
|
|
193
|
+
CHECK(psw_flags(*m) == Z); // not cleared from 0008H
|
|
194
|
+
m = load("MOV R4, #0\nPUSH R4\nPOP PSW");
|
|
195
|
+
finish(*m);
|
|
196
|
+
CHECK(psw_flags(*m) == 0); // not Z from 0000H
|
|
197
|
+
m = load("MOV R4, #0\nMOV R5, #0FFFFH\nMOV PSW, R4");
|
|
198
|
+
finish(*m);
|
|
199
|
+
CHECK(psw_flags(*m) == 0);
|
|
200
|
+
m = load("MOV R4, #0\nMOVB RL5, #80H\nMOVB 0FF10H, RL4");
|
|
201
|
+
finish(*m);
|
|
202
|
+
CHECK(psw_flags(*m) == 0);
|
|
203
|
+
// BCLR sets N for a bit that was set, but the PSW it writes is the old
|
|
204
|
+
// one with Z cleared.
|
|
205
|
+
m = load("MOV R4, #0\nBCLR PSW.3");
|
|
206
|
+
finish(*m);
|
|
207
|
+
CHECK(psw_flags(*m) == 0);
|
|
208
|
+
m = load("MOV R4, #0\nBSET PSW.1");
|
|
209
|
+
finish(*m);
|
|
210
|
+
CHECK(psw_flags(*m) == (Z | C));
|
|
211
|
+
// Other destinations still get their flags.
|
|
212
|
+
m = load("MOV R4, #0\nPUSH R4\nPOP R6");
|
|
213
|
+
finish(*m);
|
|
214
|
+
CHECK(psw_flags(*m) == Z);
|
|
215
|
+
}
|
|
216
|
+
|
|
188
217
|
TEST_CASE("sim: addressing modes") {
|
|
189
218
|
auto m = load(
|
|
190
219
|
"MOV R0, #0FC40H\n"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|