What good is an 8080 CPU emulator without an assembler?
This project takes an input string, tokenises the string into a slice of tokens, then parses those tokens, converting each to a valid 8080 opcode.
- ✅ Tokeniser
- ✅ Parser
- ✅ Comment support
- ✅ Supports all 244 instructions on the 8080 cpu
- Label support
- Data support (define byte, word, storage)
- Input from STDIN
code := `
MVI A, 34h
MOV B, C
LDA 1234h
HLT
`
assembler := &assembler.Assembler{}
assembler.Assemble(code)
for _, instruction := range assembler.ByteCode {
fmt.Printf("%02X ", instruction)
}
// Prints "3E 34 41 3A 34 12 76"
Run go test ./...
.