home *** CD-ROM | disk | FTP | other *** search
- 10 REM *****************************
- 20 REM * Simple security program *
- 30 REM * for use with the PC 36A *
- 40 REM * By Alan Foster *
- 50 REM * (c) Database Publications *
- 60 REM *****************************
- 70 OUT &H303,130:REM Set port A to output and port B to input
- 80 REM Set up screen display
- 90 CLS
- 100 COLOR 14,0
- 110 LOCATE 5,25
- 120 PRINT "***** System Status *****"
- 130 LOCATE 10
- 140 PRINT
- 150 PRINT "Zone 1 Main entrance doors Status"
- 160 PRINT "Zone 2 Service door Status"
- 170 PRINT "Zone 3 Workshop windows Status"
- 180 PRINT "Zone 4 Office windows Status"
- 190 PRINT "Zone 5 Office safe Status"
- 200 PRINT "Zone 6 Stores internal doors Status"
- 210 PRINT "Zone 7 Garage doors and windows Status"
- 220 PRINT "Zone 8 Security entry switch Status"
- 230 LOCATE 20
- 240 PRINT "Press Q to quit"
- 250 n$="Normal"
- 260 al$="Alarm "
- 270 set$="System set "
- 280 in$="System Inhibited"
- 290 REM Look at port B
- 300 look=INP(&H301)
- 310 REM Take action on result of look at port
- 320 IF look=128 THEN OUT &H300,1:REM Turn on set light
- 330 IF look>128 THEN BEEP
- 340 IF look<128 THEN OUT &H300,2:REM Turn on inhibit light
- 350 IF look>128 THEN OUT &H300,193:REM Ring alarm bells
- 360 REM Display condition of inputs on screen
- 370 LOCATE 18,48
- 380 IF look<=128 THEN r$=in$
- 390 IF look>=128 THEN look=look-128:r$=set$
- 400 PRINT r$
- 410 LOCATE 17,48
- 420 IF look<=64 THEN r$=n$
- 430 IF look>=64 THEN look=look-64:r$=al$
- 440 PRINT r$
- 450 LOCATE 16,48
- 460 IF look<=32 THEN r$=n$
- 470 IF look>=32 THEN look=look-32:r$=al$
- 480 PRINT r$
- 490 LOCATE 15,48
- 500 IF look<=16 THEN r$=n$
- 510 IF look>=16 THEN look=look-16:r$=al$
- 520 PRINT r$
- 530 LOCATE 14,48
- 540 IF look<=8 THEN r$=n$
- 550 IF look>=8 THEN look=look-8:r$=al$
- 560 PRINT r$
- 570 LOCATE 13,48
- 580 IF look<=4 THEN r$=n$
- 590 IF look>=4 THEN look=look-4:r$=al$
- 600 PRINT r$
- 610 LOCATE 12,48
- 620 IF look<=2 THEN r$=n$
- 630 IF look>=2 THEN look=look-2:r$=al$
- 640 PRINT r$
- 650 LOCATE 11,48
- 660 IF look<=1 THEN r$=n$
- 670 IF look>=1 THEN look=look-1:r$=al$
- 680 PRINT r$
- 690 IF INKEY$="Q" THEN CLS:STOP:REM Check for Quit
- 700 GOTO 240:REM Go back an take another look
-