X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=rtl%2Fjava%2FSYSTEM.java;h=7e6a0f8d7308e854443f588c1373a3dd08f8554e;hb=317e2eb03b343f9d753990e6ed8386fd4effca60;hp=20cbe60f2115f1167d1076d32f81b2f7a3040386;hpb=0f382f6efef254a295e71dc82ddd0f87b95aaddd;p=dsw-obn.git diff --git a/rtl/java/SYSTEM.java b/rtl/java/SYSTEM.java index 20cbe60..7e6a0f8 100644 --- a/rtl/java/SYSTEM.java +++ b/rtl/java/SYSTEM.java @@ -1,3 +1,5 @@ +import java.lang.Math; + public class SYSTEM { /* Каркас для фреймов процедур */ @@ -37,6 +39,21 @@ public class SYSTEM v[i] = 0; } + public static void COPY(String x, byte[] v) + { + int ix = x.length(); + int iv = v.length - 1; + + int i = 0; + int len = (ix < iv) ? (ix) : (iv); + while(i < len) + { + v[i] = (byte) x.charAt(i); + i += 1; + } + v[i] = 0; + } + public static int STRCMP(byte[] a, byte[] b) { int i = 0; @@ -76,6 +93,10 @@ public class SYSTEM { throw new RuntimeException("NOT IMPLEMENTED"); } + else if(n == -4) + { + throw new RuntimeException("RETURN TRAP"); + } else { throw new RuntimeException("TRAP CODE " + n);