I'm currently writing an Intel 4004 emulator and have started writing an assembler for it. Unfortunately while I have written a compiler before I have not written an assembler. I was going to just jump straight into it however have decided to do some research first. I'm reading Assemblers and Loaders by David Salomon. I should be able to write a simple amd64 assembler after reading the first two or three chapters. I'll leave out macros for now.
Currently very much a work in progress. Have decided to use NOM for parsing which I'm really enjoying the more I get the hang of it.