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


C++ emit_byte函数代码示例

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


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

示例1: emit_ident

static void emit_ident(struct q *q, const struct node *node)
{
    emit_byte(q, OP_PUSH);
    emit_byte(q, TYPE_STR);
    emit(q, &node->vec.len, sizeof(node->vec.len));
    emit(q, node->vec.ptr, node->vec.len);
}
开发者ID:TheProjecter,项目名称:qvm,代码行数:7,代码来源:q.c

示例2: NOT_LP64

void MacroAssembler::get_thread(Register thread) {

  int segment = NOT_LP64(Assembler::GS_segment) LP64_ONLY(Assembler::FS_segment);
  // Try to emit a Solaris-specific fast TSD/TLS accessor.
  ThreadLocalStorage::pd_tlsAccessMode tlsMode = ThreadLocalStorage::pd_getTlsAccessMode ();
  if (tlsMode == ThreadLocalStorage::pd_tlsAccessIndirect) {            // T1
     // Use thread as a temporary: mov r, gs:[0]; mov r, [r+tlsOffset]
     emit_byte (segment);
     // ExternalAddress doesn't work because it can't take NULL
     AddressLiteral null(0, relocInfo::none);
     movptr (thread, null);
     movptr(thread, Address(thread, ThreadLocalStorage::pd_getTlsOffset())) ;
     return ;
  } else
  if (tlsMode == ThreadLocalStorage::pd_tlsAccessDirect) {              // T2
     // mov r, gs:[tlsOffset]
     emit_byte (segment);
     AddressLiteral tls_off((address)ThreadLocalStorage::pd_getTlsOffset(), relocInfo::none);
     movptr (thread, tls_off);
     return ;
  }

  slow_call_thr_specific(this, thread);

}
开发者ID:tetratec,项目名称:Runescape-Launcher,代码行数:25,代码来源:assembler_solaris_x86.cpp

示例3: emit_string_constant

static void emit_string_constant(struct q *q, const struct node *node)
{
    char			*dst, *src;
    str_size_t		n = 0;

    /* XXX Must go first, cause expand_code may change q->code pointer */
    if (q->code + q->cc + 2 + sizeof(n) + node->vec.len > q->code + q->cs)
        expand_code(q, node->vec.len + 2 + sizeof(n) + 1);

    dst = q->code + q->cc + 2 + sizeof(n);
    src = node->vec.ptr + 1;

    assert(node->vec.ptr[0] == '"');
    assert(node->vec.ptr[node->vec.len - 1] == '"');
    assert(dst + node->vec.len < q->code + q->cs);

    for (; src < node->vec.ptr + node->vec.len - 1; src++, n++)
        if (*src == '%') {
            dst[n] = hex_ascii_to_int(q,src[1],node->line_no) << 4;
            dst[n] |= hex_ascii_to_int(q, src[2], node->line_no);
            src += 2;
        } else {
            dst[n] = *src;
        }

    emit_byte(q, OP_PUSH);
    emit_byte(q, TYPE_STR);
    emit(q, &n, sizeof(n));
    q->cc += n;
}
开发者ID:TheProjecter,项目名称:qvm,代码行数:30,代码来源:q.c

示例4: parse_type_assignment

static void parse_type_assignment()
{
	int local_id = compiler.num_locals++;
	Local *local = &(compiler.locals[local_id]);
	local->name = parser.previous.start;
	local->length = parser.previous.length;

	// Consume the :
	advance();
	consume(TOKEN_IDENTIFIER, "Expected type");

    // Get the identifier
    Type *type = find_type(&parser.previous);
    if (!type)
    {
        error_at(&parser.previous, "Unknown type");
        return;

    }
	// Ignore type for now, otherwise it's not stored in prev

	// Consume the assignment
	consume(TOKEN_ASSIGN, "Expected =");

	advance();
	if (parser.current.type == TOKEN_NO_INIT)
	{
		// No init!
		return;
	}
	expression_after_advance();
    // Conversion here!
	emit_byte(OP_ASSIGN);
	emit_byte((uint8_t)local_id);
}
开发者ID:lerno,项目名称:coil,代码行数:35,代码来源:compiler.c

示例5: emit_marker

LOCAL void
emit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)
/* Emit a marker code */
{
  emit_byte(cinfo, 0xFF);
  emit_byte(cinfo, (int) mark);
}
开发者ID:0culus,项目名称:Doom3-for-MacOSX-,代码行数:7,代码来源:jcmarker.c

示例6: sbitmap_bitmap_show

void sbitmap_bitmap_show(struct sbitmap *sb, struct seq_file *m)
{
	u8 byte = 0;
	unsigned int byte_bits = 0;
	unsigned int offset = 0;
	int i;

	for (i = 0; i < sb->map_nr; i++) {
		unsigned long word = READ_ONCE(sb->map[i].word);
		unsigned int word_bits = READ_ONCE(sb->map[i].depth);

		while (word_bits > 0) {
			unsigned int bits = min(8 - byte_bits, word_bits);

			byte |= (word & (BIT(bits) - 1)) << byte_bits;
			byte_bits += bits;
			if (byte_bits == 8) {
				emit_byte(m, offset, byte);
				byte = 0;
				byte_bits = 0;
				offset++;
			}
			word >>= bits;
			word_bits -= bits;
		}
	}
	if (byte_bits) {
		emit_byte(m, offset, byte);
		offset++;
	}
	if (offset)
		seq_putc(m, '\n');
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:33,代码来源:sbitmap.c

示例7: and

static void and()
{
	// Skip the right argument if the left is true.
	emit_byte(OP_AND);
	int jump = current_chunk()->size;
	emit_byte(0xFF);
	parse_precedence(PREC_AND);
	current_chunk()->code[jump] = (uint8_t)(current_chunk()->size - jump - 1);
}
开发者ID:lerno,项目名称:coil,代码行数:9,代码来源:compiler.c

示例8: emit_modrm_base_offset

static void emit_modrm_base_offset(int r, int basex86reg, int offset) {
    if (offset == 0) {
        emit_byte(basex86reg | r << 3);
    } else if (offset >= -0x80 && offset < 0x80) {
        emit_byte(0x40 | basex86reg | r << 3);
        emit_byte(offset);
    } else {
        emit_byte(0x80 | basex86reg | r << 3);
        emit_dword(offset);
    }
}
开发者ID:p0wer0n,项目名称:firebird,代码行数:11,代码来源:translate_x86_64.c

示例9: emit_marker

LOCAL void
emit_marker (compress_info_ptr cinfo, JPEG_MARKER mark)
#endif	/* XIE_SUPPORTED */
/* Emit a marker code */
{
  emit_byte(cinfo, 0xFF);
  emit_byte(cinfo, mark);
#ifdef XIE_SUPPORTED
  return(0);
#endif	/* XIE_SUPPORTED */
}
开发者ID:dikerex,项目名称:theqvd,代码行数:11,代码来源:jwrjfif.c

示例10: emit_alu_armreg_immediate

static void emit_alu_armreg_immediate(int aluop, int armreg, int imm) {
    if (imm >= -0x80 && imm < 0x80) {
        emit_byte(0x83);
        emit_modrm_armreg(aluop, armreg);
        emit_byte(imm);
    } else {
        emit_byte(0x81);
        emit_modrm_armreg(aluop, armreg);
        emit_dword(imm);
    }
}
开发者ID:p0wer0n,项目名称:firebird,代码行数:11,代码来源:translate_x86_64.c

示例11: emit_alu_x86reg_immediate

static void emit_alu_x86reg_immediate(int aluop, int x86reg, int imm) {
    if (imm >= -0x80 && imm < 0x80) {
        emit_byte(0x83);
        emit_modrm_x86reg(aluop, x86reg);
        emit_byte(imm);
    } else if (x86reg == EAX) {
        emit_byte(0x05 | aluop << 3);
        emit_dword(imm);
    } else {
        emit_byte(0x81);
        emit_modrm_x86reg(aluop, x86reg);
        emit_dword(imm);
    }
}
开发者ID:p0wer0n,项目名称:firebird,代码行数:14,代码来源:translate_x86_64.c

示例12: emit_shift_armreg

static void emit_shift_armreg(int shiftop, int armreg, int count) {
    if (count == SHIFT_BY_CL) {
        emit_byte(0xD3);
        emit_modrm_armreg(shiftop, armreg);
    } else if (count == 0) {
        /* no-op */
    } else if (count == 1) {
        emit_byte(0xD1);
        emit_modrm_armreg(shiftop, armreg);
    } else {
        emit_byte(0xC1);
        emit_modrm_armreg(shiftop, armreg);
        emit_byte(count);
    }
}
开发者ID:p0wer0n,项目名称:firebird,代码行数:15,代码来源:translate_x86_64.c

示例13: emit_byte

int Plotter::filltype(int level)
{
	emit_byte((int) O_FILLTYPE);
	emit_integer(level);
	emit_terminator();
	return 0;
}
开发者ID:neonquill,项目名称:pstoedit,代码行数:7,代码来源:drvlplot.cpp

示例14: emit_dword

void emit_dword(int i)
{
	emit_byte(i&0xff);
	emit_byte((i>>8)&0xff);
	emit_byte((i>>16)&0xff);
	emit_byte((i>>24)&0xff);
}
开发者ID:carriercomm,项目名称:Exult,代码行数:7,代码来源:wuc.c

示例15: parse_auto_assignment

static void parse_auto_assignment()
{
	int local_id = compiler.num_locals++;
	Local *local = &(compiler.locals[local_id]);
	local->name = parser.previous.start;
	local->length = parser.previous.length;

	// Consume the :=
	advance();

	// Handle the expression
	expression();
	// Type needed to be deducted here...
	emit_byte(OP_ASSIGN);
	emit_byte((uint8_t)local_id);
}
开发者ID:lerno,项目名称:coil,代码行数:16,代码来源:compiler.c


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