onie wrote
I have successfully implemented an assembler without symbol handling capability.
Now, how can I create a symbol table? If I make it an array, then 'R2', 'ARG' will have the same index of '2'. Even a jump may be to this place.
You can use a
std::map<std::string, int> container. This container maps strings to integers. You can visualise it as an array that has std:string's as its indexes and integers as its values.
Here is a tutorial on std::map
http://thispointer.com/stdmap-tutorial-part-1-usage-detail-with-examples/--Mark