about summary refs log tree commit diff
path: root/dosfetch.pas
diff options
context:
space:
mode:
Diffstat (limited to 'dosfetch.pas')
-rw-r--r--dosfetch.pas34
1 files changed, 33 insertions, 1 deletions
diff --git a/dosfetch.pas b/dosfetch.pas
index 014a793..979924d 100644
--- a/dosfetch.pas
+++ b/dosfetch.pas
@@ -33,8 +33,40 @@ begin
 end;
 
 procedure extended_memory;
+var a, c, d : integer;
+    l : longint;
+    err : byte;
 begin
-   writeln(cmos($17) + 256*longint(cmos($18)), ' KB');
+   err := 0;
+
+   asm
+     mov ah, $88;
+     int $15;
+     jnc @@skip;
+     mov err, ah;
+     @@skip:
+     mov a, ax;
+   end;
+
+   if err > 0 then
+      writeln('none')  { XXX could be wrong on XT }
+   else begin
+      asm
+         clc;
+         mov ax, $E801;
+         int $15;
+         jnc @@skip;
+         mov err, ah;
+         @@skip:
+         mov c, cx;
+         mov d, dx;
+      end;
+
+      if err > 0 then
+         writeln(cmos($17) + 256*longint(cmos($18)), ' KB')
+      else
+         writeln(longint(c) + 64*longint(d), ' KB');
+   end;
 end;
 
 procedure disksize(disk: byte);