本文整理汇总了C++中ot函数的典型用法代码示例。如果您正苦于以下问题:C++ ot函数的具体用法?C++ ot怎么用?C++ ot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ot函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpExt
// --------------------- Opcodes 0x4880+ ---------------------
// Emit an Ext opcode, 01001000 1x000nnn
int OpExt(int op)
{
int ea=0;
int size=0,use=0;
int shift=0;
ea=op&0x0007;
size=(op>>6)&1;
shift=32-(8<<size);
use=OpBase(op,size);
if (op!=use) { OpUse(op,use); return 0; } // Use existing handler
OpStart(op); Cycles=4;
EaCalc (11,0x0007,ea,size+1,0,0);
EaRead (11, 0,ea,size+1,0x0007,0,0);
ot(" mov r0,r0,asl #%d\n",shift);
ot(" adds r0,r0,#0 ;@ Defines NZ, clears CV\n");
ot(" mrs r10,cpsr ;@ r10=flags\n");
ot(" mov r1,r0,asr #%d\n",shift);
ot("\n");
EaWrite(11, 1,ea,size+1,0x0007,0,0);
OpEnd();
return 0;
}
示例2: OpExt
// --------------------- Opcodes 0x4880+ ---------------------
// Emit an Ext opcode, 01001000 1x000nnn
int OpExt(int op)
{
int ea=0;
int size=0,use=0;
int shift=0;
ea=op&0x0007;
size=(op>>6)&1;
shift=32-(8<<size);
use=OpBase(op,size);
if (op!=use) { OpUse(op,use); return 0; } // Use existing handler
OpStart(op); Cycles=4;
EaCalc (11,0x0007,ea,size+1,earwt_msb_dont_care);
EaRead (11, 0,ea,size+1,0x0007,earwt_msb_dont_care);
ot(" movs r0,r0,asl #%d\n",shift);
OpGetFlagsNZ(0);
ot(" mov r1,r0,asr #%d\n",shift);
ot("\n");
EaWrite(11, 1,ea,size+1,0x0007,earwt_msb_dont_care);
OpEnd();
return 0;
}
示例3: errorsummary
/*
* report errors
*/
void errorsummary (void)
{
if (ncmp)
error("missing closing bracket");
nl();
comment();
outdec(errcnt);
if (errcnt) errfile = YES;
outstr(" error(s) in compilation");
nl();
comment();
ot("literal pool:");
outdec(litptr);
nl();
comment();
ot("constant pool:");
outdec(const_size);
nl();
comment();
ot("global pool:");
outdec(glbptr - rglbptr);
nl();
comment();
ot("Macro pool:");
outdec(macptr);
nl();
pl(errcnt ? "Error(s)" : "No errors");
}
示例4: OpTst
// --------------------- Opcodes 0x4a00+ ---------------------
// Emit a Tst opcode, 01001010 xxeeeeee
int OpTst(int op)
{
int sea=0;
int size=0,use=0;
sea=op&0x003f;
size=(op>>6)&3; if (size>=3) return 1;
// See if we can do this opcode:
if (EaCanWrite(sea)==0||EaAn(sea)) return 1;
use=OpBase(op,size);
if (op!=use) { OpUse(op,use); return 0; } // Use existing handler
OpStart(op,sea); Cycles=4;
EaCalc ( 0,0x003f,sea,size,1);
EaRead ( 0, 0,sea,size,0x003f,1);
ot(" adds r0,r0,#0 ;@ Defines NZ, clears CV\n");
ot(" mrs r10,cpsr ;@ r10=flags\n");
ot("\n");
OpEnd(sea);
return 0;
}
示例5: DamPut8
int DamPut8(char *From,int r,int Ext)
{
// Put register r from From (must be dl for reg 6)
if (r==6) { ot(" DAM_WRITE8\n"); return 0; }
ot(" mov %s,%s\n",DamLoc8(r,Ext),From);
return 0;
}
示例6: DamGet8
int DamGet8(char *To ,int r,int Ext)
{
// Get register r into To (must be dl for reg 6)
if (r==6) { ot(" DAM_READ8\n"); return 0; }
ot(" mov %s,%s\n",To,DamLoc8(r,Ext));
return 0;
}
示例7: SetZN16
// sets ZN for reg in *reg
static void SetZN16(char *reg)
{
ot(" and spc_p,spc_p,#0xff\n");
ot(" orr spc_p,spc_p,%s,lsl #16\n", reg);
ot(" tst %s,#0xff\n", reg);
ot(" orrne spc_p,spc_p,#0x01000000\n");
}
示例8: MemHandler
// Trashes r0-r3
static void MemHandler(int set, int z, int save)
{
if(set) ot(" bl S9xAPUSetByte%s\n", z ? "Z" : "");
else ot(" bl S9xAPUGetByte%s\n", z ? "Z" : "");
if(save) ot(" ldr spc_ram,[context,#iapu_ram]\n");
}
示例9: SetClr1
static void SetClr1()
{
ot(" ldrb r0,[spc_pc]\n");
MemHandler(0, 1, 0);
ot(" %s r0,r0,#0x%02x\n", opcode & 0x10 ? "bic" : "orr", 1<<(opcode>>5));
ot(" ldrb r1,[spc_pc],#1\n");
MemHandler(1, 1, 1);
}
示例10: TCall
static void TCall()
{
ot(" sub r0,spc_pc,spc_ram\n");
PushW();
ot(" ldr r0,[context,#iapu_extraram]\n");
ot(" ldrh r0,[r0,#0x%x]\n", (15-(opcode>>4))<<1);
ot(" add spc_pc,spc_ram,r0\n");
}
示例11: Lsr
// does LSR on r0, sets flags
static void Lsr()
{
ot(" tst r0,#0x01\n");
ot(" orrne spc_p,spc_p,#flag_c\n");
ot(" biceq spc_p,spc_p,#flag_c\n");
ot(" mov r0,r0,lsr #1\n");
SetZN8("r0");
}
示例12: Asl
// does ASL on r0, sets flags but doesn't cut the shifted bits
static void Asl()
{
ot(" tst r0,#0x80\n");
ot(" orrne spc_p,spc_p,#flag_c\n");
ot(" biceq spc_p,spc_p,#flag_c\n");
ot(" mov r0,r0,lsl #1\n");
SetZN8("r0");
}
示例13: PopW
// pops to r0, trashes r1
static void PopW()
{
ot(" add spc_s,spc_s,#2\n");
ot(" add r1,spc_ram,spc_s\n");
ot(" ldrb r0,[r1,#0xff]\n");
ot(" ldrb r1,[r1,#0x100]\n");
ot(" orr r0,r0,r1,lsl #8\n");
}
示例14: PushW
// pushes r0, trashes r0,r1
static void PushW()
{
ot(" add r1,spc_ram,spc_s\n");
ot(" strb r0,[r1,#0xff]\n");
ot(" mov r0,r0,lsr #8\n");
ot(" strb r0,[r1,#0x100]\n");
ot(" sub spc_s,spc_s,#2\n");
}
示例15: Ror
// does ROR on r0, sets flags
static void Ror()
{
ot(" tst spc_p,#flag_c\n");
ot(" orrne r0,r0,#0x100\n");
ot(" movs r0,r0,lsr #1\n");
ot(" orrcs spc_p,spc_p,#flag_c\n");
ot(" biccc spc_p,spc_p,#flag_c\n");
SetZN8("r0");
}