2013-09-29 00:21:18 +04:00
|
|
|
/* j/3/peg.c
|
|
|
|
**
|
|
|
|
** This file is in the public domain.
|
|
|
|
*/
|
|
|
|
#include "all.h"
|
|
|
|
#include "../pit.h"
|
|
|
|
|
|
|
|
/* functions
|
|
|
|
*/
|
|
|
|
u2_weak // transfer
|
2014-04-22 05:22:11 +04:00
|
|
|
j2_mbc(Pt3, peg)(u2_wire wir_r,
|
2013-09-29 00:21:18 +04:00
|
|
|
u2_atom a, // retain
|
|
|
|
u2_atom b) // retain
|
|
|
|
{
|
|
|
|
u2_atom c, d, e, f, g, h;
|
|
|
|
|
|
|
|
c = u2_met(0, b);
|
|
|
|
d = j2_mbc(Pt1, dec)(wir_r, c);
|
|
|
|
e = j2_mbc(Pt3, lsh)(wir_r, _0, d, 1);
|
|
|
|
f = j2_mbc(Pt1, sub)(wir_r, b, e);
|
|
|
|
g = j2_mbc(Pt3, lsh)(wir_r, _0, d, a);
|
|
|
|
h = j2_mbc(Pt1, add)(wir_r, f, g);
|
|
|
|
|
|
|
|
u2_rl_lose(wir_r, c);
|
|
|
|
u2_rl_lose(wir_r, d);
|
|
|
|
u2_rl_lose(wir_r, e);
|
|
|
|
u2_rl_lose(wir_r, f);
|
|
|
|
u2_rl_lose(wir_r, g);
|
|
|
|
|
|
|
|
return h;
|
|
|
|
}
|
|
|
|
u2_weak // transfer
|
2014-04-22 05:22:11 +04:00
|
|
|
j2_mb(Pt3, peg)(u2_wire wir_r,
|
2013-09-29 00:21:18 +04:00
|
|
|
u2_noun cor) // retain
|
|
|
|
{
|
|
|
|
u2_noun a, b;
|
|
|
|
|
|
|
|
if ( (u2_no == u2_mean(cor, u2_cv_sam_2, &a, u2_cv_sam_3, &b, 0)) ||
|
|
|
|
(u2_no == u2_stud(a)) ||
|
|
|
|
(u2_no == u2_stud(b)) ||
|
|
|
|
(0 == a) ||
|
|
|
|
(0 == b) )
|
|
|
|
{
|
|
|
|
return u2_bl_bail(wir_r, c3__exit);
|
|
|
|
} else {
|
|
|
|
return j2_mbc(Pt3, peg)(wir_r, a, b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* structures
|
|
|
|
*/
|
2014-04-22 05:22:11 +04:00
|
|
|
u2_ho_jet
|
2013-09-29 00:21:18 +04:00
|
|
|
j2_mbj(Pt3, peg)[] = {
|
|
|
|
{ ".2", c3__lite, j2_mb(Pt3, peg), Tier3, u2_none, u2_none },
|
|
|
|
{ }
|
|
|
|
};
|