本文整理汇总了C++中OPCODE函数的典型用法代码示例。如果您正苦于以下问题:C++ OPCODE函数的具体用法?C++ OPCODE怎么用?C++ OPCODE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OPCODE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: OPCODE
void Credits::setupOpcodes() {
// "Stack-Specific" Opcodes
OPCODE(100, o_quit);
// "Init" Opcodes
OPCODE(200, o_runCredits);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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));
}
示例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;
}
}
示例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));
}
示例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));
}
示例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;
}