diff options
| author | Julian Blake Kongslie | 2022-10-29 18:18:26 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2022-10-29 18:18:26 -0700 |
| commit | 9f4aa97822adc791f700670ef0fc7636849563b7 (patch) | |
| tree | 0b9d6c1bb1d7d596501df3b77ab3d7b9f191aa4f /main.cpp | |
| parent | Control register values should not be "unsigned int" (diff) | |
| download | biggolf-9f4aa97822adc791f700670ef0fc7636849563b7.tar.xz | |
Understanding interrupt handling within SIMH (see echo_int.pal)
Add list of Bugs
Add event log file parser
More changes associated with widening the ctlregs (FIXME add a typedef)
Add some keyboard instructions
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
| @@ -1,6 +1,7 @@ | |||
| 1 | #include <arpa/inet.h> | 1 | #include <arpa/inet.h> |
| 2 | #include <cstdint> | 2 | #include <cstdint> |
| 3 | #include <fmt/format.h> | 3 | #include <fmt/format.h> |
| 4 | #include <fstream> | ||
| 4 | #include <iostream> | 5 | #include <iostream> |
| 5 | #include <optional> | 6 | #include <optional> |
| 6 | #include <utility> | 7 | #include <utility> |
| @@ -60,13 +61,18 @@ int main(int argc, const char *argv[]) { | |||
| 60 | checker checker(system); | 61 | checker checker(system); |
| 61 | 62 | ||
| 62 | for (--argc, ++argv; argc; --argc, ++argv) { | 63 | for (--argc, ++argv; argc; --argc, ++argv) { |
| 63 | auto program = programs.at(argv[0]); | 64 | if (auto program = programs.find(*argv); program != programs.end()) { |
| 64 | if (auto err = load_program(checker, program)) | 65 | if (auto err = load_program(checker, program->second)) |
| 65 | return err; | 66 | return err; |
| 67 | } else { | ||
| 68 | std::ifstream fh(*argv); | ||
| 69 | system.load_evt(fh); | ||
| 70 | } | ||
| 66 | } | 71 | } |
| 67 | 72 | ||
| 68 | while (true) { | 73 | while (!checker.done()) { |
| 69 | //std::cout << fmt::format("{:9} @{:04o} {:01o}:{:04o}:{:04o} TTO={:x}\n", system.time, checker.pc, checker.link, checker.acc, checker.mq, checker.ctlregs[TT_OUTPUT]); | 74 | // if (!checker.ctlregs[HALTED]) |
| 75 | // std::cout << fmt::format("\t{:9} {:04o}\n", system.time, checker.pc); | ||
| 70 | checker.execute(); | 76 | checker.execute(); |
| 71 | } | 77 | } |
| 72 | 78 | ||
