If you cannot use tools like
lex/yacc
(or the cousins
flex/bison
) then you should write your own lexer and parser. It shouldn't be a daunting task, since assembly is relatively simple (you may find Crenshaw's wonderful
Let's build a compiler[
^], although dated, useful).