It is an easily verified fact that H does correctly decide the halt
status of its input.
void Infinite_Loop()
{
HERE: goto HERE;
}
int main()
{
Output("Input_Halts = ", H0(Infinite_Loop));
}
_Infinite_Loop()
[00001342](01) 55 push ebp
[00001343](02) 8bec mov ebp,esp
[00001345](02) ebfe jmp 00001345
[00001347](01) 5d pop ebp
[00001348](01) c3 ret
Size in bytes:(0007) [00001348]
_main()
[00001372](01) 55 push ebp
[00001373](02) 8bec mov ebp,esp
[00001375](05) 6842130000 push 00001342
[0000137a](05) e833fdffff call 000010b2
[0000137f](03) 83c404 add esp,+04
[00001382](01) 50 push eax
[00001383](05)
6823040000 push 00000423
[00001388](05) e8e5f0ffff call 00000472
[0000138d](03) 83c408 add esp,+08
[00001390](02) 33c0 xor eax,eax
[00001392](01) 5d pop ebp
[00001393](01) c3 ret
Size in bytes:(0034) [00001393]
machine stack stack machine assembly
address address data code language
======== ======== ======== ========= =============
[00001372][0010228f][00000000] 55 push ebp
[00001373][0010228f][00000000] 8bec mov ebp,esp
[00001375][0010228b][00001342] 6842130000 push 00001342 // push
_Infinite_Loop
[0000137a][00102287][0000137f] e833fdffff call 000010b2 // call H0
Begin Local Halt Decider Simulation Execution Trace Stored at:212343
[00001342][00212333][00212337] 55 push ebp
[00001343][00212333][00212337] 8bec mov ebp,esp
[00001345][00212333][00212337] ebfe jmp 00001345
[00001345][00212333][00212337] ebfe jmp 00001345
Local Halt Decider: Infinite Loop Detected Simulation Stopped
[0000137f][0010228f][00000000] 83c404 add esp,+04
[00001382][0010228b][00000000] 50 push eax
[00001383][00102287][00000423]
6823040000 push 00000423
[00001388][00102287][00000423] e8e5f0ffff call 00000472
Input_Halts = 0
[0000138d][0010228f][00000000] 83c408 add esp,+08
[00001390][0010228f][00000000] 33c0 xor eax,eax
[00001392][00102293][00100000] 5d pop ebp
[00001393][00102297][00000004] c3 ret
Number of Instructions Executed(680)
int Sum(int X, int Y)
{
return X + Y;
}
int main()
{
Output("Input_Halts = ", H2(Sum, 3, 4));
}
_Sum()
[000012b6](01) 55 push ebp
[000012b7](02) 8bec mov ebp,esp
[000012b9](03) 8b4508 mov eax,[ebp+08]
[000012bc](03) 03450c add eax,[ebp+0c]
[000012bf](01) 5d pop ebp
[000012c0](01) c3 ret
Size in bytes:(0011) [000012c0]
_main()
[00001316](01) 55 push ebp
[00001317](02) 8bec mov ebp,esp
[00001319](02) 6a04 push +04
[0000131b](02) 6a03 push +03
[0000131d](05) 68b6120000 push 000012b6
[00001322](05) e85ffaffff call 00000d86
[00001327](03) 83c40c add esp,+0c
[0000132a](01) 50 push eax
[0000132b](05)
6807040000 push 00000407
[00001330](05) e821f1ffff call 00000456
[00001335](03) 83c408 add esp,+08
[00001338](02) 33c0 xor eax,eax
[0000133a](01) 5d pop ebp
[0000133b](01) c3 ret
Size in bytes:(0038) [0000133b]
machine stack stack machine assembly
address address data code language
======== ======== ======== ========= =============
...[00001316][001021d7][00000000] 55 push ebp
...[00001317][001021d7][00000000] 8bec mov ebp,esp
...[00001319][001021d3][00000004] 6a04 push +04
...[0000131b][001021cf][00000003] 6a03 push +03
...[0000131d][001021cb][000012b6] 68b6120000 push 000012b6
...[00001322][001021c7][00001327] e85ffaffff call 00000d86
Begin Local Halt Decider Simulation Execution Trace Stored at:21228b
...[000012b6][00212273][00212277] 55 push ebp
...[000012b7][00212273][00212277] 8bec mov ebp,esp
...[000012b9][00212273][00212277] 8b4508 mov eax,[ebp+08]
...[000012bc][00212273][00212277] 03450c add eax,[ebp+0c]
...[000012bf][00212277][00000e54] 5d pop ebp
...[000012c0][0021227b][00000003] c3 ret
...[00001327][001021d7][00000000] 83c40c add esp,+0c
...[0000132a][001021d3][00000001] 50 push eax
...[0000132b][001021cf][00000407]
6807040000 push 00000407
---[00001330][001021cf][00000407] e821f1ffff call 00000456
Input_Halts = 1
...[00001335][001021d7][00000000] 83c408 add esp,+08
...[00001338][001021d7][00000000] 33c0 xor eax,eax
...[0000133a][001021db][00100000] 5d pop ebp
...[0000133b][001021df][00000004] c3 ret
Number of Instructions Executed(660)