From a6003698a600ea6ff07656262db451147c98ca4f Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Fri, 5 Apr 2024 15:00:45 +0200 Subject: [PATCH] also in disassembler mode it would throw exceptions --- btester.sh | 11 ----------- bus.cpp | 6 +++++- debugger.cpp | 3 +++ 3 files changed, 8 insertions(+), 12 deletions(-) delete mode 100755 btester.sh diff --git a/btester.sh b/btester.sh deleted file mode 100755 index a956a7e..0000000 --- a/btester.sh +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -pdpy11 --lst tester.mac - -if [ ! -e raw_to_simh_bin ] ; then - g++ -Ofast raw_to_simh_bin.cpp -o raw_to_simh_bin -fi - -./raw_to_simh_bin tester 512 512 tester.bin - -ls -la tester* diff --git a/bus.cpp b/bus.cpp index c26e2e5..a645365 100644 --- a/bus.cpp +++ b/bus.cpp @@ -407,7 +407,6 @@ uint16_t bus::read(const uint16_t addr_in, const word_mode_t word_mode, const rm DOLOG(debug, true, "READ-I/O UNHANDLED read %08o (%c), (base: %o)", m_offset, word_mode ? 'B' : ' ', get_io_base()); c->trap(004); // no such i/o - throw 1; } @@ -422,6 +421,11 @@ uint16_t bus::read(const uint16_t addr_in, const word_mode_t word_mode, const rm } if (m_offset >= n_pages * 8192) { + if (peek_only) { + DOLOG(debug, true, "READ from %06o - out of range!", addr_in); + return 0; + } + c->trap(004); // no such RAM throw 1; } diff --git a/debugger.cpp b/debugger.cpp index d6c0b4b..14d1e24 100644 --- a/debugger.cpp +++ b/debugger.cpp @@ -563,6 +563,9 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto catch(const std::exception & e) { cnsl->put_string_lf(format("Exception caught: %s", e.what())); } + catch(const int ei) { + cnsl->put_string_lf(format("Problem: %d", ei)); + } catch(...) { cnsl->put_string_lf("Unspecified exception caught"); }