diff options
author | Leah Neukirchen <leah@vuxu.org> | 2023-07-30 13:42:19 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2023-07-30 13:42:19 +0200 |
commit | 9923c80d62b339010ba5bbe6c77ef3501b5ce726 (patch) | |
tree | 8702296c91197b278c27d76141288c62f8242aa5 | |
parent | 53ad24ce6e5bfe81bf62e1e19f84b14cadd6e0c4 (diff) | |
download | dosfetch-9923c80d62b339010ba5bbe6c77ef3501b5ce726.tar.gz dosfetch-9923c80d62b339010ba5bbe6c77ef3501b5ce726.tar.xz dosfetch-9923c80d62b339010ba5bbe6c77ef3501b5ce726.zip |
more robust extendend memory detection
-rw-r--r-- | dosfetch.pas | 34 |
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); |