git: 9front

Download patch

ref: 3a032441a10fc65862547bac234cb3a6b29f6394
parent: 69c52ff4d3051530fa67eea53b13e5be9914b1fc
author: Alex Musolino <alex@musolino.id.au>
date: Sat Nov 28 18:02:28 EST 2020

games/mix: fix SLAX and SRAX instructions (thanks nicolagi)

MIX shift instructions shift by bytes not bits.

--- a/sys/src/games/mix/mix.c
+++ b/sys/src/games/mix/mix.c
@@ -668,9 +668,9 @@
 	rax |= rx & MASK5;
 	rx &= ~MASK5;
 	if(left)
-		rax <<= m;
+		rax <<= m*BITS;
 	else
-		rax >>= m;
+		rax >>= m*BITS;
 	rx |= rax & MASK5;
 	ra |= rax>>5*BITS & MASK5;
 }
--