Ejemplo n.º 1
0
void put_code(OCODE *cd)
/*
 *      outputFile a generic instruction.
 */
{       
		int op = cd->opcode,len=0,len2=0;
		AMODE *aps = cd->oper1,*apd = cd->oper2, *ap3 = cd->oper3;
		if (!prm_asmfile)	
			return;
		if (op == op_line) {
			if (!prm_lines)
				return;
			fprintf(outputFile,";\n; Line %d:\t%s\n;\n",(int)apd,(char *)aps);
			return;
		}
		if (aps)
			len = aps->length;
		if (apd)
			len2 = apd->length;
		needpointer = (len != len2) || ((!aps || aps->mode !=am_dreg) && (!apd || apd->mode !=am_dreg));
		putop(op);
		if (prm_nasm && op >=op_ja && op <= op_jns)
			fprintf(outputFile,"\tNEAR");
		switch (op) {
			case op_rep:
			case op_repz:
			case op_repe:
			case op_repnz:
			case op_repne:
			case op_lock:
				return;
		}
    putlen(len);
        if( aps != 0 ) {
                fprintf(outputFile,"\t");
								if (op == op_dd)
									nosize = TRUE;
								putamode(aps);
								nosize = FALSE;
                if( apd != 0 ) 
                        {
                        fprintf(outputFile,",");
                        putamode(apd);
                        }
                if( ap3 != 0 ) 
                        {
                        fprintf(outputFile,",");
                        putamode(ap3);
                        }
				}
  fprintf(outputFile,"\n");
}
Ejemplo n.º 2
0
/*
 * output a generic instruction.
 */
PRIVATE void put_code P1 (const CODE *, ip)
{
    putop (ip->opcode);
    putlen (ip->length);
    if (ip->oper1 != NIL_ADDRESS) {
	oprintf ("\t");
	putamode (ip->oper1, ip->length);
	if (ip->oper2 != NIL_ADDRESS) {
	    if (ip->opcode == op_line) {
		oprintf ("%s%s>>>>\t", newline, comment);
	    } else {
		oprintf (",");
	    }
	    putamode (ip->oper2, ip->length);
	}
    }
    oprintf ("%s", newline);
}
Ejemplo n.º 3
0
static void PrintName(ALIASNAME *name, int offs)
{
    oprintf(icdFile, "(");
    if (!name)
    {
        oprintf(icdFile, "stub");
    }
    else if (name->byUIV)
    {
        putamode(NULL, name->v.uiv->im);
        PrintOffs(name->v.uiv->offset);
    }
    else
    {
        putamode(NULL, name->v.name);
    }
    oprintf(icdFile, ",%d)", offs);
}