Exemplo n.º 1
0
Arquivo: cg-syn.c Projeto: jezze/gaz
void cginitlw(int v, int a)
{

    cglit(v);
    cgstorlw(a);

}
Exemplo n.º 2
0
Arquivo: gen.c Projeto: minux/subc
void genstore(int *lv) {
	if (NULL == lv) return;
	gentext();
	if (!lv[LVSYM]) {
		cgpopptr();
		if (PCHAR == lv[LVPRIM])
			cgstorib();
		else
			cgstoriw();

	}
	else if (CAUTO == Stcls[lv[LVSYM]]) {
		if (PCHAR == lv[LVPRIM])
			cgstorlb(Vals[lv[LVSYM]]);
		else
			cgstorlw(Vals[lv[LVSYM]]);
	}
	else if (CLSTATC == Stcls[lv[LVSYM]]) {
		if (PCHAR == lv[LVPRIM])
			cgstorsb(Vals[lv[LVSYM]]);
		else
			cgstorsw(Vals[lv[LVSYM]]);
	}
	else {
		if (PCHAR == lv[LVPRIM])
			cgstorgb(gsym(Names[lv[LVSYM]]));
		else
			cgstorgw(gsym(Names[lv[LVSYM]]));
	}
}
Exemplo n.º 3
0
Arquivo: gen-syn.c Projeto: jezze/gaz
void genstore(int op, int *lv, int *lv2)
{

    int swapped = 1;

    if (NULL == lv)
        return;

    gentext();

    if (ASSIGN != op)
    {

        if (lv[LVSYM])
        {

            rvalue(lv);

            swapped = 0;

        }

        genasop(op, lv[LVPRIM], lv2[LVPRIM], swapped);

    }

    commit();

    if (!lv[LVSYM])
    {

        cgpopptr();

        if (PCHAR == lv[LVPRIM])
            cgstorib();
        else
            cgstoriw();

    }

    else if (CAUTO == symbols[lv[LVSYM]].stcl)
    {

        if (PCHAR == lv[LVPRIM])
            cgstorlb(symbols[lv[LVSYM]].value);
        else
            cgstorlw(symbols[lv[LVSYM]].value);

    }

    else if (CLSTATC == symbols[lv[LVSYM]].stcl)
    {

        if (PCHAR == lv[LVPRIM])
            cgstorsb(symbols[lv[LVSYM]].value);
        else
            cgstorsw(symbols[lv[LVSYM]].value);

    }

    else
    {

        if (PCHAR == lv[LVPRIM])
            cgstorgb(gsym(symbols[lv[LVSYM]].name));
        else
            cgstorgw(gsym(symbols[lv[LVSYM]].name));

    }

}