You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: embed/content/posts/executable-by-hand.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -532,6 +532,30 @@ If you've been following along:
532
532
533
533
True, it's the world's most pointless compiler, and if we're being pedantic it's technically just a code generator, since we're not translating a source language. But hey, now you have something you can build upon. Here's an exercise for you: swap out the hard-coded hello world string with a string that you read from a text file. That's sort of a language, right?
534
534
535
+
By the way, if you want to admire your handiwork, run `hexdump -C my_elf`.
That, is a 230-byte hand-rolled Linux x86_64 executable. Everything the kernel needs to spawn a process. And it's beautiful.
558
+
535
559
## Gotta Go
536
560
537
561
When I had finished the first working version of this program, it took me a few hours of playing around with it to realize that, in my pursuit of learning more about compilers, I ended up building one.
0 commit comments