From 1d5d645be75691b535fe15e6be9d7855f62dc819 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 27 Jun 2018 21:52:09 -0700 Subject: 4277 - make room for a 'compile' sub-command --- subx/001help.cc | 4 +++- subx/020elf.cc | 11 +++++++---- 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 \n" + << " subx run \n" + << "Planned:\n" + << " subx compile \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) { -- cgit 1.4.1-2-gfad0 More resilient society.Kartik K. Agaram <vc@akkartik.com>
about summary refs log tree commit diff stats
blob: fb7b820b0f7dcaaa192844c8a6615c2e45c3b17f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12