diff --git a/rtl/java/Files.java b/rtl/java/Files.java
index 17694523dbba69ef510b4d21ffb0b4965c3f72df..9cb6aee0731c85ddb3da5ca2a3276ccaec686b16 100644 (file)
--- a/rtl/java/Files.java
+++ b/rtl/java/Files.java
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)
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)