shithub: riscv

Download patch

ref: 3472f91129a7a594b356f9a22af2a8176f6e4b1c
parent: daa15d1edbcab0aeae1f5c2a00a6e042e678cfb3
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Aug 9 18:47:46 EDT 2014

5a: reject MOVM instruction with .S and .W bits both set (aijus idea)

--- a/sys/src/cmd/5a/lex.c
+++ b/sys/src/cmd/5a/lex.c
@@ -563,6 +563,13 @@
 		scond = (scond & ~0xf) | Always;
 	}
 
+	if(a == AMOVM){
+		if((scond & (C_SBIT|C_WBIT)) == (C_SBIT|C_WBIT)){
+			yyerror("MOVM .S and .W are exclusive");
+			errorexit();
+		}
+	}
+
 	if(pass == 1)
 		goto out;
 jackpot: