You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

4h 10m 3s logged

Introduced the infra. for the project and scaffolded the NativeAOT to remove the BCL/runtime so that ILC will just emit raw ASM.

Now what code is valid per se? Well, this:

int main() {
    int x = 10;
    int* p = &x;
    *p = 99;
    return x;
}

So, what ASM is made from this? Well with Debug it’s a lot, but for Release it’s this:

push rax
mov dword ptr [rsp+4], 0Ah
mov dword ptr [rsp+4], 63h
mov eax,dword ptr [rsp+4]
ret

So obviously this is a little stripped down, but you can see how it’s a direct map. And keep in mind: I’m using .NET NativeAOT which was made for a managed language, but I’m using it like LLVM. So, this concludes the first devlog, but I hope I can continue to work on this 😁.

0
1

Comments 0

No comments yet. Be the first!