Qbs Opinion...

 BBS: Inland Empire Archive
Date: 02-14-93 (15:01)             Number: 278
From: JAMES VAHN                   Refer#: 232
  To: LEE MADAJCZYK                 Recvd: NO  
Subj: Qbs Opinion...                 Conf: (2) Quik_Bas

Hi Lee,

Let me get this right..  These 12 sites f'req the file and put
it up for public access, at no charge?  You are doing the
archiving, giving yourself credit for your own work and also at
no charge?  The contributors, distributors and yourself - no
charge?

Sounds like a no-charge public information distribution system to
me.   8-)


And on that note, here's a few shorties that people have
expressed interest in before..

Oh..  '******** QBS yes.  ;-)

==================
Here's a CMOS save/restore utility.

'cmos2dsk.bas - James Vahn
'CMOS save/restore utility

DIM Byte AS STRING * 1
LOCATE , , 1
PRINT "Cmos 2 disk - James Vahn 1:30854/20@fidonet"
PRINT "Would you like to (S)ave or (R)estore your current CMOS data? ";

WHILE a$ = "": a$ = INKEY$: WEND
IF a$ = "s" THEN
        OPEN "\cmos.dat" FOR OUTPUT AS #1
        FOR CMOS = &H0 TO &H3F
        OUT &H70, CMOS
        DByte% = INP(&H71)
        PRINT #1, CHR$(DByte%);
        NEXT: CLOSE 1
PRINT "Data Saved": END

ELSEIF a$ = "r" THEN
        OPEN "\cmos.dat" FOR BINARY AS #1
        FOR CMOS = 1 TO LOF(1)
        OUT &H70, CMOS - 1
        GET #1, , Byte
        OUT &H71, ASC(Byte)
        NEXT: CLOSE 1
PRINT "Data Restored - please reboot.": END

END IF

=========================
This shows how to make specific frequencies through the PC
speaker.  How high a note can you hear?  :-)

'Speaker.bas - James Vahn 1:30854/20@fidonet
'Shows the use of PC hardware to generate sound.
'
        Old = INP(&H61)     ' 8255 PPI chip. Save the original.
        OUT &H43, 182       ' 8253 Timer chip. 10110110b Channel 2, mode 3
        Port = INP(&H61)    ' get the 8255 port contents.
        OUT &H61, Port OR 3 ' enable the speaker and use channel 2.

INPUT "Desired Frequency in Hz"; Hz
Divisor = 1193180 / Hz
LSB = Divisor MOD 256
MSB = Divisor \ 256

OUT &H42, LSB
OUT &H42, MSB

PRINT "Press any to stop"
WHILE INKEY$ = "": WEND
OUT &H61, Old  ' turn it off.

========================
'test4ems.bas  -  James Vahn 1:30854/20@fidonet
'written for QB 4.5  Load QB/L - does not work with Qbasic.
'$INCLUDE: 'qb.bi'

'This checks out your EMS driver & hardware.

TYPE EmsHardware
        EmmRawPageSize                  AS INTEGER
        NumberAlternateRegisterSets     AS INTEGER
        SizeMappingContextSaveArea      AS INTEGER
        NumberDMARegisterSets           AS INTEGER
        DMAOperationType                AS INTEGER
END TYPE

DIM Regs AS RegTypeX
DIM EmsH AS EmsHardware

Regs.ax = &H3567                 ' locate code for INT 67, EMS driver.
CALL INTERRUPTX(&H21, Regs, Regs)
DEF SEG = Regs.es
    FOR t = &HA TO &H11          ' search the driver header for text
    EMS$ = EMS$ + CHR$(PEEK(t))
    NEXT
IF EMS$ = "EMMQXXX0" THEN
    EMS$ = "EMMXXXX0"
    PRINT "DR DOS EMM386 detected."
    PRINT "Would you like it fixed (y/n)?"
          WHILE A$ = ""
          A$ = INKEY$
          WEND
          IF A$ = "y" THEN
          POKE &HA + 3, ASC("X")    ' fix(?) the driver handle.
          END IF
END IF
DEF SEG
IF EMS$ <> "EMMXXXX0" THEN PRINT "No EMS installed": END

PRINT "EMS Driver found at "; HEX$(Regs.es); ":"; HEX$(Regs.bx)
Regs.ax = &H5900        ' subfunction 59h
Regs.es = VARSEG(EmsH)  ' point ES:DI to the array EmsH
Regs.di = VARPTR(EmsH)  '
CALL INTERRUPTX(&H67, Regs, Regs)

PRINT "Emm Raw Page Size"; EmsH.EmmRawPageSize
PRINT "Number Alternate Register Sets"; EmsH.NumberAlternateRegisterSets
PRINT "Size Mapping Context Save Area"; EmsH.SizeMappingContextSaveArea
PRINT "Number DMA Register Sets"; EmsH.NumberDMARegisterSets
PRINT "DMA Operation Type"; EmsH.DMAOperationType

Regs.ax = &H4200
CALL INTERRUPTX(&H67, Regs, Regs)

PRINT "Total EMS memory"; Regs.dx * 16; CHR$(29) + "k"
PRINT "Total EMS memory available"; Regs.bx * 16; CHR$(29) + "k"
PRINT
 IF EmsH.NumberAlternateRegisterSets = 0 THEN
        PRINT "Hardware alternate page mapping not supported."
        PRINT " Bad news for multitasking."
 ELSE
        PRINT "Suitable for multitasking."
 END IF
 =========================

 * SLMR 2.1a *

--- Maximus 2.01wb
 * Origin: Inland Empire Archive (1:346/10)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET