• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ emit_byte函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: emit_jump

static inline void emit_jump(uintptr_t target) {
    emit_byte(0xE9);
    int64_t diff = target - ((uintptr_t) out + 4);
    if(diff > INT32_MAX || diff < INT32_MIN)
        assert(false);

    emit_dword(diff);
}
开发者ID:p0wer0n,项目名称:firebird,代码行数:8,代码来源:translate_x86_64.c


示例17: emit_call_nosave

/*This is a hack:
 * -regs not saved
 * -stack not aligned */
static inline void emit_call_nosave(uintptr_t target) {
    emit_byte(0xE8);
    int64_t diff = target - ((uintptr_t) out + 4);
    if(diff > INT32_MAX || diff < INT32_MIN)
        assert(false); //Distance doesn't fit into immediate

    emit_dword(diff);
}
开发者ID:p0wer0n,项目名称:firebird,代码行数:11,代码来源:translate_x86_64.c


示例18: emit_hash_definition

static void emit_hash_definition(struct q *q, const struct node *node, int idx)
{
    if (node == NULL) {
        die(q, "%s: line %d: bad hash def", serr, node->line_no);
    } else if (node->tok == ',') {
        emit_hash_definition(q, node->left, idx);
        emit_byte(q, OP_POP);
        emit_hash_definition(q, node->right, idx + 1);
    } else if (node->tok == '=') {
        if (node->left->tok == TOK_IDENT) {
            emit_expr(q, node->right);
            emit_byte(q, OP_DUP);
            emit_byte(q, 1);
            emit_ident(q, node->left);
            emit_byte(q, OP_SET);
        } else {
            die(q, "%s: line %d: bad hash def", serr,node->line_no);
        }
    } else {
        /* Key is the index of the entry in the definition */
        emit_expr(q, node);
        emit_byte(q, OP_DUP);
        emit_byte(q, 1);
        emit_num(q, idx);
        emit_byte(q, OP_SET);
    }
}
开发者ID:TheProjecter,项目名称:qvm,代码行数:27,代码来源:q.c


示例19: literal

static void literal()
{
	switch (parser.previous.type)
	{
		case TOKEN_TRUE:
			emit_byte(OP_TRUE);
			break;
		case TOKEN_FALSE:
			emit_byte(OP_FALSE);
			break;
		case TOKEN_NIL:
			emit_byte(OP_NIL);
			break;
		default:
			assert(false && "Can't reach this!");
			return;
	}
}
开发者ID:lerno,项目名称:coil,代码行数:18,代码来源:compiler.c


示例20: emit_function_call

static void emit_function_call(struct q *q, const struct node *node)
{
    int	num_params;

    num_params = emit_params(q, node->right, 0);
    emit_num(q, num_params);
    emit_expr(q, node->left);
    emit_byte(q, OP_CALL);
}
开发者ID:TheProjecter,项目名称:qvm,代码行数:9,代码来源:q.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ emit_insn函数代码示例发布时间:2022-05-30
下一篇:
C++ emit_2ub函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap