Index: ram/etloc.c
===================================================================
--- ram/etloc.c	(revision 4b63bf32025928aa103cb35934a26f08ac067728)
+++ ram/etloc.c	(revision 7f5fa1bc2ab393628df3f07dbf1e32354c2d7357)
@@ -16,5 +16,5 @@
 int16_t et_loc(int16_t n)
 {
-	ebuf[0] =grploc[n] + 1 + '0';
+	ebuf[0] = (int8_t)(grploc[n] + 1 + '0');
 	ebuf[1] = '\0';
 	ebflag = TRUE;
@@ -34,13 +34,13 @@
 	struct idfnhdr *fp;
 	uint16_t fpmant, fpexp;
-	int16_t oldsr;
+	uint16_t oldsr;
 	int16_t nop;
 
 	grploc[grp] = loc;
-	val = (loctab[loc] << 1) ^ 0x8000;
+	val = (loctab[loc] << 1) ^ (int16_t)0x8000;
 	g = grp + 1;
 
-	fpmant = (((int32_t)curintp & 0x0000FFF0L) *
-		  ((int32_t)timemlt & 0x0000FFFFL)) >> 15;
+	fpmant = (uint16_t)(((uint32_t)(curintp & 0xFFF0) *
+		  ((uint32_t)timemlt)) >> 15);
 
 	fpexp = expbit[curintp & 0x000F];
@@ -65,12 +65,12 @@
 
 			if (fp->idftmd & I_VNSUBN)
-				*(fpu + (int32_t)FPU_TNV1) = val;
+				*(fpu + FPU_TNV1) = (uint16_t)val;
 			else
-				*(fpu + (int32_t)FPU_TNV0) = val;
+				*(fpu + FPU_TNV0) = (uint16_t)val;
 
 			++nop;	++nop;	++nop;
 
-			*(fpu + (int32_t)FPU_TCTL) =
-				(fp->idftmd & (I_NRATIO | I_NVBITS)) | 0x0001;
+			*(fpu + FPU_TCTL) = (uint16_t)
+				((fp->idftmd & (I_NRATIO | I_NVBITS)) | 0x0001);
 
 			setsr(oldsr);
@@ -107,11 +107,11 @@
 		if (E_NULL NE (ep = findev(p_cur, t_cur, EV_LOCN, n, -1))) {
 
-			ep->e_data2 = ival;
+			ep->e_data2 = (int8_t)ival;
 
 		} else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
 
 			ep->e_type  = EV_LOCN;
-			ep->e_data1 = n;
-			ep->e_data2 = ival;
+			ep->e_data1 = (int8_t)n;
+			ep->e_data2 = (int8_t)ival;
 			ep->e_time  = t_cur;
 			p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
@@ -166,5 +166,5 @@
 	(void)n;
 
-	ebuf[0]  = k + '0';
+	ebuf[0]  = (int8_t)(k + '0');
 
 	if (v_regs[5] & 0x0180)
