亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? x86bc.c

?? 支持AMD64的匯編編譯器源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * x86 bytecode utility functions * *  Copyright (C) 2001  Peter Johnson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */#include <util.h>/*@unused@*/ RCSID("$Id: x86bc.c 1168 2004-10-31 01:07:52Z peter $");#define YASM_LIB_INTERNAL#define YASM_BC_INTERNAL#define YASM_EXPR_INTERNAL#include <libyasm.h>#include "x86arch.h"/* Effective address type */typedef struct x86_effaddr {    yasm_effaddr ea;		/* base structure */    /* PC-relative portions are for AMD64 only (RIP addressing) */    /*@null@*/ /*@dependent@*/ yasm_symrec *origin;    /* pcrel origin */    unsigned char segment;	/* segment override, 0 if none */    /* How the spare (register) bits in Mod/RM are handled:     * Even if valid_modrm=0, the spare bits are still valid (don't overwrite!)     * They're set in bytecode_create_insn().     */    unsigned char modrm;    unsigned char valid_modrm;	/* 1 if Mod/RM byte currently valid, 0 if not */    unsigned char need_modrm;	/* 1 if Mod/RM byte needed, 0 if not */    unsigned char sib;    unsigned char valid_sib;	/* 1 if SIB byte currently valid, 0 if not */    unsigned char need_sib;	/* 1 if SIB byte needed, 0 if not,				   0xff if unknown */    unsigned char pcrel;	/* 1 if PC-relative transformation needed */} x86_effaddr;/* Bytecode types */typedef struct x86_insn {    yasm_bytecode bc;		/* base structure */    /*@null@*/ x86_effaddr *ea;	/* effective address */    /*@null@*/ yasm_immval *imm;/* immediate or relative value */    unsigned char opcode[3];	/* opcode */    unsigned char opcode_len;    unsigned char addrsize;	/* 0 or =mode_bits => no override */    unsigned char opersize;	/* 0 or =mode_bits => no override */    unsigned char lockrep_pre;	/* 0 indicates no prefix */    unsigned char def_opersize_64;  /* default operand size in 64-bit mode */    unsigned char special_prefix;   /* "special" prefix (0=none) */    unsigned char rex;		/* REX AMD64 extension, 0 if none,				   0xff if not allowed (high 8 bit reg used) */    /* HACK, but a space-saving one: shift opcodes have an immediate     * form and a ,1 form (with no immediate).  In the parser, we     * set this and opcode_len=1, but store the ,1 version in the     * second byte of the opcode array.  We then choose between the     * two versions once we know the actual value of imm (because we     * don't know it in the parser module).     *     * A override to force the imm version should just leave this at     * 0.  Then later code won't know the ,1 version even exists.     * TODO: Figure out how this affects CPU flags processing.     *     * Call x86_SetInsnShiftFlag() to set this flag to 1.     */    unsigned char shift_op;    /* HACK, similar to that for shift_op above, for optimizing instructions     * that take a sign-extended imm8 as well as imm values (eg, the arith     * instructions and a subset of the imul instructions).     */    unsigned char signext_imm8_op;    /* HACK, similar to those above, for optimizing long (modrm+sib) mov     * instructions in amd64 into short mov instructions if a 32-bit address     * override is applied in 64-bit mode to an EA of just an offset (no     * registers) and the target register is al/ax/eax/rax.     */    unsigned char shortmov_op;    unsigned char mode_bits;} x86_insn;typedef struct x86_jmp {    yasm_bytecode bc;		/* base structure */    yasm_expr *target;		/* target location */    /*@dependent@*/ yasm_symrec *origin;    /* jump origin */    struct {	unsigned char opcode[3];	unsigned char opcode_len;   /* 0 = no opc for this version */    } shortop, nearop, farop;    /* which opcode are we using? */    /* The *FORCED forms are specified in the source as such */    x86_jmp_opcode_sel op_sel;    unsigned char addrsize;	/* 0 or =mode_bits => no override */    unsigned char opersize;	/* 0 indicates no override */    unsigned char lockrep_pre;	/* 0 indicates no prefix */    unsigned char mode_bits;} x86_jmp;/* Effective address callback function prototypes */static void x86_ea_destroy(yasm_effaddr *ea);static void x86_ea_print(const yasm_effaddr *ea, FILE *f, int indent_level);/* Bytecode callback function prototypes */static void x86_bc_insn_destroy(yasm_bytecode *bc);static void x86_bc_insn_print(const yasm_bytecode *bc, FILE *f,			      int indent_level);static yasm_bc_resolve_flags x86_bc_insn_resolve    (yasm_bytecode *bc, int save, yasm_calc_bc_dist_func calc_bc_dist);static int x86_bc_insn_tobytes(yasm_bytecode *bc, unsigned char **bufp,			       void *d, yasm_output_expr_func output_expr,			       /*@null@*/ yasm_output_reloc_func output_reloc);static void x86_bc_jmp_destroy(yasm_bytecode *bc);static void x86_bc_jmp_print(const yasm_bytecode *bc, FILE *f,			     int indent_level);static yasm_bc_resolve_flags x86_bc_jmp_resolve    (yasm_bytecode *bc, int save, yasm_calc_bc_dist_func calc_bc_dist);static int x86_bc_jmp_tobytes(yasm_bytecode *bc, unsigned char **bufp,			      void *d, yasm_output_expr_func output_expr,			      /*@null@*/ yasm_output_reloc_func output_reloc);/* Effective address callback structures */static const yasm_effaddr_callback x86_ea_callback = {    x86_ea_destroy,    x86_ea_print};/* Bytecode callback structures */static const yasm_bytecode_callback x86_bc_callback_insn = {    x86_bc_insn_destroy,    x86_bc_insn_print,    x86_bc_insn_resolve,    x86_bc_insn_tobytes};static const yasm_bytecode_callback x86_bc_callback_jmp = {    x86_bc_jmp_destroy,    x86_bc_jmp_print,    x86_bc_jmp_resolve,    x86_bc_jmp_tobytes};intyasm_x86__set_rex_from_reg(unsigned char *rex, unsigned char *low3,			   unsigned long reg, unsigned int bits,			   x86_rex_bit_pos rexbit){    *low3 = (unsigned char)(reg&7);    if (bits == 64) {	x86_expritem_reg_size size = (x86_expritem_reg_size)(reg & ~0xFUL);	if (size == X86_REG8X || (reg & 0xF) >= 8) {	    if (*rex == 0xff)		return 1;	    *rex |= 0x40 | (((reg & 8) >> 3) << rexbit);	} else if (size == X86_REG8 && (reg & 7) >= 4) {	    /* AH/BH/CH/DH, so no REX allowed */	    if (*rex != 0 && *rex != 0xff)		return 1;	    *rex = 0xff;	}    }    return 0;}/*@-compmempass -mustfree@*/yasm_bytecode *yasm_x86__bc_create_insn(yasm_arch *arch, x86_new_insn_data *d){    yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch;    x86_insn *insn;       insn = (x86_insn *)yasm_bc_create_common(&x86_bc_callback_insn,					     sizeof(x86_insn), d->line);    insn->ea = (x86_effaddr *)d->ea;    if (d->ea) {	insn->ea->origin = d->ea_origin;	insn->ea->modrm &= 0xC7;	/* zero spare/reg bits */	insn->ea->modrm |= (d->spare << 3) & 0x38;  /* plug in provided bits */    }    if (d->imm) {	insn->imm = yasm_imm_create_expr(d->imm);	insn->imm->len = d->im_len;	insn->imm->sign = d->im_sign;    } else	insn->imm = NULL;    insn->opcode[0] = d->op[0];    insn->opcode[1] = d->op[1];    insn->opcode[2] = d->op[2];    insn->opcode_len = d->op_len;    insn->addrsize = 0;    insn->opersize = d->opersize;    insn->def_opersize_64 = d->def_opersize_64;    insn->special_prefix = d->special_prefix;    insn->lockrep_pre = 0;    insn->rex = d->rex;    insn->shift_op = d->shift_op;    insn->signext_imm8_op = d->signext_imm8_op;    insn->shortmov_op = d->shortmov_op;    insn->mode_bits = arch_x86->mode_bits;    return (yasm_bytecode *)insn;}/*@=compmempass =mustfree@*//*@-compmempass -mustfree@*/yasm_bytecode *yasm_x86__bc_create_jmp(yasm_arch *arch, x86_new_jmp_data *d){    yasm_arch_x86 *arch_x86 = (yasm_arch_x86 *)arch;    x86_jmp *jmp;    jmp = (x86_jmp *) yasm_bc_create_common(&x86_bc_callback_jmp,					    sizeof(x86_jmp), d->line);    jmp->target = d->target;    jmp->origin = d->origin;    jmp->op_sel = d->op_sel;    if ((d->op_sel == JMP_SHORT_FORCED) && (d->near_op_len == 0))	yasm__error(d->line,		    N_("no SHORT form of that jump instruction exists"));    if ((d->op_sel == JMP_NEAR_FORCED) && (d->short_op_len == 0))	yasm__error(d->line,		    N_("no NEAR form of that jump instruction exists"));    jmp->shortop.opcode[0] = d->short_op[0];    jmp->shortop.opcode[1] = d->short_op[1];    jmp->shortop.opcode[2] = d->short_op[2];    jmp->shortop.opcode_len = d->short_op_len;    jmp->nearop.opcode[0] = d->near_op[0];    jmp->nearop.opcode[1] = d->near_op[1];    jmp->nearop.opcode[2] = d->near_op[2];    jmp->nearop.opcode_len = d->near_op_len;    jmp->farop.opcode[0] = d->far_op[0];    jmp->farop.opcode[1] = d->far_op[1];    jmp->farop.opcode[2] = d->far_op[2];    jmp->farop.opcode_len = d->far_op_len;    jmp->addrsize = d->addrsize;    jmp->opersize = d->opersize;    jmp->lockrep_pre = 0;    jmp->mode_bits = arch_x86->mode_bits;    return (yasm_bytecode *)jmp;}/*@=compmempass =mustfree@*/voidyasm_x86__ea_set_segment(yasm_effaddr *ea, unsigned int segment,			 unsigned long line){    x86_effaddr *x86_ea = (x86_effaddr *)ea;    if (!ea)	return;    if (segment != 0 && x86_ea->segment != 0)	yasm__warning(YASM_WARN_GENERAL, line,		      N_("multiple segment overrides, using leftmost"));    x86_ea->segment = (unsigned char)segment;}voidyasm_x86__ea_set_disponly(yasm_effaddr *ea){    x86_effaddr *x86_ea = (x86_effaddr *)ea;    x86_ea->valid_modrm = 0;    x86_ea->need_modrm = 0;    x86_ea->valid_sib = 0;    x86_ea->need_sib = 0;    x86_ea->pcrel = 0;}yasm_effaddr *yasm_x86__ea_create_reg(unsigned long reg, unsigned char *rex,			unsigned int bits){    x86_effaddr *x86_ea;    unsigned char rm;    if (yasm_x86__set_rex_from_reg(rex, &rm, reg, bits, X86_REX_B))	return NULL;    x86_ea = yasm_xmalloc(sizeof(x86_effaddr));    x86_ea->ea.callback = &x86_ea_callback;    x86_ea->ea.disp = (yasm_expr *)NULL;    x86_ea->ea.len = 0;    x86_ea->ea.nosplit = 0;    x86_ea->segment = 0;    x86_ea->modrm = 0xC0 | rm;	/* Mod=11, R/M=Reg, Reg=0 */    x86_ea->valid_modrm = 1;    x86_ea->need_modrm = 1;    x86_ea->sib = 0;    x86_ea->valid_sib = 0;    x86_ea->need_sib = 0;    x86_ea->pcrel = 0;    return (yasm_effaddr *)x86_ea;}yasm_effaddr *yasm_x86__ea_create_expr(yasm_arch *arch, yasm_expr *e){    x86_effaddr *x86_ea;    x86_ea = yasm_xmalloc(sizeof(x86_effaddr));    x86_ea->ea.callback = &x86_ea_callback;    x86_ea->ea.disp = e;    x86_ea->ea.len = 0;    x86_ea->ea.nosplit = 0;    x86_ea->segment = 0;    x86_ea->modrm = 0;    x86_ea->valid_modrm = 0;    x86_ea->need_modrm = 1;    x86_ea->sib = 0;    x86_ea->valid_sib = 0;    /* We won't know whether we need an SIB until we know more about expr and     * the BITS/address override setting.     */    x86_ea->need_sib = 0xff;    x86_ea->pcrel = 0;    return (yasm_effaddr *)x86_ea;}/*@-compmempass@*/yasm_effaddr *yasm_x86__ea_create_imm(yasm_expr *imm, unsigned int im_len){    x86_effaddr *x86_ea;    x86_ea = yasm_xmalloc(sizeof(x86_effaddr));    x86_ea->ea.callback = &x86_ea_callback;    x86_ea->ea.disp = imm;    x86_ea->ea.len = (unsigned char)im_len;    x86_ea->ea.nosplit = 0;    x86_ea->segment = 0;    x86_ea->modrm = 0;    x86_ea->valid_modrm = 0;    x86_ea->need_modrm = 0;    x86_ea->sib = 0;    x86_ea->valid_sib = 0;    x86_ea->need_sib = 0;    x86_ea->pcrel = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲第一成年网| 亚洲成av人片在线观看无码| 国产精品免费免费| 欧美日韩一区二区三区视频| 国产成人午夜片在线观看高清观看| 一区二区三区日本| 久久久久99精品一区| 欧美日韩另类一区| 4438成人网| 欧美电影在线免费观看| 欧美体内she精视频| 日本韩国精品在线| 一本大道综合伊人精品热热| 91美女在线看| 在线中文字幕不卡| 中文字幕精品三区| 亚洲美腿欧美偷拍| 亚洲精品中文字幕乱码三区| 亚洲一二三四久久| 中文字幕日韩av资源站| 亚洲私人影院在线观看| 一区二区三区在线视频观看58| 国产一区二区免费看| 国产成人在线观看免费网站| 日韩一区二区在线看片| 日韩欧美国产综合在线一区二区三区 | 亚洲另类在线一区| 国产精品1区2区| 99久久精品免费| 欧美老肥妇做.爰bbww视频| 亚洲精品videosex极品| 91老师国产黑色丝袜在线| 中文字幕在线不卡视频| 成人av在线观| 欧美日韩国产精选| 亚洲高清中文字幕| 欧美美女直播网站| 亚洲国产综合色| 91精品一区二区三区久久久久久| 日本视频一区二区三区| 成人福利视频网站| 国产精品三级久久久久三级| 成人av片在线观看| 中文字幕亚洲不卡| 在线观看一区日韩| 精品欧美黑人一区二区三区| 亚洲欧洲精品天堂一级| 97精品电影院| 五月综合激情网| 99精品一区二区| 亚洲精品免费在线| 欧美男人的天堂一二区| 麻豆91在线看| 91国产视频在线观看| 亚洲精品免费播放| 欧美精品久久99久久在免费线| 琪琪一区二区三区| 精品视频色一区| 免费成人在线网站| 欧美经典三级视频一区二区三区| 色综合欧美在线| 日产精品久久久久久久性色| 国产亚洲一区二区在线观看| 日韩综合小视频| 日本国产一区二区| 日本成人在线网站| 中文字幕欧美国产| 欧美日韩国产精品成人| 国产美女在线观看一区| 一区二区三区产品免费精品久久75| 91精品在线免费| 99久久免费精品| 青娱乐精品视频| 综合久久久久久久| 欧美成人精品二区三区99精品| 成人免费av在线| 国产精品女同一区二区三区| 欧美日韩国产美| jizzjizzjizz欧美| 国产精品福利影院| 99v久久综合狠狠综合久久| 日本伊人色综合网| 亚洲日韩欧美一区二区在线| 日韩一级大片在线| 91免费小视频| 国产乱码精品一区二区三区忘忧草| 亚洲永久免费av| 中文字幕不卡在线观看| 日韩亚洲国产中文字幕欧美| 色婷婷一区二区三区四区| 国产福利一区二区三区视频| 亚洲成人高清在线| 亚洲欧洲日韩综合一区二区| 精品国产亚洲在线| 国产激情视频一区二区在线观看 | 日本一区二区免费在线| 国产98色在线|日韩| 亚洲欧洲日本在线| 精品国精品国产尤物美女| 欧美日韩一区二区三区四区| 色婷婷av一区二区| av资源网一区| www.亚洲国产| 丰满少妇在线播放bd日韩电影| 看片的网站亚洲| 久久精品夜色噜噜亚洲aⅴ| 91麻豆精品91久久久久同性| 欧美日韩一二三区| 在线免费亚洲电影| 日本高清成人免费播放| 成人午夜视频在线观看| 免费精品99久久国产综合精品| 天堂蜜桃一区二区三区 | 国产拍欧美日韩视频二区| 日韩欧美在线观看一区二区三区| 欧美日韩卡一卡二| 91精品欧美一区二区三区综合在| 欧美三级电影精品| 666欧美在线视频| 日韩精品一区二区三区swag| 久久综合九色综合97婷婷| 成人动漫视频在线| 99久久国产综合精品色伊| 成人av资源在线观看| 丁香婷婷综合五月| 91尤物视频在线观看| 97成人超碰视| 欧美日韩午夜在线视频| 欧美理论电影在线| 日韩欧美国产高清| 久久综合久久99| 亚洲欧洲国产日韩| 亚洲小少妇裸体bbw| 欧美a一区二区| 国产成人亚洲综合a∨婷婷| 成人黄色大片在线观看| 色偷偷成人一区二区三区91| 欧美网站大全在线观看| 欧美一区二区免费| 色综合久久久久综合体桃花网| 91色婷婷久久久久合中文| 欧美熟乱第一页| 欧美va天堂va视频va在线| 久久综合网色—综合色88| 一区在线播放视频| 首页国产欧美日韩丝袜| 国产69精品一区二区亚洲孕妇| 在线观看成人免费视频| 欧美一区二区三区婷婷月色 | 又紧又大又爽精品一区二区| 亚洲国产精品人人做人人爽| 久久精品国产99久久6| 国产91高潮流白浆在线麻豆 | 色哟哟国产精品| 日韩欧美视频在线| 综合中文字幕亚洲| 久久69国产一区二区蜜臀| 视频一区二区中文字幕| 国产成人精品影院| 欧美日韩在线三级| 国产精品网站在线| 日韩精品视频网站| 色综合天天综合网天天狠天天| 国产一区二区美女诱惑| 日本高清不卡视频| 久久久久久久久久久99999| 亚洲国产视频直播| 成人开心网精品视频| 91麻豆精品国产91久久久| 国产精品理论片在线观看| 久久精品999| 欧美日高清视频| 亚洲欧美视频一区| 大白屁股一区二区视频| 日韩欧美一区在线| 亚洲一区二区三区免费视频| 白白色亚洲国产精品| 久久综合丝袜日本网| 日本不卡高清视频| 在线观看av一区二区| 中文字幕在线观看一区| 丁香六月综合激情| 精品日韩在线观看| 免费在线成人网| 欧美日韩一本到| 一级日本不卡的影视| 91丨porny丨最新| 欧美韩国一区二区| 粉嫩高潮美女一区二区三区| 日韩写真欧美这视频| 午夜精品一区二区三区电影天堂| 日本高清无吗v一区| 亚洲女女做受ⅹxx高潮| 99视频一区二区三区| 中文字幕亚洲一区二区va在线| 岛国精品一区二区| 亚洲欧洲精品天堂一级| 91亚洲永久精品| 亚洲一区二区三区在线看| 日韩av一区二|