From b95a663b591f1e8deb46a44f586f1d026a4ec519 Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Sun, 18 Feb 2018 13:10:33 -0800 Subject: [PATCH] minor improvements to the quote opcode implementation --- noun/nock.c | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/noun/nock.c b/noun/nock.c index c72d76a621..74cb654b3c 100644 --- a/noun/nock.c +++ b/noun/nock.c @@ -1372,36 +1372,48 @@ _n_burn(c3_y* pog, u3_noun bus, c3_ys mov, c3_ys off) u3z(o); BURN(); - do_lil1: - _n_toss(mov, off); + do_lit0: + _n_push(mov, off, 0); + BURN(); + do_lit1: + _n_push(mov, off, 1); + BURN(); + + do_litb: + _n_push(mov, off, pog[ip_s++]); + BURN(); + + do_lits: + _n_push(mov, off, _n_resh(pog, &ip_s)); + BURN(); + + do_litn: + _n_push(mov, off, u3k(_n_rean(pog, &ip_s))); + BURN(); + + do_lil1: x = 1; - goto quot_in; + goto lil_in; do_lilb: - _n_toss(mov, off); - do_litb: x = pog[ip_s++]; - goto quot_in; + goto lil_in; do_lils: - _n_toss(mov, off); - do_lits: x = _n_resh(pog, &ip_s); - goto quot_in; + goto lil_in; do_liln: - _n_toss(mov, off); - do_litn: x = u3k(_n_rean(pog, &ip_s)); - goto quot_in; + goto lil_in; do_lil0: - _n_toss(mov, off); - do_lit0: x = 0; - quot_in: - _n_push(mov, off, x); + lil_in: + top = _n_peek(off); + u3z(*top); + *top = x; BURN(); do_noct: // [fol old bus]