I'm writing a virtual machine that directly executes my own assembly code. Here's an example below:
add r1, r2, r3 ; Add the values of reg2 and reg3 and store the result in reg1
As you can see the instructions are laid out as like this:
INSTRUCTION PARAMETERS OPTIONAL_COMMENT
Would it be best to use regular expressions to parse this or would it be ok to parse it line by line and split each line up by spaces?