当前位置: 首页>>代码示例>>C++>>正文


C++ output_line函数代码示例

本文整理汇总了C++中output_line函数的典型用法代码示例。如果您正苦于以下问题:C++ output_line函数的具体用法?C++ output_line怎么用?C++ output_line使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了output_line函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gen_decrement_primary_reg

/**
 * decrement the primary register by one if char, INTSIZE if int
 */
void gen_decrement_primary_reg(LVALUE *lval) {
    output_line("dcx \th");
    switch (lval->ptr_type) {
        case CINT:
        case UINT:
            output_line("dcx \th");
            break;
        case STRUCT:
            gen_immediate2();
            output_number(lval->tagsym->size - 1);
            newline();
            // two's complement
            output_line("mov  \ta,d");
            output_line("cma");
            output_line("mov  \td,a");
            output_line("mov  \ta,e");
            output_line("cma");
            output_line("mov \te,a");
            output_line("inx \td");
            // substract
            output_line("dad \td");
            break ;
        default:
            break;
    }
}
开发者ID:beretta42,项目名称:FUZIX,代码行数:29,代码来源:code8080.c

示例2: header

/**
 * print all assembler info before any code is generated
 */
void header (void) {
    output_string ("; Small C Debug\n;\tCoder (ac0)\n;");
    frontend_version();
    newline ();
    output_line ("\t;program area SMALLC_GENERATED is RELOCATABLE");
    output_line ("\t.module SMALLC_GENERATED");
}
开发者ID:EtchedPixels,项目名称:FUZIX,代码行数:10,代码来源:codegeneric.c

示例3: main

int main()
{
	double /* **U, **Unew,err=0.0,*/ sta = 1.0/8.0, stb=1.0/128.0;
	int sa = 9, sb = 129, i/*,j*/;
	FILE *outs;
	init(&U,sa,sa);
	init(&Unew,sa,sa);
	init(&Ub,sb,sb);
	
	init_cond(&U, sa, sa, sta,sta);
	
	memcpy(&Unew,&U,sizeof(Unew));
	for(i = 0; i<1000 /*&& (err>0.001 || err == 0.0)*/; i++)
	{
		//err = 0.0;
		iteration(&U,&Unew, sa,sa, sta,sta);
		memcpy(&U,&Unew,sizeof(Unew));
	}
	
	outs = fopen("../output/out1.dat", "w");
	output_line(U, sa,sa, sta,sta, outs);
	fclose(outs);
	
	//init_cond(&Ub, sb, sb, stb,stb);
	interpol(&Ub, sb, sb, stb, stb, 	&U, sa-1, sa-1, sta, sta);
	init_cond(&Ub, sb, sb, stb, stb);
	
	outs = fopen("../output/out2.dat", "w");
	output_line(Ub, sb,sb, stb,stb, outs);
	fclose(outs);
	
	freeArr(&Unew, sa);
	//output_line(U, sa,sa, sta,sta);
	//output_line(Ub, sb,sb, stb,stb);
	//freeArr(&U, sa);
	init(&Unew,sb,sb);
	init_cond(&Unew, sb, sb, stb, stb);
	memcpy(&Unew,&Ub,sizeof(Ub));
	//err = 0.0;
	for(i = 0; i<1000 /*&& (err>0.0005 || err == 0.0)*/ ; i++)
	{
		iteration(&Ub,&Unew, sb,sb, stb,stb);
		memcpy(&Ub,&Unew,sizeof(Unew));
	}
	
	outs = fopen("../output/out3.dat", "w");
	output_line(Ub, sb,sb, stb,stb, outs);
	fclose(outs);
	
	
	outs = fopen("../output/out3_mstk.dat", "w");
	opt_mstk_line(Ub, sb,sb, stb,stb, outs);
	fclose(outs);
	//output_line(U, size,size, step,step);

	//printf("%f %f %f\n", step*5, step*5, err);
	return 0;
}
开发者ID:VVBondarenko,项目名称:FDM-Solver,代码行数:58,代码来源:main.c

示例4: gen_push

/**
 * push the primary register onto the stack
 */
void gen_push(int reg) {
    if (reg & DE_REG) {
        output_line ("push\td");
        stkp = stkp - INTSIZE;
    } else {
        output_line ("push\th");
        stkp = stkp - INTSIZE;
    }
}
开发者ID:beretta42,项目名称:FUZIX,代码行数:12,代码来源:code8080.c

示例5: gen_put_indirect

/**
 * store the specified object type in the primary register
 * at the address in secondary register (on the top of the stack)
 * @param typeobj
 */
void gen_put_indirect(char typeobj) {
    if (typeobj & CCHAR) {
        //gen_call("ccpchar");
        output_line("popstoreb r1 (r2)");
    } else {
        output_line("popstore r1 (r2)");
    }
    stkp = stkp + INTSIZE;
}
开发者ID:EtchedPixels,项目名称:FUZIX,代码行数:14,代码来源:codegeneric.c

示例6: header

/**
 * print all assembler info before any code is generated
 */
void header (void) {
    output_string ("; Small C 8080\n;\tCoder (2.4,84/11/27)\n;");
    frontend_version();
    newline ();
    output_line ("\t;program area SMALLC_GENERATED is RELOCATABLE");
    output_line ("\t.module SMALLC_GENERATED");
    output_line ("\t.list   (err, loc, bin, eqt, cyc, lin, src, lst, md)");
    output_line ("\t.nlist  (pag)");
}
开发者ID:beretta42,项目名称:FUZIX,代码行数:12,代码来源:code8080.c

示例7: gen_test_jump

/**
 * test the primary register and jump if false to label
 * @param label the label
 * @param ft if true jnz is generated, jz otherwise
 */
void gen_test_jump(int label, int ft)
{
    output_line ("mov \ta,h");
    output_line ("ora \tl");
    if (ft)
        output_with_tab ("jnz \t");
    else
        output_with_tab ("jz  \t");
    print_label (label);
    newline ();
}
开发者ID:beretta42,项目名称:FUZIX,代码行数:16,代码来源:code8080.c

示例8: do_report

static void
do_report(const char *filename, unsigned line_no, const char *severity,
          const char *fmt, va_list args)
{
    char buf[128];
    vsnprintf(buf, sizeof(buf), fmt, args);
    buf[sizeof(buf) - 1] = 0;
    if (filename != NULL)
        output_line(0, "%s:%d: %s: %s",
                    filename, line_no, severity, buf);
    else
        output_line(0, "%s: %s", severity, buf);
}
开发者ID:maltek,项目名称:platform_external_ltrace,代码行数:13,代码来源:output.c

示例9: gen_put_indirect

/**
 * store the specified object type in the primary register
 * at the address in secondary register (on the top of the stack)
 * @param typeobj
 */
void gen_put_indirect(char typeobj) {
    gen_pop ();
    if (typeobj & CCHAR) {
        //gen_call("ccpchar");
        output_line("mov \ta,l");
        output_line("stax\td");
    } else {
        if (uflag) {
            output_line("shlx");
        } else {
            gen_call("ccpint");
        }
    }
}
开发者ID:beretta42,项目名称:FUZIX,代码行数:19,代码来源:code8080.c

示例10: gen_decrement_primary_reg

/**
 * decrement the primary register by one if char, INTSIZE if int
 */
void gen_decrement_primary_reg(LVALUE *lval) {
    switch (lval->ptr_type) {
        case CINT:
        case UINT:
            output_line("sub r1 2");
            break;
        case STRUCT:
            output_with_tab("sub r1 ");
            output_number(lval->tagsym->size - 1);
            newline();
            break ;
        default:
            output_line("sub r1 1");
            break;
    }
}
开发者ID:EtchedPixels,项目名称:FUZIX,代码行数:19,代码来源:codegeneric.c

示例11: gen_get_indirect

/**
 * fetch the specified object type indirect through the primary
 * register into the primary register
 * @param typeobj object type
 */
void gen_get_indirect(char typeobj, int reg) {
    if (typeobj == CCHAR) {
        if (reg & DE_REG) {
            gen_swap();
        }
        output_line("loadsb r1 (r1)");
    } else if (typeobj == UCHAR) {
        if (reg & DE_REG) {
            gen_swap();
        }
        //gen_call("cguchar");
        output_line("loadub r1 (r1)");
    } else { // int
         output_line("load r1 (r1)");
    }
}
开发者ID:EtchedPixels,项目名称:FUZIX,代码行数:21,代码来源:codegeneric.c

示例12: main

int main()
{
    char token[MAXL];
    char repeat[MAXL];

    if(access("token.txt",0))
        printf("You don't have token, please set it:");
    else
    {
        printf("You have a token, will you change it (y/n):");
        if(getchar()!='y') {
            printf("bye~\n");
            return 0;
        }
        printf("Please set it:");
    }

    while(1)
    {
        input_token(token);
        printf("Repeat it:");
        input_token(repeat);
        if(strcmp(token,repeat)) {
            printf("they are not same, please set it again:");
            continue;
        }
        break;
    }

    FILE *out=fopen("token.txt","w");
    output_line(out,token);
    fclose(out);

    return 0;
}
开发者ID:IceDream61,项目名称:keys,代码行数:35,代码来源:put_token.c

示例13: gen_increment_primary_reg

/**
 * increment the primary register by 1 if char, INTSIZE if int
 */
void gen_increment_primary_reg(LVALUE *lval) {
    switch (lval->ptr_type) {
        case STRUCT:
            gen_immediate2();
            output_number(lval->tagsym->size);
            newline();
            output_line("dad \td");
            break ;
        case CINT:
        case UINT:
            output_line("inx \th");
        default:
            output_line("inx \th");
            break;
    }
}
开发者ID:beretta42,项目名称:FUZIX,代码行数:19,代码来源:code8080.c

示例14: playback_line

int playback_line( int buflen, char *buffer, int *read_size )
{
   char *cp;

   if ( recording == ON || replaying == OFF )
   {
      return ( -1 );
   }

   if ( fgets( buffer, buflen, rfp ) == NULL )
   {
      close_record(  );
      return ( -1 );
   }
   else
   {
      cp = strrchr( buffer, '\n' );
      if ( cp != NULL )
      {
         *cp = '\0';
      }
      *read_size = strlen( buffer );
      output_line( buffer );
   }

   return ( '\n' );

}                               /* playback_line */
开发者ID:dschwen,项目名称:jszip,代码行数:28,代码来源:fileio.c

示例15: main

int main(int argc, char **argv)
{
  const char *label;
  unsigned pos;
  
  switch (argc)
  {
  case 1:
    label = "";
    break;
  case 2:
    if (is_help_option(argv[1]))
    {
      usage();
      return EXIT_SUCCESS;
    }
    else label = argv[1];
    break;
  default:
    usage();
    return EXIT_FAILURE;
  }

  for (pos = 0;;)
  {
    unsigned char buf[LINE];

    unsigned left = LINE - (pos % LINE);
    int res;
    
    /* Try reading the rest of the current line. */
    res = do_read(STDIN_FILENO, buf, left);
    if (!res)
      /* EOF */
      return EXIT_SUCCESS;

    else if (res < 0)
      {
	fprintf(stderr, "%s: read error: %s\n", label, strerror(errno));
	return EXIT_FAILURE;
      }

    /* Dump it */
    if (output_line(STDERR_FILENO, label, pos, buf, res) <= 0)
      {
	fprintf(stderr, "%s: write error on stderr: %s\n", label, strerror(errno));
	return EXIT_FAILURE;
      }
    
    /* And pass it on */
    if (do_write(STDOUT_FILENO, buf, res) < 0)
      {
	fprintf(stderr, "%s: write error: %s\n", label, strerror(errno));
	return EXIT_FAILURE;
      }

    pos += res;
  }
}
开发者ID:jeremyfrench,项目名称:lsh,代码行数:59,代码来源:dump-hex.c


注:本文中的output_line函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。