-
Notifications
You must be signed in to change notification settings - Fork 1
/
SYS-INFO.BAS
66 lines (59 loc) · 1.88 KB
/
SYS-INFO.BAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'function declarations
DECLARE FUNCTION peekb$ (addr&)
DECLARE FUNCTION peekw$ (addr&)
DECLARE FUNCTION peekd$ (addr&)
DECLARE FUNCTION tell$ (flag%, bit%)
'main
CLS
COLOR 15
PRINT "System Information"
COLOR 7
PRINT "------------------"
PRINT ""
COLOR 14
DEF SEG = &H40
PRINT "COM1 address:"; peekw$(&H0)
PRINT "COM2 address:"; peekw$(&H2)
PRINT "COM3 address:"; peekw$(&H4)
PRINT "COM4 address:"; peekw$(&H6)
PRINT "LPT1 address:"; peekw$(&H8)
PRINT "LPT2 address:"; peekw$(&HA)
PRINT "LPT3 address:"; peekw$(&HC)
PRINT "LPT4 address:"; peekw$(&HE)
PRINT "..."
k$ = INPUT$(1)
PRINT ""
PRINT "Equipment List:"
flag% = PEEK(&H10)
PRINT "1 IPL diskette"; tell$(flag%, 0)
PRINT "2 Math coprocessor"; tell$(flag%, 1)
PRINT "3 Pointing device(PS/2)"; tell$(flag%, 2)
PRINT "4 Old PC system board RAM < 256K"; tell$(flag%, 3)
PRINT "5 Initial video mode"; (flag% AND &H30) \ &H10
PRINT "6 Number of diskette drives"; ((flag% AND &HC0) \ 64) + 1
flag% = PEEK(&H11)
PRINT "7 Direct Memory Access(DMA)"; tell$(NOT (flag%), 0)
PRINT "8 Number of serial ports"; (flag% AND &HE) \ 2
PRINT "9 Game adapter"; tell$(flag%, 4)
PRINT "10 Internal modem(PS/2)"; tell$(flag%, 5)
PRINT "11 Number of printer ports"; flag% \ 64
PRINT "..."
k$ = INPUT$(1)
PRINT ""
PRINT "PCjr: Infrared keyboard link error count:"; peekb$(&H12)
PRINT "Memory Size in KB:"; PEEK(&H13) + CLNG(PEEK(&H14)) * &H100
PRINT "PS/2 BIOS control state:"; peekb$(&H16)
PRINT
COLOR 7
FUNCTION peekb$ (addr&)
peekb$ = " " + HEX$(PEEK(addr&)) + "h"
END FUNCTION
FUNCTION peekd$ (addr&)
peekd$ = " " + HEX$(PEEK(addr&) + PEEK(addr& + 1) * &H100 + CLNG(PEEK(addr& + 2)) * &H10000 + CLNG(PEEK(addr& + 3)) * &H1000000) + "h"
END FUNCTION
FUNCTION peekw$ (addr&)
peekw$ = " " + HEX$(PEEK(addr&) + CLNG(PEEK(addr& + 1)) * &H100) + "h"
END FUNCTION
FUNCTION tell$ (flag%, bit%)
IF ((flag% AND (2 ^ bit%)) = 1) THEN tell$ = " is present." ELSE tell$ = " is absent."
END FUNCTION