3 ms·
The example of assembly at 3:21 is wrong in two ways: First, it's x86_64 assembly, not x86 assembly as claimed. Second, it's way more complicated than necessary
by josephcsible 4y ago
The example of assembly at 3:21 is wrong in two ways: First, it's x86_64 assembly, not x86 assembly as claimed. Second, it's way more complicated than necessary, because the assembly comparisons were generated by compiling with -O0. This is actually x86 and is a more fair comparison:
mov ecx, 2
mov edx, 4
mov eax, ecx
add eax, edx
ret
Also, it sounds like the author either thinks that every variable has to live in a register rather than memory, or doesn't know that memory locations can be given names even in assembly.