Browse Source

* fixed test program - bug #40072

Tomas Hajny 2 năm trước cách đây
mục cha
commit
092bc17cb2
1 tập tin đã thay đổi với 29 bổ sung0 xóa
  1. 29 0
      rtl/emx/tests/helloos2.pas

+ 29 - 0
rtl/emx/tests/helloos2.pas

@@ -0,0 +1,29 @@
+program HelloOS2;
+
+var A,B: ^word;
+
+begin
+    WriteLn ('Hello World.');
+    case os_mode of
+     osDOS: WriteLn ('Running under DOS.');
+     osDPMI: WriteLn ('Running under DPMI (RSX extender).');
+     else WriteLn ('Running under OS/2.');
+    end;
+    {
+    WriteLn ('Free memory: ', MemAvail);
+    WriteLn ('Largest block: ', MaxAvail);
+    WriteLn ('Heap start: ',longint(heaporg));
+    WriteLn ('Heap end: ',longint(heapend));
+    }
+    WriteLn ('Memory allocation.');
+    GetMem (A, 1000);
+    GetMem (B, 2000);
+    A^ := 2;
+    B^ := 10;
+    {
+    WriteLn ('Free memory: ', MemAvail);
+    WriteLn ('Largest block: ', MaxAvail);
+    }
+    FreeMem (A, 1000);
+    FreeMem (B, 2000);
+end.