Building An Assembler In Haskell: Implementation

In the previous post we wrote a grammar for a simple assembly language, wrote the outline of our parser, derived some properties from the grammar for a simple parser byte and implemented byte. We also saw that there are a few deficiencies in our grammar. In this post we'll implement bytes, menmonic, label and labelAssign. For each parser I'll start with some QuickCheck properties then use those as the spec to implement the parser. Let's get to it!

Continue Reading

Building An Assembler In Haskell

Recently I started building an emulator for the MosTech 6502 Cpu, this post is about the initial stages of building an assembler for a simple assembly language that compiles to runnable 6502 machine code. I've created a repo and updated it as I wrote this post, so at the end of most sections that introduce new code I'll link to a commit which has the code up to that point.

Continue Reading