C compiler written in Swift with reference to https://www.sigbus.info/compilerbook.
- Step1: 33ec617
- Step2: fba7a80
- Step3: 58e4ce9
- Step4: 65ab533
- Step5: d4e96c8
- Step6: bba7a45
- Step7: ccb67da
$make run ARG="(5*(7-1)+3)==66/2" -s
Building for debugging...
Build complete! (0.11s)
----
.intel_syntax noprefix
.globl main
main:
push 5
push 7
push 1
pop rdi
pop rax
sub rax, rdi
push rax
pop rdi
pop rax
imul rax, rdi
push rax
push 3
pop rdi
pop rax
add rax, rdi
push rax
push 66
push 2
pop rdi
pop rax
cqo
idiv rdi
push rax
pop rdi
pop rax
cmp rax, rdi
sete al
movzb rax, al
push rax
pop rax
ret