shithub: spirva

Download patch

ref: 3140d118dfeda8577a1c9d51b6d5646943f26277
parent: 0481916bfbc64666485d976d5b67e00dff5387ff
author: sirjofri <sirjofri@sirjofri.de>
date: Sun Feb 4 13:43:00 EST 2024

fixes words calculation for strings

--- a/asm.c
+++ b/asm.c
@@ -62,8 +62,8 @@
 			break;
 		case STR:
 			slen = strlen(in.str) + 1;
-			slen = BUF4(slen);
-			numwords += slen;
+			// padded string length as words (u32int)
+			numwords += slen%4 ? (slen/4 + 1) : slen/4;
 		}
 	}