Lots of comments and cleanup

This commit is contained in:
Clemens-Dautermann 2020-12-17 21:36:39 +01:00
parent 120a575b15
commit 1a95fc2371
8 changed files with 351 additions and 518 deletions

View file

@ -92,10 +92,11 @@ namespace Compiler.Generator
s = $"{Generate(rootNode.Children[0])}" +
"push %rax\n" +
$"{Generate(rootNode.Children[1])}" +
"movl %eax, %ecx" + //move calculated divisor to %ecx
"pop %rbx\n" + //pop divident do %ebx
"movl %eax, %ecx\n" + //move calculated divisor to %ecx
"pop %rax\n" + //pop divident do %eax
"cdq\n" +
"idivl %ecx\n";
"divl %ecx\n" +
"movl %ecx, %eax\n";
break;
default:
throw new ArgumentOutOfRangeException();