From feab5f0d6229e3cec111b975126f07da484eb746 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 20 May 2019 20:12:26 +0100 Subject: [PATCH] Renamed and fixed overflow in M --- sim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sim.c b/sim.c index 84cc348..3264525 100644 --- a/sim.c +++ b/sim.c @@ -232,7 +232,7 @@ static void oper_poke_and_stun(Glyph* restrict gbuffer, Mark* restrict mbuffer, _('J', jump) \ _('K', konkat) \ _('L', loop) \ - _('M', modulo) \ + _('M', multiply) \ _('N', movement) \ _('O', offset) \ _('P', push) \ @@ -575,14 +575,14 @@ BEGIN_OPERATOR(loop) } END_OPERATOR -BEGIN_OPERATOR(modulo) +BEGIN_OPERATOR(multiply) LOWERCASE_REQUIRES_BANG; PORT(0, -1, IN); PORT(0, 1, IN); PORT(1, 0, OUT); Usz ia = index_of(PEEK(0, -1)); Usz ib = index_of(PEEK(0, 1)); - POKE(1, 0, indexed_glyphs[ia * ib]); + POKE(1, 0, indexed_glyphs[(ia * ib) % Glyphs_index_count]); END_OPERATOR BEGIN_OPERATOR(offset)