summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac2eb0e)
raw | patch | inline | side by side (parent: ac2eb0e)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 8 Oct 2017 14:51:22 +0000 (17:51 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sun, 8 Oct 2017 14:51:22 +0000 (17:51 +0300) |
notes | patch | blob | history | |
rtl/java/Files.java | patch | blob | history |
index 3656a8651495460e27a9c1633f553fed5bacb96f..0aa5f4efc0cfacc852f08c3e7a337ebbba2b959b 100644 (file)
--- a/notes
+++ b/notes
- Нужно передавать информацию о файле и строках в кодогенератор.
- Нет процедур привязанных к типм (10.2)
- Не полная реализация модуля Files
- * Нет процедур ReadNum WriteReal WriteLReal WriteNum WriteSet WriteBool
+ * Нет процедур ReadNum WriteNum
- Разршить отсутсвие RETURN в функциях без BEGIN
С вкорячиванием трапа, естественно.
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)