about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--subx/001help.cc4
-rw-r--r--subx/020elf.cc11
2 files changed, 10 insertions, 5 deletions
diff --git a/subx/001help.cc b/subx/001help.cc
index f938fdfc..d8d81ff0 100644
--- a/subx/001help.cc
+++ b/subx/001help.cc
@@ -8,7 +8,9 @@ if (argc <= 1 || is_equal(argv[1], "--help")) {
   cerr << "Usage:\n"
        << "  subx test\n"
        << "  subx --help\n"
-       << "  subx <elf file>\n"
+       << "  subx run <elf file>\n"
+       << "Planned:\n"
+       << "  subx compile <ascii file> <elf file>\n"
        ;
   return 0;
 }
diff --git a/subx/020elf.cc b/subx/020elf.cc
index 682543e6..7bc6ded8 100644
--- a/subx/020elf.cc
+++ b/subx/020elf.cc
@@ -2,10 +2,13 @@
 
 :(before "End Main")
 assert(argc > 1);
-reset();
-load_elf(argv[1]);
-while (EIP < End_of_program)
-  run_one_instruction();
+if (is_equal(argv[1], "run")) {
+  assert(argc > 2);
+  reset();
+  load_elf(argv[2]);
+  while (EIP < End_of_program)
+    run_one_instruction();
+}
 
 :(code)
 void load_elf(const string& filename) {