本文整理汇总了C++中outval函数的典型用法代码示例。如果您正苦于以下问题:C++ outval函数的具体用法?C++ outval怎么用?C++ outval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setline
void
setline(int line, int fileno)
{
if ((sc_debug & (sSYMBOLIC | sCHKBOUNDS)) != 0)
{
stgwrite("line ");
outval(line, FALSE);
stgwrite(" ");
outval(fileno, FALSE);
stgwrite("\t; ");
outval(code_idx, TRUE);
code_idx += opcodes(1) + opargs(2);
} /* if */
}
示例2: addr2cell
/* Convert "distance of addresses" to "number of cells" in between.
* Or convert a number of packed characters to the number of cells (with
* truncation).
* The ALT register is be used as scratch.
*/
SC_FUNC void addr2cell(void)
{
stgwrite("\tconst.alt ");
if (pc_cellsize==2) {
outval(1,TRUE,TRUE);
} else if (pc_cellsize==4) {
outval(2,TRUE,TRUE);
} else {
assert(pc_cellsize==8);
outval(3,TRUE,TRUE);
} /* if */
stgwrite("\tshr\n");
code_idx+=opcodes(2)+opargs(1);
}
示例3: setheap_pri
SC_FUNC void setheap_pri(void)
{
if (!staging && pc_optimize>=sOPTIMIZE_FULL) {
stgwrite("\theap.p ");
outval(pc_cellsize,FALSE,TRUE);
code_idx+=opcodes(3); /* the other 2 opcodes follow below */
} else {
stgwrite("\theap "); /* ALT = HEA++ */
outval(pc_cellsize,TRUE,TRUE);
code_idx+=opcodes(3)+opargs(1); /* the other 2 opcodes follow below */
} /* if */
stgwrite("\tstor.i\n"); /* store PRI (default value) at address ALT */
stgwrite("\txchg\n"); /* move ALT to PRI: PRI contains the address */
}
示例4: modstk
/*
* Inclrement/decrement stack pointer. Note that this routine does
* nothing if the delta is zero.
*/
SC_FUNC void modstk(int delta)
{
if (delta) {
cell crit=((cell)1<<pc_cellsize*4);
if (!staging && pc_optimize>=sOPTIMIZE_FULL && delta>=-crit && delta<crit) {
stgwrite("\tstack.p ");
outval(delta,FALSE,TRUE);
code_idx+=opcodes(1);
} else {
stgwrite("\tstack ");
outval(delta,TRUE,TRUE);
code_idx+=opcodes(1)+opargs(1);
} /* if */
} /* if */
}
示例5: setheap
SC_FUNC void setheap(cell value)
{
stgwrite("\tconst.pri "); /* load default value in PRI */
outval(value,TRUE,TRUE);
code_idx+=opcodes(1)+opargs(1);
setheap_pri();
}
示例6: setheap_save
SC_FUNC void setheap_save(cell value)
{
assert(value);
stgwrite("\ttracker.push.c ");
outval(value, TRUE);
code_idx+=opcodes(1)+opargs(1);
}
示例7: setstk
/* set the stack to a hard offset from the frame */
SC_FUNC void setstk(cell value)
{
stgwrite("\tstackadjust ");
assert(value<=0); /* STK should always become <= FRM */
outval(value, TRUE); /* add (negative) offset */
code_idx+=opcodes(1)+opargs(1);
}
示例8: oa_eq
SC_FUNC void oa_eq(cell size)
{
stgwrite("\tcmps ");
outval(size,TRUE,TRUE);
stgwrite("\tnot\n"); /* CMPS results in zero if both arrays match, change it to 1 */
code_idx+=opcodes(2)+opargs(1);
}
示例9: writetrailer
/* writetrailer
* Not much left of this once important function.
*
* Global references: pc_stksize (referred to only)
* sc_dataalign (referred to only)
* code_idx (altered)
* glb_declared (altered)
*/
SC_FUNC void writetrailer(void)
{
assert(sc_dataalign % opcodes(1) == 0); /* alignment must be a multiple of
* the opcode size */
assert(sc_dataalign!=0);
/* pad code to align data segment */
if ((code_idx % sc_dataalign)!=0) {
begcseg();
while ((code_idx % sc_dataalign)!=0)
nooperation();
} /* if */
/* pad data segment to align the stack and the heap */
assert(litidx==0); /* literal queue should have been emptied */
assert(sc_dataalign % sizeof(cell) == 0);
if (((glb_declared*sizeof(cell)) % sc_dataalign)!=0) {
begdseg();
defstorage();
while (((glb_declared*sizeof(cell)) % sc_dataalign)!=0) {
stgwrite("0 ");
glb_declared++;
} /* while */
} /* if */
stgwrite("\nSTKSIZE "); /* write stack size (align stack top) */
outval(pc_stksize - (pc_stksize % sc_dataalign),TRUE,TRUE);
}
示例10: setline
SC_FUNC void setline(int chkbounds)
{
if (sc_asmfile) {
stgwrite("\t; line ");
outval(fline,TRUE,TRUE);
} /* if */
if ((sc_debug & sSYMBOLIC)!=0 || chkbounds && (sc_debug & sCHKBOUNDS)!=0) {
/* generate a "break" (start statement) opcode rather than a "line" opcode
* because earlier versions of Small/Pawn have an incompatible version of the
* line opcode
*/
stgwrite("\tbreak\t; ");
outval(code_idx,TRUE,TRUE);
code_idx+=opcodes(1);
} /* if */
}
示例11: storereg
/* Store a cell into a fixed address in memory */
SC_FUNC void storereg(cell address,regid reg)
{
assert(reg==sPRI);
stgwrite("\tstor ");
outval(address,TRUE,TRUE);
code_idx+=opcodes(1)+opargs(1);
}
示例12: memcopy
/* Source must be in PRI, destination address in ALT. The "size"
* parameter is in bytes, not cells.
*/
SC_FUNC void memcopy(cell size)
{
stgwrite("\tmovs ");
outval(size,TRUE,TRUE);
code_idx+=opcodes(1)+opargs(1);
}
示例13: charalign
/* Align PRI (which should hold a character index) to an address.
* The first character in a "pack" occupies the highest bits of
* the cell. This is at the lower memory address on Big Endian
* computers and on the higher address on Little Endian computers.
* The ALIGN.pri/alt instructions must solve this machine dependence;
* that is, on Big Endian computers, ALIGN.pri/alt shuold do nothing
* and on Little Endian computers they should toggle the address.
*
* NOTE: For Source Pawn, this is fliped. It will do nothing on Little-Endian.
*/
SC_FUNC void charalign(void)
{
#if 0 /* TEMPORARILY DISABLED BECAUSE WE DON'T USE BIG ENDIAN */
stgwrite("\talign.pri ");
outval(sCHARBITS/8,TRUE);
code_idx+=opcodes(1)+opargs(1);
#endif
}
示例14: addconst
/*
* Add a constant to the primary register.
*/
SC_FUNC void addconst(cell value)
{
if (value!=0) {
stgwrite("\tadd.c ");
outval(value,TRUE);
code_idx+=opcodes(1)+opargs(1);
} /* if */
}
示例15: oa_ne
SC_FUNC void oa_ne(cell size)
{
stgwrite("\tcmps ");
outval(size,TRUE,TRUE); /* this leaves PRI == 0 when the arrays are equal */
stgwrite("\tnot\n"); /* PRI == 1 if equal, 0 if different */
stgwrite("\tnot\n"); /* PRI == 0 if equal, 1 = different */
code_idx+=opcodes(3)+opargs(1);
}