本文整理汇总了C++中OPCODE函数的典型用法代码示例。如果您正苦于以下问题:C++ OPCODE函数的具体用法?C++ OPCODE怎么用?C++ OPCODE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OPCODE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: DecodeOpcode
OPCODE DecodeOpcode(const BYTE *pCode, DWORD *pdwLen)
{
OPCODE opcode;
*pdwLen = 1;
opcode = OPCODE(pCode[0]);
switch(opcode) {
case CEE_PREFIX1:
opcode = OPCODE(pCode[1] + 256);
if (opcode < 0 || opcode >= CEE_COUNT)
opcode = CEE_COUNT;
*pdwLen = 2;
break;
case CEE_PREFIXREF:
case CEE_PREFIX2:
case CEE_PREFIX3:
case CEE_PREFIX4:
case CEE_PREFIX5:
case CEE_PREFIX6:
case CEE_PREFIX7:
*pdwLen = 3;
return CEE_COUNT;
default:
break;
}
return opcode;
}
开发者ID:A-And,项目名称:coreclr,代码行数:27,代码来源:ceefilegenwritertokens.cpp
示例2: OPCODE
void Credits::setupOpcodes() {
// "Stack-Specific" Opcodes
OPCODE(100, o_quit);
// "Init" Opcodes
OPCODE(200, o_runCredits);
}
开发者ID:DrItanium,项目名称:scummvm,代码行数:7,代码来源:credits.cpp
示例3: rvec_priv_inst
static int
rvec_priv_inst( int dummy_rvec, ulong inst )
{
int op, op_ext, b1, b2, b3;
/* unhandled privileged instruction in supervisor mode */
/* IMPORTANT: The GPRs are not available here! */
op = OPCODE_PRIM( inst );
op_ext = OPCODE_EXT( inst );
b1 = B1( inst ); /* bit 6-10 */
b2 = B2( inst ); /* bit 11-15 */
b3 = B3( inst ); /* bit 16-20 */
switch( OPCODE(op,op_ext) ) {
case OPCODE( 31, 370 ): /* tlbia (opt.) */
/* not implemented on the 601,603,604,G3 (G4?) */
break;
case OPCODE( 31, 470 ): /* dcbi rA,rB -- rA=b2 rB=b3 */
printm("dcbi treated as nop\n");
mregs->nip += 4;
return 0;
default:
printm("Unknown privileged instruction, opcode %lX\n", inst);
stop_emulation();
break;
}
mac_exception( 0x700, MOL_BIT(13) );
return 0;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:30,代码来源:molcpu.c
示例4: handle_outbound
static void handle_outbound(struct aura_node *node, struct aura_object *o, struct aura_buffer *buf)
{
int ret = -EIO;
if (OPCODE("export")) {
int gpio = aura_buffer_get_u32(buf);
slog(4, SLOG_DEBUG, "gpio: export %d", gpio);
ret = gpio_export(gpio);
} else if (OPCODE("write")) {
int gpio = aura_buffer_get_u32(buf);
int value = aura_buffer_get_u32(buf);
slog(4, SLOG_DEBUG, "gpio: write gpio %d value %d", gpio, value);
ret = gpio_write(gpio, value);
} else if (OPCODE("in")) {
int gpio = aura_buffer_get_u32(buf);
ret = gpio_in(gpio);
} else if (OPCODE("out")) {
int gpio = aura_buffer_get_u32(buf);
ret = gpio_out(gpio);
} else if (OPCODE("read")) {
int gpio = aura_buffer_get_u32(buf);
ret = gpio_read(gpio, &gpio);
aura_buffer_rewind(buf);
aura_buffer_put_u32(buf, gpio);
}
slog(0, SLOG_DEBUG, "gpio ret = %d", ret);
if (ret) {
aura_call_fail(node, o);
return;
}
aura_queue_buffer(&node->inbound_buffers, buf);
}
开发者ID:nekromant,项目名称:aura,代码行数:32,代码来源:transport-sysfs-gpio.c
示例5: OVERRIDE_OPCODE
void Demo::setupOpcodes() {
// "Stack-Specific" Opcodes
OVERRIDE_OPCODE(100, o_stopIntro);
OPCODE(101, o_fadeFromBlack);
OPCODE(102, o_fadeToBlack);
// "Init" Opcodes
OVERRIDE_OPCODE(201, o_returnToMenu_init);
}
开发者ID:CatalystG,项目名称:scummvm,代码行数:9,代码来源:demo.cpp
示例6: OPCODE
void MystScriptParser_Dni::setupOpcodes() {
// "Stack-Specific" Opcodes
OPCODE(100, NOP);
OPCODE(101, o_handPage);
// "Init" Opcodes
OPCODE(200, o_atrus_init);
// "Exit" Opcodes
OPCODE(300, NOP);
}
开发者ID:Termimad,项目名称:scummvm,代码行数:11,代码来源:dni.cpp
示例7: OPCODE
void Intro::setupOpcodes() {
// "Stack-Specific" Opcodes
OPCODE(100, o_useLinkBook);
// "Init" Opcodes
OPCODE(200, o_playIntroMovies);
OPCODE(201, o_mystLinkBook_init);
// "Exit" Opcodes
OPCODE(300, NOP);
}
开发者ID:hchen1014,项目名称:scummvm,代码行数:11,代码来源:intro.cpp
示例8: afterExec
static void afterExec(const sEvArgs *args) {
UNUSED(args);
tetra raw = cpu_getCurInstrRaw();
if(OPCODE(raw) == PUSHGO || OPCODE(raw) == PUSHGOI ||
OPCODE(raw) == PUSHJ || OPCODE(raw) == PUSHJB)
level++;
else if(OPCODE(raw) == POP)
level--;
if(level <= 0)
cpu_pause();
}
开发者ID:Logout22,项目名称:Escape,代码行数:11,代码来源:stepover.c
示例9: OVERRIDE_OPCODE
void Demo::setupOpcodes() {
// "Stack-Specific" Opcodes
OVERRIDE_OPCODE(100, opcode_100);
OPCODE(101, opcode_101);
OPCODE(102, opcode_102);
// "Init" Opcodes
OVERRIDE_OPCODE(201, opcode_201);
// "Exit" Opcodes
OVERRIDE_OPCODE(300, opcode_300);
}
开发者ID:jweinberg,项目名称:scummvm,代码行数:12,代码来源:demo.cpp
示例10: recieveDataPackage
int recieveDataPackage(unsigned short index, char data[RFC1350_BLOCKSIZE], struct sockaddr_in *destination_addr, int* sock, char verbose_text[LOG_INFO_SUBJECT_SIZE]) {
char buffer[516];
int recv_size;
socklen_t destination_addr_len = sizeof(struct sockaddr_in);
int rexmt = retransmission_time;
int result;
struct timeval t_retx;
fd_set fds;
FD_ZERO ( &fds ) ;
FD_SET ( *sock, &fds ) ;
t_retx.tv_sec = rexmt;
t_retx.tv_usec = 0;
result = select ( (*sock) + 1, &fds, NULL, NULL, &t_retx);
printf("recieveDataPackage: RESULT form SELECT = %x\n", result); //debug
if (result == 1) {
recv_size = recvfrom(*sock, buffer, 516, 0, (struct sockaddr*)destination_addr, &destination_addr_len);
if( verbose == 1 ) {
log_info(&buffer, recv_size, verbose_text, VERBOSE_ACTION_RECIEVE);
}
printf("recieveDataPackage: OPCODE = %x\n", OPCODE(buffer)); //debug
if (OPCODE(buffer) == RFC1350_OP_DATA) {
tftp_data_hdr message_data;
memcpy(&message_data, buffer, recv_size);
if (ntohs(message_data.num_block) == index) {
/* Expected DATA recieved. */
memcpy(data, message_data.data, recv_size - 4);
return recv_size;
}
} else if (OPCODE(buffer) == RFC1350_OP_ERROR) {
printError(buffer, recv_size);
/* We recieved an error message */
return -1;
}
}
/* DATA or message was unexpected. */
return 0;
}
开发者ID:heritage-ljh,项目名称:tftp_heritage_ljh,代码行数:50,代码来源:common.c
示例11: RA8
void RA8(const Instr *instr, byte r8, word a16)
{
memory->store(address++, OPCODE(instr, AM_RA8));
memory->store(address++, r8);
memory->store(address++, HIBYTE(a16));
memory->store(address++, LOBYTE(a16));
}
开发者ID:trieck,项目名称:pixievm,代码行数:7,代码来源:Code.cpp
示例12: process
void process(Servo *servo, Instruction b) {
enum opcode operation = OPCODE(b);
int parameter = PARAM(b);
switch(operation) {
case MOV:
mov(servo, parameter);
break;
case WAIT:
wait(servo, parameter);
break;
case LOOP_START:
loop_start(servo, parameter);
execute(servo, servo->recipe[servo->pc]);
break;
case END_LOOP:
end_loop(servo);
execute(servo, servo->recipe[servo->pc]);
break;
case RECIPE_END:
recipe_end(servo);
break;
default: /* Opcode not defined */
break;
}
}
开发者ID:ajm5774,项目名称:EmbeddedProjects,代码行数:26,代码来源:servo.c
示例13: A16I8
void A16I8(const Instr *instr, word a16, byte i8)
{
memory->store(address++, OPCODE(instr, AM_A16I8));
memory->store(address++, i8);
memory->store(address++, HIBYTE(a16));
memory->store(address++, LOBYTE(a16));
}
开发者ID:trieck,项目名称:pixievm,代码行数:7,代码来源:Code.cpp
示例14: AR16
void AR16(const Instr *instr, word a16, byte r16)
{
memory->store(address++, OPCODE(instr, AM_AR16));
memory->store(address++, r16);
memory->store(address++, HIBYTE(a16));
memory->store(address++, LOBYTE(a16));
}
开发者ID:trieck,项目名称:pixievm,代码行数:7,代码来源:Code.cpp
示例15: xfrd_handle_notify_reply
static int
xfrd_handle_notify_reply(struct notify_zone_t* zone, buffer_type* packet)
{
if((OPCODE(packet) != OPCODE_NOTIFY) ||
(QR(packet) == 0)) {
log_msg(LOG_ERR, "xfrd: zone %s: received bad notify reply opcode/flags",
zone->apex_str);
return 0;
}
/* we know it is OPCODE NOTIFY, QUERY_REPLY and for this zone */
if(ID(packet) != zone->notify_query_id) {
log_msg(LOG_ERR, "xfrd: zone %s: received notify-ack with bad ID",
zone->apex_str);
return 0;
}
/* could check tsig, but why. The reply does not cause processing. */
if(RCODE(packet) != RCODE_OK) {
log_msg(LOG_ERR, "xfrd: zone %s: received notify response error %s from %s",
zone->apex_str, rcode2str(RCODE(packet)),
zone->notify_current->ip_address_spec);
if(RCODE(packet) == RCODE_IMPL)
return 1; /* rfc1996: notimpl notify reply: consider retries done */
return 0;
}
DEBUG(DEBUG_XFRD,1, (LOG_INFO, "xfrd: zone %s: host %s acknowledges notify",
zone->apex_str, zone->notify_current->ip_address_spec));
return 1;
}
开发者ID:LTD-Beget,项目名称:nsd,代码行数:28,代码来源:xfrd-notify.c
示例16: MI16
void MI16(const Instr *instr, byte m16, word i16)
{
memory->store(address++, OPCODE(instr, AM_MI16));
memory->store(address++, m16);
memory->store(address++, HIBYTE(i16));
memory->store(address++, LOBYTE(i16));
}
开发者ID:trieck,项目名称:pixievm,代码行数:7,代码来源:Code.cpp
示例17: Otypei
static void Otypei(char *line, int k, int *macode){
int machCode = 0;
machCode |= OPCODE(k);
///itoa(machCode, *macode, 10);
*macode = machCode;
}
开发者ID:clemenza,项目名称:myeecs370,代码行数:7,代码来源:parse.c
示例18: _Dasm_ReadModRmAndSid
int _Dasm_ReadModRmAndSid (int nCur, BYTE * pInst)
{
int nSize = 0 ;
TRACE_INFO (TEXT("inst=0x%02X, mod=%d, opcode=%d, rm=%d\n"),
pInst[0], OPCODE(pInst[nCur]), MOD(pInst[nCur]), RM(pInst[nCur])) ;
switch( MOD(pInst[nCur]) )
{
case 0: // Mod==00 => No disp
// /!\ not valid if R/M is 4
switch( RM(pInst[nCur]) )
{
case 4: // an SIB follows
nSize = nCur + 2 ;
break ;
case 5: // has disp32
nSize = nCur + 5 ;
break ;
default:
nSize = nCur + 1 ;
}
break ;
case 1: // Mod==01 => 8 bits disp
switch( RM(pInst[nCur]) )
{
case 4: // an SIB follows
nSize = nCur + 3 ;
break ;
default:
nSize = nCur + 2 ;
}
break ;
case 2: // Mod==10 => 32 bits disp
// /!\ not valid if R/M is 4
nSize = nCur + 5 ;
if( RM(pInst[nCur])==4 )
TRACE_WARNING (TEXT("Not tested instruction decoding\n")) ;
break ;
case 3:
nSize = nCur + 1 ;
break ;
}
return nSize ;
}
开发者ID:brock7,项目名称:winpooch,代码行数:59,代码来源:Disasm.c
示例19: AI16
void AI16(const Instr *instr, word a16, word i16)
{
memory->store(address++, OPCODE(instr, AM_AI16));
memory->store(address++, HIBYTE(i16));
memory->store(address++, LOBYTE(i16));
memory->store(address++, HIBYTE(a16));
memory->store(address++, LOBYTE(a16));
}
开发者ID:trieck,项目名称:pixievm,代码行数:8,代码来源:Code.cpp
示例20: ParseMemSpec
/*** ParseMemSpec - parse special memory instruction
*
* Purpose:
* Given the users input, create the memory instruction.
*
* Input:
* *inString - present input position
* pEntry - pointer into the asmTable for this instr type
*
* Output:
* *outstring - update input position
*
* Returns:
* the instruction.
*
* Format:
* op
*
*************************************************************************/
ULONG ParseMemSpec(PUCHAR inString,
PUCHAR *outString,
POPTBLENTRY pEntry,
PULONG poffset)
{
return(OPCODE(pEntry->opCode) +
MEM_FUNC(pEntry->funcCode));
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:27,代码来源:ntasm.c
注:本文中的OPCODE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论