diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-24 22:49:29 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-24 22:49:29 -0700 |
commit | 6d8ef6b12d37336a92c7a6b20b4b66f3ab424464 (patch) | |
tree | 49c4b2b75ebc85540861b2682e3d48fe958c5dc8 /cpp/023jump | |
parent | 0b0cfb6f1f4579eef463ffcb41ba782ddbd56035 (diff) | |
download | mu-6d8ef6b12d37336a92c7a6b20b4b66f3ab424464.tar.gz |
1189 - add extensions to all layers
I'm sick of fighting vim's filetype detection. No modeline and files highlight in random colors. I add a modeline and it stops highlighting tangle comments. Even though it read my #$%# vimrc! Fuck this shite.
Diffstat (limited to 'cpp/023jump')
-rw-r--r-- | cpp/023jump | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/cpp/023jump b/cpp/023jump deleted file mode 100644 index 932d0da8..00000000 --- a/cpp/023jump +++ /dev/null @@ -1,115 +0,0 @@ -//: Jump primitives - -:(before "End Primitive Recipe Declarations") -JUMP, -:(before "End Primitive Recipe Numbers") -Recipe_number["jump"] = JUMP; -:(before "End Primitive Recipe Implementations") -case JUMP: { - trace("run") << "ingredient 0 is " << current_instruction().ingredients[0].value; - current_step_index() += current_instruction().ingredients[0].value; - trace("run") << "jumping to instruction " << current_step_index()+1; - break; -} - -:(scenario jump_can_skip_instructions) -recipe main [ - jump 1:offset - 1:integer <- copy 1:literal -] -+run: instruction main/0 -+run: ingredient 0 is 1 --run: instruction main/1 --mem: storing 1 in location 1 - -:(scenario jump_backward) -recipe main [ - jump 1:offset # 0 -+ - jump 1:offset # | +-+ 1 - # \/ /\ | - jump -2:offset # 2 +-->+ | -] # \/ 3 -+run: instruction main/0 -+run: instruction main/2 -+run: instruction main/1 - -:(before "End Primitive Recipe Declarations") -JUMP_IF, -:(before "End Primitive Recipe Numbers") -Recipe_number["jump-if"] = JUMP_IF; -:(before "End Primitive Recipe Implementations") -case JUMP_IF: { - vector<int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 0 is " << arg0[0]; - if (!arg0[0]) { - trace("run") << "jump-if fell through"; - break; - } - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - current_step_index() += current_instruction().ingredients[1].value; - trace("run") << "jumping to instruction " << current_step_index()+1; - break; -} - -:(scenario jump_if) -recipe main [ - jump-if 999:literal 1:offset - 1:integer <- copy 1:literal -] -+run: instruction main/0 -+run: ingredient 1 is 1 -+run: jumping to instruction 2 --run: instruction main/1 --mem: storing 1 in location 1 - -:(scenario jump_if_fallthrough) -recipe main [ - jump-if 0:literal 1:offset - 123:integer <- copy 1:literal -] -+run: instruction main/0 -+run: jump-if fell through -+run: instruction main/1 -+mem: storing 1 in location 123 - -:(before "End Primitive Recipe Declarations") -JUMP_UNLESS, -:(before "End Primitive Recipe Numbers") -Recipe_number["jump-unless"] = JUMP_UNLESS; -:(before "End Primitive Recipe Implementations") -case JUMP_UNLESS: { - vector<int> arg0 = read_memory(current_instruction().ingredients[0]); - assert(arg0.size() == 1); - trace("run") << "ingredient 0 is " << arg0[0]; - if (arg0[0]) { - trace("run") << "jump-unless fell through"; - break; - } - trace("run") << "ingredient 1 is " << current_instruction().ingredients[1].name; - current_step_index() += current_instruction().ingredients[1].value; - trace("run") << "jumping to instruction " << current_step_index()+1; - break; -} - -:(scenario jump_unless) -recipe main [ - jump-unless 0:literal 1:offset - 1:integer <- copy 1:literal -] -+run: instruction main/0 -+run: ingredient 1 is 1 -+run: jumping to instruction 2 --run: instruction main/1 --mem: storing 1 in location 1 - -:(scenario jump_unless_fallthrough) -recipe main [ - jump-unless 999:literal 1:offset - 123:integer <- copy 1:literal -] -+run: instruction main/0 -+run: ingredient 0 is 999 -+run: jump-unless fell through -+run: instruction main/1 -+mem: storing 1 in location 123 |