mirror of
https://github.com/samsonjs/blog.git
synced 2026-03-25 09:05:51 +00:00
25 lines
1.1 KiB
HTML
25 lines
1.1 KiB
HTML
Title: A preview of Mach-O file generation
|
|
Date: January 20, 2010
|
|
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>
|