BASIC-DOS

A PCjs Retro-Programming Project

BASIC-DOS is on Twitter Project maintained by jeffpar

BASIC-DOS on an IBM PC with a Mouse

The machine below is an IBM PC (Model 5150) with a 4.77Mhz 8088, 256K of memory, a Color Display, and two diskette drives, plus a serial mouse on COM2. It boots the BASICDOS-360K-S80 diskette and runs PAINT.BAS. Click the screen to capture the mouse, and hold the left button down to draw; press Esc twice to exit.

IBM PC, 256Kb RAM, Dual Floppy Drives, CGA, Serial Mouse

Color Display
Caps
Num
Scroll
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
Esc
1 !
2 @
3 #
4 $
5 %
6 ^
7 &
8 *
9 (
0 )
- _
= +
Back
-
Num
Scroll
Tab
Q
W
E
R
T
Y
U
I
O
P
[ {
] }
↵
7
↑ 8
9
Ctrl
A
S
D
F
G
H
J
K
L
; :
' "
` ~
← 4
5
→ 6
+
Shift
\ |
Z
X
C
V
B
N
M
, <
. >
/ ?
Shift
PrtSc
1
↓ 2
3
Alt
Space
Caps
Ins 0
Del .
Esc
Tab
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
Num
Scroll
1 !
2 @
3 #
4 $
5 %
6 ^
7 &
8 *
9 (
0 )
- _
= +
Back
-
+
Q
W
E
R
T
Y
U
I
O
P
[ {
] }
↵
7
↑ 8
9
A
S
D
F
G
H
J
K
L
; :
' "
` ~
← 4
5
→ 6
\ |
Z
X
C
V
B
N
M
, <
. >
/ ?
Shift
PrtSc
1
↓ 2
3
Ctrl
Shift
Alt
Space
Caps
Ins 0
Del .

This demo is also available on an IBM PC XT, an IBM PC AT, and a COMPAQ DeskPro 386.

These machines have a serial mouse on COM2, which the MOUSE$ driver finds at boot. They boot the BASICDOS-360K-S80 diskette and run PAINT.BAS, which switches the display to SCREEN 2 (640x200) and turns the mouse on with MOUSE ON.

The screen has a banner at the top and a status line at the bottom, and everything between the two lines is a black canvas. Click the screen to capture the mouse, then hold the left button down to draw with white pixels. The mouse’s X,Y position is always displayed in the lower left corner.

To exit, press Esc once to release the mouse, and then press Esc again to end the program; BASIC-DOS restores the original display mode. Type PAINT to run it again.

PAINT.BAS reads the current mouse position and buttons with MOUSE(3), MOUSE(4), and MOUSE(5), and while the left button is down, it draws a line from the previous position to the current one, so that fast mouse movements leave no gaps. It updates the position display only when the mouse moves.

PAINT.BAS from the BASICDOS-360K-S80 Diskette

10 REM PAINT.BAS: scribble with the mouse in SCREEN 2 (640x200)
20 REM Hold the left button down to draw, and press ESC to exit
30 DEFINT A-Z:SCREEN 2:MOUSE ON:PX=-1:LX=-1
40 LOCATE 1,29:PRINT "Welcome BASIC-DOS Paint";
50 LINE (0,8)-(639,8):LINE (0,191)-(639,191)
60 X=MOUSE(3):Y=MOUSE(4):B=MOUSE(5)
70 IF X<>LX OR Y<>LY THEN LOCATE 25,1:PRINT MID$(STR$(X),2);",";MID$(STR$(Y),2);"   ";:LX=X:LY=Y
80 IF (B AND 1)=0 OR Y<9 OR Y>190 THEN PX=-1:GOTO 110
90 IF PX<0 THEN PSET (X,Y) ELSE LINE (PX,PY)-(X,Y)
100 PX=X:PY=Y
110 IF INKEY$<>CHR$(27) THEN 60

Copyright (c) 2020-2026 Jeff Parsons Released under MIT License