subleq 困惑和理解
subleq confusion and understanding
有人可以向我更好地解释 subleq 吗?我在看 http://esolangs.org/wiki/Subleq
有例子:
3 4 6
7 7 7
3 4 0
the first instruction, at address zero, subtracts 7 (address 3) from 7
(address 4). The result in address 4 is 0, so jump to 6. Starting at
address 6 is the instruction 3 4 0 which again subtracts 7 from now 0
and jumps back to 0. Here is a sequence of execution (A and B are
shown after subtraction)
0: 3 4 6 A=7 B=0
6: 3 4 0 A=7 B=-7
0: 3 4 6 A=7 B=-14
6: 3 4 0 A=7 B=-21
0: 3 4 6 A=7 B=-28
...
我的第一个问题是地址0“3 4 6 A=7 B=0”?
他们从哪里得到7?是从前两个数字开始的吗?我认为这与减法有关:S
如果我们看一下矩阵:
3 4 6
7 7 7
3 4 0
作为以下列方式寻址的内存映射(顺序):
0 1 2
3 4 5
6 7 8
引用的文字非常有道理。地址3
和4
中有7
,下一条指令是3 4 0
位于地址6
。
有人可以向我更好地解释 subleq 吗?我在看 http://esolangs.org/wiki/Subleq
有例子:
3 4 6
7 7 7
3 4 0
the first instruction, at address zero, subtracts 7 (address 3) from 7 (address 4). The result in address 4 is 0, so jump to 6. Starting at address 6 is the instruction 3 4 0 which again subtracts 7 from now 0 and jumps back to 0. Here is a sequence of execution (A and B are shown after subtraction)
0: 3 4 6 A=7 B=0 6: 3 4 0 A=7 B=-7 0: 3 4 6 A=7 B=-14 6: 3 4 0 A=7 B=-21 0: 3 4 6 A=7 B=-28 ...
我的第一个问题是地址0“3 4 6 A=7 B=0”? 他们从哪里得到7?是从前两个数字开始的吗?我认为这与减法有关:S
如果我们看一下矩阵:
3 4 6
7 7 7
3 4 0
作为以下列方式寻址的内存映射(顺序):
0 1 2
3 4 5
6 7 8
引用的文字非常有道理。地址3
和4
中有7
,下一条指令是3 4 0
位于地址6
。