The following is based on the Sipser proof
I spent two years creating the (fully operational) x86utm operating system to concretely address the halting problem using a halt decider written in C. This partial halt decider invokes an x86 emulator to execute its input in debug step mode. The input is the machine address of the x86 function cast to a 32-bit unsigned integer.
It examines the complete execution trace of this input immediately after each x86 instruction is simulated. As soon as the partial halt decider recognizes a non-terminating behavior pattern it aborts the simulation and reports not-halting.
#define u32 uint32_t
int D(u32 P) // P is a machine address
{
if ( H(P, P) )
return 0 // reject when H accepts
return 1; // accept when H rejects
}
int main()
{
H((u32)D, (u32)D );
}
When H is a simulating halt decider H(D,D) rejects its input as a halting computation on the basis that H(D,D) specifies infinitely nested simulation to H unless H aborts its simulation of D(D).
_D()
[00000cd0](01) 55 push ebp
[00000cd1](02) 8bec mov ebp,esp
[00000cd3](03) 8b4508 mov eax,[ebp+08]
[00000cd6](01) 50 push eax
[00000cd7](03) 8b4d08 mov ecx,[ebp+08]
[00000cda](01) 51 push ecx
[00000cdb](05) e800feffff call 00000ae0
[00000ce0](03) 83c408 add esp,+08
[00000ce3](02) 85c0 test eax,eax
[00000ce5](02) 7404 jz 00000ceb
[00000ce7](02) 33c0 xor eax,eax
[00000ce9](02) eb05 jmp 00000cf0
[00000ceb](05) b801000000 mov eax,00000001
[00000cf0](01) 5d pop ebp
[00000cf1](01) c3 ret
Size in bytes:(0034) [00000cf1]
_main()
[00000d00](01) 55 push ebp
[00000d01](02) 8bec mov ebp,esp
[00000d03](05) 68d00c0000 push 00000cd0
[00000d08](05) 68d00c0000 push 00000cd0
[00000d0d](05) e8cefdffff call 00000ae0
[00000d12](03) 83c408 add esp,+08
[00000d15](02) 33c0 xor eax,eax
[00000d17](01) 5d pop ebp
[00000d18](01) c3 ret
Size in bytes:(0025) [00000d18]
===============================
...[00000d00][00101730][00000000](01) 55 push ebp
...[00000d01][00101730][00000000](02) 8bec mov ebp,esp
...[00000d03][0010172c][00000cd0](05) 68d00c0000 push 00000cd0
...[00000d08][00101728][00000cd0](05) 68d00c0000 push 00000cd0
...[00000d0d][00101724][00000d12](05) e8cefdffff call 00000ae0
Begin Local Halt Decider Simulation at Machine Address:cd0
...[00000cd0][002117d0][002117d4](01) 55 push ebp
...[00000cd1][002117d0][002117d4](02) 8bec mov ebp,esp
...[00000cd3][002117d0][002117d4](03) 8b4508 mov eax,[ebp+08]
...[00000cd6][002117cc][00000cd0](01) 50 push eax
...[00000cd7][002117cc][00000cd0](03) 8b4d08 mov ecx,[ebp+08]
...[00000cda][002117c8][00000cd0](01) 51 push ecx
...[00000cdb][002117c4][00000ce0](05) e800feffff call 00000ae0
...[00000cd0][0025c1f8][0025c1fc](01) 55 push ebp
...[00000cd1][0025c1f8][0025c1fc](02) 8bec mov ebp,esp
...[00000cd3][0025c1f8][0025c1fc](03) 8b4508 mov eax,[ebp+08]
...[00000cd6][0025c1f4][00000cd0](01) 50 push eax
...[00000cd7][0025c1f4][00000cd0](03) 8b4d08 mov ecx,[ebp+08]
...[00000cda][0025c1f0][00000cd0](01) 51 push ecx
...[00000cdb][0025c1ec][00000ce0](05) e800feffff call 00000ae0
Local Halt Decider: Infinite Recursion Detected Simulation Stopped
...[00000d12][00101730][00000000](03) 83c408 add esp,+08
...[00000d15][00101730][00000000](02) 33c0 xor eax,eax
...[00000d17][00101734][00100000](01) 5d pop ebp
...[00000d18][00101738][00000058](01) c3 ret
Number_of_User_Instructions(23)
Number of Instructions Executed(23826)