diff options
Diffstat (limited to 'cpp')
54 files changed, 203 insertions, 173 deletions
diff --git a/cpp/.traces/add b/cpp/.traces/add index 365c75f0..eaa94f85 100644 --- a/cpp/.traces/add +++ b/cpp/.traces/add @@ -8,13 +8,13 @@ parse/0: instruction: 2 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 23 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 23 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/add_literal b/cpp/.traces/add_literal index fcbb611f..e695a9a0 100644 --- a/cpp/.traces/add_literal +++ b/cpp/.traces/add_literal @@ -2,7 +2,7 @@ parse/0: instruction: 2 parse/0: ingredient: {name: "23", type: 0} parse/0: ingredient: {name: "34", type: 0} parse/0: product: {name: "1", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 23 run/0: ingredient 1 is 34 run/0: product 0 is 57 diff --git a/cpp/.traces/and b/cpp/.traces/and index 61fe4a64..4bbf11c3 100644 --- a/cpp/.traces/and +++ b/cpp/.traces/and @@ -8,13 +8,13 @@ parse/0: instruction: 7 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 1 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 0 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 1 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/copy b/cpp/.traces/copy index 965b5f2a..507bf92a 100644 --- a/cpp/.traces/copy +++ b/cpp/.traces/copy @@ -4,10 +4,10 @@ parse/0: product: {name: "1", type: 1} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 1} parse/0: product: {name: "2", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 23 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 1 mem/0: location 1 is 23 mem/0: storing in location 2 diff --git a/cpp/.traces/copy_array b/cpp/.traces/copy_array index 62253d3e..7350b04e 100644 --- a/cpp/.traces/copy_array +++ b/cpp/.traces/copy_array @@ -13,19 +13,19 @@ parse/0: product: {name: "4", type: 1} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 6} parse/0: product: {name: "5", type: 6} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 3 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 14 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 15 mem/0: storing in location 3 -run/0: instruction 3 +run/0: instruction main/3 run/0: ingredient 0 is 16 mem/0: storing in location 4 -run/0: instruction 4 +run/0: instruction main/4 run/0: ingredient 0 is 1 mem/0: location 1 is 3 mem/0: location 2 is 14 diff --git a/cpp/.traces/copy_indirect b/cpp/.traces/copy_indirect index f757f05a..357d1498 100644 --- a/cpp/.traces/copy_indirect +++ b/cpp/.traces/copy_indirect @@ -7,13 +7,13 @@ parse/0: product: {name: "2", type: 1} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 2-1, property: deref:} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 2 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 2 mem/0: location 2 is 34 diff --git a/cpp/.traces/copy_literal b/cpp/.traces/copy_literal index 94d56f2e..06a6b997 100644 --- a/cpp/.traces/copy_literal +++ b/cpp/.traces/copy_literal @@ -1,6 +1,6 @@ parse/0: instruction: 1 parse/0: ingredient: {name: "23", type: 0} parse/0: product: {name: "1", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 23 mem/0: storing in location 1 diff --git a/cpp/.traces/copy_multiple_locations b/cpp/.traces/copy_multiple_locations index 9804de88..4ba0d565 100644 --- a/cpp/.traces/copy_multiple_locations +++ b/cpp/.traces/copy_multiple_locations @@ -7,13 +7,13 @@ parse/0: product: {name: "2", type: 1} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 4} parse/0: product: {name: "3", type: 4} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 35 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 mem/0: location 2 is 35 diff --git a/cpp/.traces/divide b/cpp/.traces/divide index d713a512..4cd49db4 100644 --- a/cpp/.traces/divide +++ b/cpp/.traces/divide @@ -8,13 +8,13 @@ parse/0: instruction: 5 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 27 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 3 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 27 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/divide_literal b/cpp/.traces/divide_literal index 47f8690f..3d29139b 100644 --- a/cpp/.traces/divide_literal +++ b/cpp/.traces/divide_literal @@ -2,7 +2,7 @@ parse/0: instruction: 5 parse/0: ingredient: {name: "8", type: 0} parse/0: ingredient: {name: "2", type: 0} parse/0: product: {name: "1", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 8 run/0: ingredient 1 is 2 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/divide_with_remainder b/cpp/.traces/divide_with_remainder index 330141db..62993a82 100644 --- a/cpp/.traces/divide_with_remainder +++ b/cpp/.traces/divide_with_remainder @@ -9,13 +9,13 @@ parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} parse/0: product: {name: "4", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 27 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 11 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 27 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/divide_with_remainder_literal b/cpp/.traces/divide_with_remainder_literal index aa3b6478..bcc2451b 100644 --- a/cpp/.traces/divide_with_remainder_literal +++ b/cpp/.traces/divide_with_remainder_literal @@ -3,7 +3,7 @@ parse/0: ingredient: {name: "9", type: 0} parse/0: ingredient: {name: "2", type: 0} parse/0: product: {name: "1", type: 1} parse/0: product: {name: "2", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 9 run/0: ingredient 1 is 2 run/0: product 0 is 4 diff --git a/cpp/.traces/equal b/cpp/.traces/equal index 6d03ccfb..9abcdde6 100644 --- a/cpp/.traces/equal +++ b/cpp/.traces/equal @@ -8,13 +8,13 @@ parse/0: instruction: 13 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 33 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/equal2 b/cpp/.traces/equal2 index bb52e968..b1d02785 100644 --- a/cpp/.traces/equal2 +++ b/cpp/.traces/equal2 @@ -8,13 +8,13 @@ parse/0: instruction: 13 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/get b/cpp/.traces/get index 3f5a996e..fed4a487 100644 --- a/cpp/.traces/get +++ b/cpp/.traces/get @@ -8,13 +8,13 @@ parse/0: instruction: 18 parse/0: ingredient: {name: "12", type: 4} parse/0: ingredient: {name: "1", type: 0} parse/0: product: {name: "15", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 12 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 35 mem/0: storing in location 13 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 12 run/0: ingredient 1 is 1 run/0: address to copy is 13 diff --git a/cpp/.traces/get_address b/cpp/.traces/get_address index 296fd6c0..59da3a6d 100644 --- a/cpp/.traces/get_address +++ b/cpp/.traces/get_address @@ -8,13 +8,13 @@ parse/0: instruction: 19 parse/0: ingredient: {name: "12", type: 4} parse/0: ingredient: {name: "1", type: 0} parse/0: product: {name: "15", type: 2-1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 12 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 35 mem/0: storing in location 13 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 12 run/0: ingredient 1 is 1 run/0: address to copy is 13 diff --git a/cpp/.traces/get_address_indirect b/cpp/.traces/get_address_indirect index 6d7b2c24..27591476 100644 --- a/cpp/.traces/get_address_indirect +++ b/cpp/.traces/get_address_indirect @@ -11,16 +11,16 @@ parse/0: instruction: 19 parse/0: ingredient: {name: "1", type: 2-4, property: deref:} parse/0: ingredient: {name: "0", type: 0} parse/0: product: {name: "4", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 2 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 35 mem/0: storing in location 3 -run/0: instruction 3 +run/0: instruction main/3 run/0: ingredient 0 is 1 mem/0: location 1 is 2 run/0: ingredient 1 is 0 diff --git a/cpp/.traces/get_handles_record_fields b/cpp/.traces/get_handles_record_fields index 6e2f065e..0c1eb7d9 100644 --- a/cpp/.traces/get_handles_record_fields +++ b/cpp/.traces/get_handles_record_fields @@ -11,16 +11,16 @@ parse/0: instruction: 18 parse/0: ingredient: {name: "12", type: 5} parse/0: ingredient: {name: "1", type: 0} parse/0: product: {name: "15", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 12 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 35 mem/0: storing in location 13 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 36 mem/0: storing in location 14 -run/0: instruction 3 +run/0: instruction main/3 run/0: ingredient 0 is 12 run/0: ingredient 1 is 1 run/0: address to copy is 14 diff --git a/cpp/.traces/get_indirect b/cpp/.traces/get_indirect index 60ddfd9b..6aaf660d 100644 --- a/cpp/.traces/get_indirect +++ b/cpp/.traces/get_indirect @@ -11,16 +11,16 @@ parse/0: instruction: 18 parse/0: ingredient: {name: "1", type: 2-4, property: deref:} parse/0: ingredient: {name: "0", type: 0} parse/0: product: {name: "4", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 2 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 35 mem/0: storing in location 3 -run/0: instruction 3 +run/0: instruction main/3 run/0: ingredient 0 is 1 mem/0: location 1 is 2 run/0: ingredient 1 is 0 diff --git a/cpp/.traces/greater_or_equal b/cpp/.traces/greater_or_equal index d01859ca..d347b751 100644 --- a/cpp/.traces/greater_or_equal +++ b/cpp/.traces/greater_or_equal @@ -8,13 +8,13 @@ parse/0: instruction: 16 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 33 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/greater_or_equal2 b/cpp/.traces/greater_or_equal2 index 6ce24011..4777cecc 100644 --- a/cpp/.traces/greater_or_equal2 +++ b/cpp/.traces/greater_or_equal2 @@ -8,13 +8,13 @@ parse/0: instruction: 16 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/greater_or_equal3 b/cpp/.traces/greater_or_equal3 index 7cba95fb..4e5986ec 100644 --- a/cpp/.traces/greater_or_equal3 +++ b/cpp/.traces/greater_or_equal3 @@ -8,13 +8,13 @@ parse/0: instruction: 16 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 35 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/greater_than b/cpp/.traces/greater_than index aea0dbda..58654c92 100644 --- a/cpp/.traces/greater_than +++ b/cpp/.traces/greater_than @@ -8,13 +8,13 @@ parse/0: instruction: 14 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 33 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/greater_than2 b/cpp/.traces/greater_than2 index 52c4019b..cc0494ee 100644 --- a/cpp/.traces/greater_than2 +++ b/cpp/.traces/greater_than2 @@ -8,13 +8,13 @@ parse/0: instruction: 14 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/index b/cpp/.traces/index index a23f11ab..9809b808 100644 --- a/cpp/.traces/index +++ b/cpp/.traces/index @@ -14,19 +14,19 @@ parse/0: instruction: 20 parse/0: ingredient: {name: "1", type: 6} parse/0: ingredient: {name: "0", type: 0} parse/0: product: {name: "5", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 3 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 14 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 15 mem/0: storing in location 3 -run/0: instruction 3 +run/0: instruction main/3 run/0: ingredient 0 is 16 mem/0: storing in location 4 -run/0: instruction 4 +run/0: instruction main/4 run/0: ingredient 0 is 1 run/0: ingredient 1 is 0 run/0: address to copy is 2 diff --git a/cpp/.traces/index_address b/cpp/.traces/index_address index bd407dda..76b99827 100644 --- a/cpp/.traces/index_address +++ b/cpp/.traces/index_address @@ -14,19 +14,19 @@ parse/0: instruction: 21 parse/0: ingredient: {name: "1", type: 6} parse/0: ingredient: {name: "0", type: 0} parse/0: product: {name: "5", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 3 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 14 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 15 mem/0: storing in location 3 -run/0: instruction 3 +run/0: instruction main/3 run/0: ingredient 0 is 16 mem/0: storing in location 4 -run/0: instruction 4 +run/0: instruction main/4 run/0: ingredient 0 is 1 run/0: ingredient 1 is 0 run/0: address to copy is 2 diff --git a/cpp/.traces/jump_backward b/cpp/.traces/jump_backward index 033b1dfd..6d9e433f 100644 --- a/cpp/.traces/jump_backward +++ b/cpp/.traces/jump_backward @@ -15,9 +15,9 @@ parse/0: ingredient: {name: "//", type: } parse/0: ingredient: {name: "2", type: } parse/0: ingredient: {name: "+-->+", type: } parse/0: ingredient: {name: "|", type: } -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 1 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is -2 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 1 diff --git a/cpp/.traces/jump_can_skip_instructions b/cpp/.traces/jump_can_skip_instructions index e1c0f664..b8bc85e9 100644 --- a/cpp/.traces/jump_can_skip_instructions +++ b/cpp/.traces/jump_can_skip_instructions @@ -3,5 +3,5 @@ parse/0: ingredient: {name: "1", type: 0} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 0} parse/0: product: {name: "1", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 1 diff --git a/cpp/.traces/jump_if b/cpp/.traces/jump_if index a496582e..707dfd81 100644 --- a/cpp/.traces/jump_if +++ b/cpp/.traces/jump_if @@ -4,7 +4,7 @@ parse/0: ingredient: {name: "1", type: 0} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 0} parse/0: product: {name: "1", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 999 run/0: ingredient 1 is 1 run/0: jumping to instruction 2 diff --git a/cpp/.traces/jump_if_fallthrough b/cpp/.traces/jump_if_fallthrough index 894392ec..f95c99bb 100644 --- a/cpp/.traces/jump_if_fallthrough +++ b/cpp/.traces/jump_if_fallthrough @@ -4,9 +4,9 @@ parse/0: ingredient: {name: "1", type: 0} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 0} parse/0: product: {name: "123", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 0 run/0: jump-if fell through -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 1 mem/0: storing in location 123 diff --git a/cpp/.traces/jump_unless b/cpp/.traces/jump_unless index 68a57639..a0978ed4 100644 --- a/cpp/.traces/jump_unless +++ b/cpp/.traces/jump_unless @@ -4,7 +4,7 @@ parse/0: ingredient: {name: "1", type: 0} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 0} parse/0: product: {name: "1", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 0 run/0: ingredient 1 is 1 run/0: jumping to instruction 2 diff --git a/cpp/.traces/jump_unless_fallthrough b/cpp/.traces/jump_unless_fallthrough index 5d6a5d9e..c1981cd7 100644 --- a/cpp/.traces/jump_unless_fallthrough +++ b/cpp/.traces/jump_unless_fallthrough @@ -4,9 +4,9 @@ parse/0: ingredient: {name: "1", type: 0} parse/0: instruction: 1 parse/0: ingredient: {name: "1", type: 0} parse/0: product: {name: "123", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 999 run/0: jump-unless fell through -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 1 mem/0: storing in location 123 diff --git a/cpp/.traces/lesser_or_equal b/cpp/.traces/lesser_or_equal index df518a0a..cfd78e25 100644 --- a/cpp/.traces/lesser_or_equal +++ b/cpp/.traces/lesser_or_equal @@ -8,13 +8,13 @@ parse/0: instruction: 17 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 32 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 33 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 32 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/lesser_or_equal2 b/cpp/.traces/lesser_or_equal2 index d87c8a37..02874d2f 100644 --- a/cpp/.traces/lesser_or_equal2 +++ b/cpp/.traces/lesser_or_equal2 @@ -8,13 +8,13 @@ parse/0: instruction: 17 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 33 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 33 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 33 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/lesser_or_equal3 b/cpp/.traces/lesser_or_equal3 index 9576ddf9..cc6828fc 100644 --- a/cpp/.traces/lesser_or_equal3 +++ b/cpp/.traces/lesser_or_equal3 @@ -8,13 +8,13 @@ parse/0: instruction: 17 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 33 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/lesser_than b/cpp/.traces/lesser_than index 5583f5fa..d1d02a6d 100644 --- a/cpp/.traces/lesser_than +++ b/cpp/.traces/lesser_than @@ -8,13 +8,13 @@ parse/0: instruction: 15 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 32 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 33 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 32 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/lesser_than2 b/cpp/.traces/lesser_than2 index 735b78b0..f0a593f5 100644 --- a/cpp/.traces/lesser_than2 +++ b/cpp/.traces/lesser_than2 @@ -8,13 +8,13 @@ parse/0: instruction: 15 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 34 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 33 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 34 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/multiply b/cpp/.traces/multiply index 4d9c5008..d73c18ae 100644 --- a/cpp/.traces/multiply +++ b/cpp/.traces/multiply @@ -8,13 +8,13 @@ parse/0: instruction: 4 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 4 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 6 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 4 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/multiply_literal b/cpp/.traces/multiply_literal index e27a4fa9..25449167 100644 --- a/cpp/.traces/multiply_literal +++ b/cpp/.traces/multiply_literal @@ -2,7 +2,7 @@ parse/0: instruction: 4 parse/0: ingredient: {name: "2", type: 0} parse/0: ingredient: {name: "3", type: 0} parse/0: product: {name: "1", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 2 run/0: ingredient 1 is 3 run/0: ingredient 1 is 3 diff --git a/cpp/.traces/not b/cpp/.traces/not index 69459c1b..30f2b4b9 100644 --- a/cpp/.traces/not +++ b/cpp/.traces/not @@ -4,10 +4,10 @@ parse/0: product: {name: "1", type: 1} parse/0: instruction: 9 parse/0: ingredient: {name: "1", type: 1} parse/0: product: {name: "2", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 1 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 1 mem/0: location 1 is 1 run/0: product 0 is 0 diff --git a/cpp/.traces/or b/cpp/.traces/or index 73c46b6d..3f266ea0 100644 --- a/cpp/.traces/or +++ b/cpp/.traces/or @@ -8,13 +8,13 @@ parse/0: instruction: 8 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 1 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 0 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 1 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/store_indirect b/cpp/.traces/store_indirect index 259685d1..da8f4aff 100644 --- a/cpp/.traces/store_indirect +++ b/cpp/.traces/store_indirect @@ -4,10 +4,10 @@ parse/0: product: {name: "1", type: 2-1} parse/0: instruction: 1 parse/0: ingredient: {name: "34", type: 0} parse/0: product: {name: "1", type: 2-1, property: deref:} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 2 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: location 1 is 2 mem/0: storing in location 2 diff --git a/cpp/.traces/subtract b/cpp/.traces/subtract index 73b675e9..72497a6e 100644 --- a/cpp/.traces/subtract +++ b/cpp/.traces/subtract @@ -8,13 +8,13 @@ parse/0: instruction: 3 parse/0: ingredient: {name: "1", type: 1} parse/0: ingredient: {name: "2", type: 1} parse/0: product: {name: "3", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 23 mem/0: storing in location 1 -run/0: instruction 1 +run/0: instruction main/1 run/0: ingredient 0 is 34 mem/0: storing in location 2 -run/0: instruction 2 +run/0: instruction main/2 run/0: ingredient 0 is 1 mem/0: location 1 is 23 run/0: ingredient 1 is 2 diff --git a/cpp/.traces/subtract_literal b/cpp/.traces/subtract_literal index 73bfce31..c4981839 100644 --- a/cpp/.traces/subtract_literal +++ b/cpp/.traces/subtract_literal @@ -2,7 +2,7 @@ parse/0: instruction: 3 parse/0: ingredient: {name: "5", type: 0} parse/0: ingredient: {name: "2", type: 0} parse/0: product: {name: "1", type: 1} -run/0: instruction 0 +run/0: instruction main/0 run/0: ingredient 0 is 5 run/0: ingredient 1 is 2 run/0: product 0 is 3 diff --git a/cpp/010vm b/cpp/010vm index 28cdd2c0..a734305f 100644 --- a/cpp/010vm +++ b/cpp/010vm @@ -10,6 +10,7 @@ int Next_recipe_number = 1; // Recipes are lists of instructions. To run a recipe, the computer runs its // instructions. struct recipe { + string name; vector<instruction> steps; }; diff --git a/cpp/011load b/cpp/011load index b7fa4a20..ab2d6535 100644 --- a/cpp/011load +++ b/cpp/011load @@ -32,6 +32,7 @@ int add_recipe(string form) { while (next_instruction(in, &curr)) { Recipe[r].steps.push_back(curr); } + Recipe[r].name = recipe_name; return r; } diff --git a/cpp/012run b/cpp/012run index 194a55c5..79dcbfc2 100644 --- a/cpp/012run +++ b/cpp/012run @@ -3,7 +3,7 @@ recipe main [ 1:integer <- copy 23:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 0 is 23 +mem: storing in location 1 @@ -12,20 +12,45 @@ recipe main [ 1:integer <- copy 23:literal 2:integer <- copy 1:integer ] -+run: instruction 1 ++run: instruction main/1 +run: ingredient 0 is 1 +mem: location 1 is 23 +mem: storing in location 2 +:(before "End Types") +// Each recipe can be 'called' many many times in a program. Each call needs a +// little extra information. +struct call { + recipe_number running_recipe; + size_t pc; + call(recipe_number r) :running_recipe(r), pc(0) {} +}; +typedef stack<call> call_stack; + :(code) void run(string form) { - run(add_recipe(form)); + recipe_number r = add_recipe(form); + call_stack context; + context.push(call(r)); + run(context); } -void run(recipe_number r) { - vector<instruction>& instructions(Recipe[r].steps); - for (size_t pc = 0; pc < instructions.size(); ++pc) { - trace("run") << "instruction " << pc; +void run(call_stack context) { +// #defines save us the trouble of updating aliases when dependent variables +// change. +#define TOP Recipe[context.top().running_recipe] +#define instructions TOP.steps + while (!context.empty()) { + while (context.top().pc >= instructions.size()) { + context.pop(); + if (context.empty()) return; + // todo: no results returned warning + ++context.top().pc; + } +//? cout << context.size() << '\n'; //? 1 + size_t& pc = context.top().pc; +//? cout << "instruction " << TOP.name << '/' << pc << '\n'; //? 1 + trace("run") << "instruction " << TOP.name << '/' << pc; switch (instructions[pc].operation) { // Primitive Recipe Implementations. case COPY: { @@ -38,7 +63,10 @@ void run(recipe_number r) { default: raise << "undefined operation " << instructions[pc].operation; } + ++pc; } +#undef TOP +#undef instructions } vector<int> read_memory(reagent x) { diff --git a/cpp/013arithmetic b/cpp/013arithmetic index 1f12b474..d1d61eed 100644 --- a/cpp/013arithmetic +++ b/cpp/013arithmetic @@ -23,7 +23,7 @@ case ADD: { recipe main [ 1:integer <- add 23:literal, 34:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 0 is 23 +run: ingredient 1 is 34 +run: product 0 is 57 @@ -35,7 +35,7 @@ recipe main [ 2:integer <- copy 34:literal 3:integer <- add 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 23 +run: ingredient 1 is 2 @@ -67,7 +67,7 @@ case SUBTRACT: { recipe main [ 1:integer <- subtract 5:literal, 2:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 0 is 5 +run: ingredient 1 is 2 +run: product 0 is 3 @@ -79,7 +79,7 @@ recipe main [ 2:integer <- copy 34:literal 3:integer <- subtract 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 23 +run: ingredient 1 is 2 @@ -112,7 +112,7 @@ case MULTIPLY: { recipe main [ 1:integer <- multiply 2:literal, 3:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 0 is 2 +run: ingredient 1 is 3 +run: product 0 is 6 @@ -124,7 +124,7 @@ recipe main [ 2:integer <- copy 6:literal 3:integer <- multiply 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 4 +run: ingredient 1 is 2 @@ -157,7 +157,7 @@ case DIVIDE: { recipe main [ 1:integer <- divide 8:literal, 2:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 0 is 8 +run: ingredient 1 is 2 +run: product 0 is 4 @@ -169,7 +169,7 @@ recipe main [ 2:integer <- copy 3:literal 3:integer <- divide 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 27 +run: ingredient 1 is 2 @@ -205,7 +205,7 @@ case DIVIDE_WITH_REMAINDER: { recipe main [ 1:integer, 2:integer <- divide_with_remainder 9:literal, 2:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 0 is 9 +run: ingredient 1 is 2 +run: product 0 is 4 @@ -219,7 +219,7 @@ recipe main [ 2:integer <- copy 11:literal 3:integer, 4:integer <- divide_with_remainder 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 27 +run: ingredient 1 is 2 diff --git a/cpp/014boolean b/cpp/014boolean index 7da98db4..61f5f436 100644 --- a/cpp/014boolean +++ b/cpp/014boolean @@ -25,7 +25,7 @@ recipe main [ 2:integer <- copy 0:literal 3:integer <- and 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 1 +run: ingredient 1 is 2 @@ -59,7 +59,7 @@ recipe main [ 2:integer <- copy 0:literal 3:integer <- or 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 1 +run: ingredient 1 is 2 @@ -89,7 +89,7 @@ recipe main [ 1:integer <- copy 1:literal 2:integer <- not 1:integer ] -+run: instruction 1 ++run: instruction main/1 +run: ingredient 0 is 1 +mem: location 1 is 1 +run: product 0 is 0 diff --git a/cpp/015jump b/cpp/015jump index 99b333dd..26861166 100644 --- a/cpp/015jump +++ b/cpp/015jump @@ -16,9 +16,9 @@ recipe main [ jump 1:offset 1:integer <- copy 1:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 0 is 1 --run: instruction 1 +-run: instruction main/1 -mem: storing in location 1 :(scenario "jump_backward") @@ -27,9 +27,9 @@ recipe main [ jump 1:offset // | 1 +-+ jump -2:offset // 2 +-->+ | ] // 3 \/ -+run: instruction 0 -+run: instruction 2 -+run: instruction 1 ++run: instruction main/0 ++run: instruction main/2 ++run: instruction main/1 :(before "End Globals") const int JUMP_IF = 11; @@ -56,10 +56,10 @@ recipe main [ jump-if 999:literal 1:offset 1:integer <- copy 1:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 1 is 1 +run: jumping to instruction 2 --run: instruction 1 +-run: instruction main/1 -mem: storing in location 1 :(scenario "jump_if_fallthrough") @@ -67,9 +67,9 @@ recipe main [ jump-if 0:literal 1:offset 123:integer <- copy 1:literal ] -+run: instruction 0 ++run: instruction main/0 +run: jump-if fell through -+run: instruction 1 ++run: instruction main/1 +mem: storing in location 123 :(before "End Globals") @@ -97,10 +97,10 @@ recipe main [ jump-unless 0:literal 1:offset 1:integer <- copy 1:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 1 is 1 +run: jumping to instruction 2 --run: instruction 1 +-run: instruction main/1 -mem: storing in location 1 :(scenario "jump_unless_fallthrough") @@ -108,8 +108,8 @@ recipe main [ jump-unless 999:literal 1:offset 123:integer <- copy 1:literal ] -+run: instruction 0 ++run: instruction main/0 +run: ingredient 0 is 999 +run: jump-unless fell through -+run: instruction 1 ++run: instruction main/1 +mem: storing in location 123 diff --git a/cpp/016compare b/cpp/016compare index 7da3dd16..9a97911f 100644 --- a/cpp/016compare +++ b/cpp/016compare @@ -23,7 +23,7 @@ recipe main [ 2:integer <- copy 33:literal 3:integer <- equal 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 @@ -37,7 +37,7 @@ recipe main [ 2:integer <- copy 34:literal 3:integer <- equal 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 @@ -71,7 +71,7 @@ recipe main [ 2:integer <- copy 33:literal 3:integer <- greater-than 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 @@ -85,7 +85,7 @@ recipe main [ 2:integer <- copy 34:literal 3:integer <- greater-than 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 @@ -119,7 +119,7 @@ recipe main [ 2:integer <- copy 33:literal 3:integer <- lesser-than 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 32 +run: ingredient 1 is 2 @@ -133,7 +133,7 @@ recipe main [ 2:integer <- copy 33:literal 3:integer <- lesser-than 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 @@ -167,7 +167,7 @@ recipe main [ 2:integer <- copy 33:literal 3:integer <- greater-or-equal 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 @@ -181,7 +181,7 @@ recipe main [ 2:integer <- copy 34:literal 3:integer <- greater-or-equal 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 @@ -195,7 +195,7 @@ recipe main [ 2:integer <- copy 35:literal 3:integer <- greater-or-equal 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 @@ -229,7 +229,7 @@ recipe main [ 2:integer <- copy 33:literal 3:integer <- lesser-or-equal 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 32 +run: ingredient 1 is 2 @@ -243,7 +243,7 @@ recipe main [ 2:integer <- copy 33:literal 3:integer <- lesser-or-equal 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 33 +run: ingredient 1 is 2 @@ -257,7 +257,7 @@ recipe main [ 2:integer <- copy 33:literal 3:integer <- lesser-or-equal 1:integer, 2:integer ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 1 +mem: location 1 is 34 +run: ingredient 1 is 2 diff --git a/cpp/017record b/cpp/017record index 3dbd21c0..6ce9da1d 100644 --- a/cpp/017record +++ b/cpp/017record @@ -63,7 +63,7 @@ recipe main [ 13:integer <- copy 35:literal 15:integer <- get 12:point, 1:offset ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 12 +run: ingredient 1 is 1 +run: address to copy is 13 @@ -90,7 +90,7 @@ recipe main [ 14:integer <- copy 36:literal 15:integer <- get 12:point-integer, 1:offset ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 12 +run: ingredient 1 is 1 +run: address to copy is 14 @@ -133,7 +133,7 @@ recipe main [ 13:integer <- copy 35:literal 15:address:integer <- get-address 12:point, 1:offset ] -+run: instruction 2 ++run: instruction main/2 +run: ingredient 0 is 12 +run: ingredient 1 is 1 +run: address to copy is 13 diff --git a/cpp/018address b/cpp/018address index 19650e84..bdf10685 100644 --- a/cpp/018address +++ b/cpp/018address @@ -6,7 +6,7 @@ recipe main [ # This loads location 1 as an address and looks up *that* location. 3:integer <- copy 1:address:integer/deref ] -+run: instruction 2 ++run: instruction main/2 +mem: location 1 is 2 +mem: location 2 is 34 +mem: storing in location 3 @@ -35,7 +35,7 @@ recipe main [ 1:address:integer <- copy 2:literal 1:address:integer/deref <- copy 34:literal ] -+run: instruction 1 ++run: instruction main/1 +mem: location 1 is 2 +mem: storing in location 2 @@ -103,7 +103,7 @@ recipe main [ 3:integer <- copy 35:literal 4:integer <- get 1:address:point/deref, 0:offset ] -+run: instruction 3 ++run: instruction main/3 +run: address to copy is 2 +run: product 0 is 34 +mem: storing in location 4 @@ -146,7 +146,7 @@ recipe main [ 3:integer <- copy 35:literal 4:integer <- get-address 1:address:point/deref, 0:offset ] -+run: instruction 3 ++run: instruction main/3 +run: address to copy is 2 +run: product 0 is 2 diff --git a/cpp/019array b/cpp/019array index bb50a783..fe457b0a 100644 --- a/cpp/019array +++ b/cpp/019array @@ -15,7 +15,7 @@ recipe main [ 4:integer <- copy 16:literal 5:integer-array <- copy 1:integer-array ] -+run: instruction 4 ++run: instruction main/4 +run: ingredient 0 is 1 +mem: location 1 is 3 +mem: location 2 is 14 @@ -91,7 +91,7 @@ recipe main [ 4:integer <- copy 16:literal 5:integer <- index 1:integer-array, 0:literal ] -+run: instruction 4 ++run: instruction main/4 +run: ingredient 0 is 1 +run: ingredient 1 is 0 +run: address to copy is 2 @@ -132,7 +132,7 @@ recipe main [ 4:integer <- copy 16:literal 5:integer <- index-address 1:integer-array, 0:literal ] -+run: instruction 4 ++run: instruction main/4 +run: ingredient 0 is 1 +run: ingredient 1 is 0 +run: address to copy is 2 |