예제 #1
0
파일: gen.c 프로젝트: minux/subc
int gensub(int p1, int p2, int swapped) {
	int	rp = PINT;

	gentext();
	if (cgload2() || !swapped) cgswap();
	if (!inttype(p1) && !inttype(p2) && p1 != p2)
		error("incompatible pointer types in binary '-'", NULL);
	if (ptr(p1) && !ptr(p2)) {
		if (needscale(p1)) {
			if (	(p1 & STCMASK) == STCPTR ||
				(p1 & STCMASK) == UNIPTR
			)
				cgscale2by(objsize(deref(p1), TVARIABLE, 1));
			else
				cgscale2();
		}
		rp = p1;
	}
	cgsub();
	if (needscale(p1) && needscale(p2)) {
		if (	(p1 & STCMASK) == STCPTR ||
			(p1 & STCMASK) == UNIPTR
		)
			cgunscaleby(objsize(deref(p1), TVARIABLE, 1));
		else
			cgunscale();
	}
	return rp;
}
예제 #2
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genior(void)
{

    gentext();
    cgsynor();

}
예제 #3
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genxor(void)
{

    gentext();
    cgsynxor();

}
예제 #4
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genentry(void)
{

    gentext();
    cgentry();

}
예제 #5
0
파일: gen.c 프로젝트: minux/subc
void genlocinit(void) {
	int	i;

	gentext();
	for (i=0; i<Nli; i++)
		cginitlw(LIval[i], LIaddr[i]);
}
예제 #6
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genand(void)
{

    gentext();
    cgsynand();

}
예제 #7
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genexit(void)
{

    gentext();
    cgexit();

}
예제 #8
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genldlab(int id)
{

    gentext();
    queue(addr_label, id, NULL);

}
예제 #9
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genlit(int v)
{

    gentext();
    queue(literal, v, NULL);

}
예제 #10
0
파일: genmarker.c 프로젝트: 1014511134/src
static void text_marker (char *txbuffer, int size, int npts, int *pvec)
{

    while (npts--)
    {
	xold = *pvec;
	yold = *(pvec + 1);
	if (dev.txfont < NUMGENFONT)
	{
	    gentext (txbuffer,
		     /* Character path direction */
		     (float) size * dev.aspect_ratio,
		     (float) 0,
		     /* Character up vector direction */
		     (float) 0,
		     (float) size);
	}
	else
	{
	    dev.text (txbuffer,
		      /* Character path direction */
		      (float) size * dev.aspect_ratio,
		      (float) 0,
		      /* Character up vector direction */
		      (float) 0,
		      (float) size);
	}
	pvec += 2;
    }
}
예제 #11
0
파일: gen.c 프로젝트: minux/subc
void genrval(int *lv) {
	if (NULL == lv) return;
	gentext();
	if (!lv[LVSYM]) {
		genind(lv[LVPRIM]);
	}
	else if (CAUTO == Stcls[lv[LVSYM]]) {
		if (PCHAR == lv[LVPRIM])
			queue(auto_byte, Vals[lv[LVSYM]], NULL);
		else
			queue(auto_word, Vals[lv[LVSYM]], NULL);
	}
	else if (CLSTATC == Stcls[lv[LVSYM]]) {
		if (PCHAR == lv[LVPRIM])
			queue(static_byte, Vals[lv[LVSYM]], NULL);
		else
			queue(static_word, Vals[lv[LVSYM]], NULL);
	}
	else {
		if (PCHAR == lv[LVPRIM])
			queue(globl_byte, 0, Names[lv[LVSYM]]);
		else
			queue(globl_word, 0, Names[lv[LVSYM]]);
	}
}
예제 #12
0
파일: gen.c 프로젝트: 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]]));
	}
}
예제 #13
0
파일: gen.c 프로젝트: minux/subc
int genadd(int p1, int p2, int swapped) {
	int	rp = PINT, t;

	gentext();
	if (cgload2() || !swapped) {
		t = p1;
		p1 = p2;
		p2 = t;
	}
	if (ptr(p1)) {
		if (needscale(p1)) {
			if (	(p1 & STCMASK) == STCPTR ||
				(p1 & STCMASK) == UNIPTR
			)
				cgscale2by(objsize(deref(p1), TVARIABLE, 1));
			else
				cgscale2();
		}
		rp = p1;
	}
	else if (ptr(p2)) {
		if (needscale(p2)) {
			if (	(p2 & STCMASK) == STCPTR ||
				(p2 & STCMASK) == UNIPTR
			)
				cgscaleby(objsize(deref(p2), TVARIABLE, 1));
			else
				cgscale();
		}
		rp = p2;
	}
	cgadd();
	return rp;
}
예제 #14
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genmul(void)
{

    gentext();
    cgload();
    cgmul();

}
예제 #15
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genpush(void)
{

    gentext();
    commit();
    cgpush();

}
예제 #16
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genjump(int dest)
{

    gentext();
    commit();
    cgjump(dest);

}
예제 #17
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genscale2(void)
{

    gentext();
    commit();
    cgscale2();

}
예제 #18
0
파일: gen.c 프로젝트: minux/subc
void genind(int p) {
	gentext();
	commit();
	if (PCHAR == p)
		cgindb();
	else
		cgindw();
}
예제 #19
0
파일: gen-syn.c 프로젝트: jezze/gaz
void gennot(void)
{

    gentext();
    commit();
    cgnot();

}
예제 #20
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genneg(void)
{

    gentext();
    commit();
    cgneg();

}
예제 #21
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genlognot(void)
{

    gentext();
    commit();
    cglognot();

}
예제 #22
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genbool(void)
{

    gentext();
    commit();
    cgbool();

}
예제 #23
0
파일: gen-syn.c 프로젝트: jezze/gaz
void gencall(int y)
{

    gentext();
    commit();
    cgcall(gsym(symbols[y].name));
    load();

}
예제 #24
0
파일: gen-syn.c 프로젝트: jezze/gaz
void gencalr(void)
{

    gentext();
    commit();
    cgcalr();
    load();

}
예제 #25
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genprelude(void)
{

    Textseg = 0;

    gentext();
    cgprelude();

}
예제 #26
0
파일: gen.c 프로젝트: minux/subc
void genaddr(int y) {
	gentext();
	if (CAUTO == Stcls[y])
		queue(addr_auto, Vals[y], NULL);
	else if (CLSTATC == Stcls[y])
		queue(addr_static, Vals[y], NULL);
	else
		queue(addr_globl, 0, Names[y]);
}
예제 #27
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genpushlit(int n)
{

    gentext();
    commit();
    spill();
    cgpushlit(n);

}
예제 #28
0
파일: gen-syn.c 프로젝트: jezze/gaz
void gendiv(int swapped)
{

    gentext();

    if (cgload() || !swapped)
        cgswap();

    cgdiv();

}
예제 #29
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genshr(int swapped)
{

    gentext();

    if (cgload() || !swapped)
        cgswap();

    cgshr();

}
예제 #30
0
파일: gen-syn.c 프로젝트: jezze/gaz
void genmod(int swapped)
{

    gentext();

    if (cgload() || !swapped)
        cgswap();

    cgmod();

}