Exemple #1
0
void parse_asmdirective(char *dir, char *str, int integer, float fnum)
{
    if (strcmp(dir, ".text") == 0) // deprecated
    {
        Warning("Deprecated assembler directive %s", dir);
    }
    else if (strcmp(dir, ".data") == 0) // deprecated
    {
        Warning("Deprecated assembler directive %s", dir);
    }
    else if (strcmp(dir, ".byte") == 0)
    {
        if (str)
        {
            Error("Unsupported data type for label");
        }

        emit8(integer);
    }
    else if (strcmp(dir, ".word") == 0)
    {
        if (str)
        {
            Error("Unsupported data type for label");
        }

        emit16(integer);
    }
    else if (strcmp(dir, ".dword") == 0)
    {
        if (str)
        {
            AddRelocEntry(str, codeptr);
            emit32(0);
        }
        else
        {
            emit32(integer);
        }
    }
    else if (strcmp(dir, ".float") == 0)
    {
        if (str)
        {
            Error("Unsupported data type for label");
        }

        emitfloat(fnum);
    }
    else if (strcmp(dir, ".string") == 0)
    {
        assert(str != 0);
        output_string(str);
    }
}
Exemple #2
0
	int Assembler::out16(Opa *o)
	{
		emit16(o->oc);
		return (TRUE);
	}