C does not have built-in string handling. Strings are handled via library functions.
Could be done as
Code:
if (strcmp(op,"NOP")==0)
Where strcmp is a library function that returns 0 if the strings are equal.
To use strcmp and other string functions, '#include <string.h>' at the top of the source code file.
You might want to setup a table of opcodes (an array of strings), and iterate through the table in a loop rather than using a whole lot of 'if (strcmp())' statements.
You may also want to try something like C# or VB which have string types. They are a little easier to work with than C.
Using something like the VASM assembler, which is written in C, may be desirable in the long run. The VASM code takes care of numerous details associated with an assembler, symbols, parsing expressions, etc. and may be used with VLINK to link code modules together.