⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parse3.c

📁 地球模拟器
💻 C
📖 第 1 页 / 共 3 页
字号:
{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg = &(ce->c.re[mo(tval, NUMREG)]);    tval = flaw(ce);    is.sval = ce->c.re[mo(tval, NUMREG)];    is.sval2 = 1;    is.dran = SoupSize;}/* void math(ce) *(is.dreg) = is.sval + is.sval2 + flaw(ce); * is.dreg  = destination register, where calculation will be stored * is.sval  = a value that will be added to is.sval2 and placed in dest reg * is.sval2 = a value that will be added to is.sval  and placed in dest reg * is.dmod  = value by which to modulus destination register * is.dran  = range within which to contain destination register */void pdec(ce) /* AX-- */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg = &(ce->c.re[mo(tval, NUMREG)]);    tval = flaw(ce);    is.sval = ce->c.re[mo(tval, NUMREG)];    is.sval2 = -1;    is.dran = SoupSize;}/* void math(ce) *(is.dreg) = is.sval + is.sval2 + flaw(ce); * is.dreg  = destination register, where calculation will be stored * is.sval  = a value that will be added to is.sval2 and placed in dest reg * is.sval2 = a value that will be added to is.sval  and placed in dest reg * is.dmod  = value by which to modulus destination register * is.dran  = range within which to contain destination register */void padd(ce) /* AX = BX + AX */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg  = &(ce->c.re[mo(tval, NUMREG)]);    tval = 1 + flaw(ce);    is.sval  = ce->c.re[mo(tval, NUMREG)];    tval = flaw(ce);    is.sval2 = ce->c.re[mo(tval, NUMREG)];    is.dran = SoupSize;}/* void math(ce) *(is.dreg) = is.sval + is.sval2 + flaw(ce); * is.dreg  = destination register, where calculation will be stored * is.sval  = a value that will be added to is.sval2 and placed in dest reg * is.sval2 = a value that will be added to is.sval  and placed in dest reg * is.dmod  = value by which to modulus destination register * is.dran  = range within which to contain destination register */void psub(ce) /* AX = BX - AX */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg = &(ce->c.re[mo(tval, NUMREG)]);    tval = 1 + flaw(ce);    is.sval  =  ce->c.re[mo(tval, NUMREG)];    tval = flaw(ce);    is.sval2 = -ce->c.re[mo(tval, NUMREG)];    is.dran = SoupSize;}/* void movdd(ce) *(is.dreg) = is.sval + flaw(ce); * is.dreg = destination register, where moved value will be placed * is.sval = value to be placed in the dest reg * is.dmod = value by which to modulus destination register * is.dran = range within which to contain destination register */void pzero(ce) /* AX = 0 */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg = &(ce->c.re[mo(tval, NUMREG)]);    is.sval = 0;}/* void not0(ce) *(is.dreg) ^= (1 + flaw(ce)); * is.dreg = destination register, whose bit will be flipped * is.dmod = value by which to modulus destination register * is.dran = range within which to contain destination register */void pnot0(ce) /* flip low order bit of AX */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg = &(ce->c.re[mo(tval, NUMREG)]);    is.dran = SoupSize;}/* void shl(ce) *(is.dreg) <<= (Reg) (1 + flaw(ce)); * is.dreg = destination register, whose bits will be shifted left * is.dmod = value by which to modulus destination register * is.dran = range within which to contain destination register */void pshl(ce) /* shift left all bits of AX */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg = &(ce->c.re[mo(tval, NUMREG)]);    is.dran = SoupSize;}/* void not(ce) *(is.dreg) = ~(is.sval) + flaw(ce); * is.dreg = destination register * is.sval = value whose bits will be flipped and put in dest reg * is.dmod = value by which to modulus destination register * is.dran = range within which to contain destination register */void pnot(ce) /* flip all bits of AX */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg = &(ce->c.re[mo(tval, NUMREG)]);    is.dran = SoupSize;}/* void movdd(ce) *(is.dreg) = is.sval + flaw(ce); * is.dreg = destination register, where moved value will be placed * is.sval = value to be placed in the dest reg * is.dmod = value by which to modulus destination register * is.dran = range within which to contain destination register */void prand(ce) /* AX = tlrand(); */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.dreg = &(ce->c.re[mo(tval, NUMREG)]);    is.sval = tlrand();}/* void ifz(ce) if (is.sval + flaw(ce)) is.iip = is.sval2; * is.sval  = value to test for zero * is.sval2 = amount to increment IP if is.sval == 0 * is.iip   = amount to increment IP if is.sval != 0 */void pifz(ce) /* execute next instruction, if AX == 0 */Pcells  ce;{   I32s  tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    tval = flaw(ce);    is.sval = ce->c.re[mo(tval, NUMREG)];    is.sval2 = 2;}/* void ifz(ce) if (is.sval + flaw(ce)) is.iip = is.sval2; * is.sval  = value to test for zero * is.sval2 = amount to increment IP if is.sval == 0 * is.iip   = amount to increment IP if is.sval != 0 */void piffl(ce) /* skip next instruction, if flag == 0 */Pcells  ce;{   is.iip = is.dib = 1;    if (is.eins->exec)        return ;    is.sval = ce->c.fl;    is.sval2 = 1;    is.iip = 2;    is.dib = 1;}/* void adr(ce) find address of a template * is.mode  = search mode: 1 = forward, 2 = backward, 0 = outward * is.mode2 =  preference: 1 = forward, 2 = backward, and return for *        direction found: 1 = forward, 2 = backward, 3 = both, 0 = none * is.dval  = starting address for forward search * is.dval2 = starting address for backward search * is.dreg  = destination register where target address will be stored * is.dreg2 = destination register where template size will be stored * is.dreg3 = destination register where offset of target will be stored * is.sval  = return address if template size = 0 * is.sval2 = template size, 0 = no template * is.sval3 = search limit, and return for distance actually searched * is.dmod  = modulus value for is.dreg * is.dmod2 = modulus value for is.dreg2 * is.dmod3 = modulus value for is.dreg3 * is.dran  = range to maintain for is.dreg * is.dran2 = range to maintain for is.dreg2 * is.dran3 = range to maintain for is.dreg3 */void ptjmp(ce) /* outward template jump */Pcells  ce;{   I32s    a, s = 0, tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    a = ad(ce->c.ip + 1); /* a = address of start of template */    while(1) /* find size of template, s = size */    {   #if PLOIDY == 1        if(soup[ad(a + s)].inst != Nop0 &&           soup[ad(a + s)].inst != Nop1)#else /* PLOIDY > 1 */        if(soup[ad(a + s)][ce->d.tr].inst != Nop0 &&           soup[ad(a + s)][ce->d.tr].inst != Nop1)#endif /* PLOIDY > 1 */            break;        s++;    }    is.dreg  = &(ce->c.ip); /* destination register for address */    is.dreg2 = &BitBucket; /* destination register for template size */    is.dreg3 = &BitBucket; /* dest reg for offset */    tval = flaw(ce);    tval = ce->c.re[mo(tval, NUMREG)] + flaw(ce);    is.sval  = ad(tval); /* target for IP if s == 0 */    is.sval2 = s;  /* size of template */    is.sval3 = Search_limit;    is.dmod  = SoupSize;    is.dval  = ad(a + s + 1); /* start address for forward search */    is.dval2 = ad(a - s - 1); /* start address for backward search */    is.mode  = 0; /* outward jump */    is.mode2 = 1;    is.dib = 1;    is.iip = 0;}/* void adr(ce) find address of a template * is.mode  = search mode: 1 = forward, 2 = backward, 0 = outward * is.mode2 =  preference: 1 = forward, 2 = backward, and return for *        direction found: 1 = forward, 2 = backward, 3 = both, 0 = none * is.dval  = starting address for forward search * is.dval2 = starting address for backward search * is.dreg  = destination register where target address will be stored * is.dreg2 = destination register where template size will be stored * is.dreg3 = destination register where offset of target will be stored * is.sval  = return address if template size = 0 * is.sval2 = template size, 0 = no template * is.sval3 = search limit, and return for distance actually searched * is.dmod  = modulus value for is.dreg * is.dmod2 = modulus value for is.dreg2 * is.dmod3 = modulus value for is.dreg3 * is.dran  = range to maintain for is.dreg * is.dran2 = range to maintain for is.dreg2 * is.dran3 = range to maintain for is.dreg3 */void ptjmpb(ce) /* backward template jump */Pcells  ce;{   I32s    a, s = 0, tval;    is.iip = is.dib = 1;    if (is.eins->exec)        return ;    a = ad(ce->c.ip + 1); /* a = address of start of template */    while(1) /* find size of template, s = size */    {   #if PLOIDY == 1        if(soup[ad(a + s)].inst != Nop0 &&           soup[ad(a + s)].inst != Nop1)#else /* PLOIDY > 1 */        if(soup[ad(a + s)][ce->d.tr].inst != Nop0 &&           soup[ad(a + s)][ce->d.tr].inst != Nop1)#endif /* PLOIDY > 1 */            break;        s++;    }    is.dreg  = &(ce->c.ip); /* destination register for address */    is.dreg2 = &BitBucket; /* destination register for template size */    is.dreg3 = &BitBucket; /* dest reg for offset */    tval = flaw(ce);    tval = ce->c.re[mo(tval, NUMREG)] + flaw(ce);    is.sval  = ad(tval); /* target for IP if s == 0 */    is.sval2 = s;  /* size of template */    is.sval3 = Search_limit;    is.dmod  = SoupSize;    is.dval  = ad(a + s + 1); /* start address for forward search */    is.dval2 = ad(a - s - 1); /* start address for backward search */    is.mode  = 2; /* backward jump */    is.mode2 = 2;    is.dib = 1;    is.iip = 0;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -