diff --git a/rtl/SYSTEM.java b/rtl/SYSTEM.java
index 68f82bd0983c3ee348507e7903023dc63318cf8c..ce1b50621e447042154ad9d70dc11136278673ff 100644 (file)
--- a/rtl/SYSTEM.java
+++ b/rtl/SYSTEM.java
return i;
}
+ public static String STRING(byte[] x)
+ {
+ return new String(x, 0, LEN(x));
+ }
+
public static void COPY(byte[] x, byte[] v)
{
- int len_x = LEN(x);
- int len_v = v.length - 1;
+ int ix = LEN(x);
+ int iv = v.length - 1;
- int len = (len_x < len_v) ? (len_x) : (len_v);
- for(int i = 0; i < len; i++)
+ int i = 0;
+ int len = (ix < iv) ? (ix) : (iv);
+ while(i < len)
{
v[i] = x[i];
+ i += 1;
}
-
- v[len] = 0;
+ v[i] = 0;
}
public static int STRCMP(byte[] a, byte[] b)
{
throw new RuntimeException("WITH TRAP");
}
+ else if(n == -3)
+ {
+ throw new RuntimeException("NOT IMPLEMENTED");
+ }
else
{
throw new RuntimeException("TRAP CODE " + n);