blog/published/2010.01.20-a-preview-of-mach-o-file-generation.html
2011-12-02 23:22:41 -08:00

26 lines
1.1 KiB
HTML

Title: A preview of Mach-O file generation
Date: January 20, 2010
Timestamp: 1263974400
Author: sjs
Tags: ruby, mach-o, os x, compiler
----
<p>This month I got back into an x86 compiler I started last May. It lives <a
href="https://github.com/samsonjs/compiler">on github</a>.</p>
<p>The code is a bit of a mess but it mostly works. It generates Mach object
files that are linked with gcc to produce executable binaries.</p>
<p>The Big Refactoring of January 2010 has come to an end and the tests pass
again, even if printing is broken it prints <i>something</i>, and more
importantly compiles test/test_huge.code into something that works.</p>
<p>After print is fixed I can clean up the code before implementing anything
new. I wasn't sure if I'd get back into this or not and am pretty excited
about it. I'm learning a lot from this project.</p>
<p>If you are following the Mach-O posts you might want to look at
asm/machofile.rb, a library for creating Mach-O files. Using it is quite
straightforward, an example is in asm/binary.rb, in the #output method.</p>
<p>Definitely time for bed now!</p>