diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-03-17 11:23:29 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-03-17 13:19:20 -0700 |
commit | 3ba6357924e1098a28e43c94a4573a3d2978b5e9 (patch) | |
tree | 9a5a4b181a82a77646b1c9d796bdd8b4159dc337 /cpp/013run | |
parent | 5f0e4762468c412d57fb54236a0ee90e23a2cb14 (diff) | |
download | mu-3ba6357924e1098a28e43c94a4573a3d2978b5e9.tar.gz |
949 - paving the way for jumps to labels
Addresses for reagents are now computed after all transforms.
Diffstat (limited to 'cpp/013run')
-rw-r--r-- | cpp/013run | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cpp/013run b/cpp/013run index 1fc6ded8..102a7dfb 100644 --- a/cpp/013run +++ b/cpp/013run @@ -38,6 +38,7 @@ void run(routine rr) { // Running one instruction. if (instructions[pc].is_label) { ++pc; continue; } trace("run") << "instruction " << recipe_name(rr) << '/' << pc; +//? cout << instructions[pc].operation << '\n'; //? 1 switch (instructions[pc].operation) { // Primitive Recipe Implementations. case COPY: { @@ -127,7 +128,7 @@ vector<int> read_memory(reagent x) { } void write_memory(reagent x, vector<int> data) { - int base = to_int(x.name); + int base = x.value; size_t size = size_of(x); if (size != data.size()) raise << "size mismatch in storing to " << x.to_string(); for (size_t offset = 0; offset < size; ++offset) { @@ -139,6 +140,7 @@ void write_memory(reagent x, vector<int> data) { :(code) size_t size_of(reagent r) { type_info t = Type[r.types[0]]; + if (!t.is_record && !t.is_array) return t.size; // End size_of Cases. return t.size; } |