You have a semi-colon after it. Your first line just happens to be the same as your last line. |
Oh, what a silly mistake,.. If you hadn't this mentioned, I would have overlooked that perhaps for long time.
ine.substr(0,line[i])
What do you intend for this to be doing? Perhaps you meant to do just i? |
If a colon would found, then I want to store the label-key without the colon, together with its address,
assembler.parse() doesn't sound like a function that would write to a file, but it does. |
So it would be better, renaming parse() to e.g. assemble()?
If you're working in binary, it would probably be faster to write more than one byte at a time, when possible. |
Is there a way using std::vector<char> like a raw array (char *buf), so I could using a vector like
ofile.wiite( my_vector, my_vector.size()) ?
You're right, this tiny program couldn't mess up with a real assembler. It will rather be used to have at anyway a method producing machine-language binaries, just or testing proposes.
PS: sorry for the lated answer, I got a break :-)