X-Git-Url: https://deadsoftware.ru/gitweb?p=dsw-obn.git;a=blobdiff_plain;f=rtl%2Fjava%2FFiles.java;h=9cb6aee0731c85ddb3da5ca2a3276ccaec686b16;hp=17694523dbba69ef510b4d21ffb0b4965c3f72df;hb=c3c7b7920e8061bd5f2820ccca1153bd2174fe01;hpb=ac2eb0e30e5c65480e72565b104ea9a602fe31e2 diff --git a/rtl/java/Files.java b/rtl/java/Files.java index 1769452..9cb6aee 100644 --- a/rtl/java/Files.java +++ b/rtl/java/Files.java @@ -349,14 +349,28 @@ class Files WriteBytes(R, R$, i, 0, 4); } + public static void WriteHInt(RECORD1 R[], int R$, long x) + { + byte[][] i = new byte[1][8]; + i[0][7] = (byte) ((x >>> 56) & 0xff); + i[0][6] = (byte) ((x >>> 48) & 0xff); + i[0][5] = (byte) ((x >>> 40) & 0xff); + i[0][4] = (byte) ((x >>> 32) & 0xff); + i[0][3] = (byte) ((x >>> 24) & 0xff); + i[0][2] = (byte) ((x >>> 16) & 0xff); + i[0][1] = (byte) ((x >>> 8) & 0xff); + i[0][0] = (byte) ((x) & 0xff); + WriteBytes(R, R$, i, 0, 8); + } + public static void WriteReal(RECORD1 R[], int R$, float x) { - SYSTEM.TRAP(-3); + WriteLInt(R, R$, Float.floatToRawIntBits(x)); } public static void WriteLReal(RECORD1 R[], int R$, double x) { - SYSTEM.TRAP(-3); + WriteHInt(R, R$, Double.doubleToRawLongBits(x)); } public static void WriteNum(RECORD1 R[], int R$, int x) @@ -373,12 +387,19 @@ class Files public static void WriteSet(RECORD1 R[], int R$, int x) { - SYSTEM.TRAP(-3); + WriteLInt(R, R$, x); } public static void WriteBool(RECORD1 R[], int R$, boolean x) { - SYSTEM.TRAP(-3); + if(x) + { + Write(R, R$, (byte) 1); + } + else + { + Write(R, R$, (byte) 0); + } } public static void WriteBytes(RECORD1 r[], int r$, byte[][] x, int x$, int n)