PDQ Manual.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
CRESCENT SOFTWARE, INC. P.D.Q. A New Concept in High-Level Programming Languages Version 3.13 Entire contents Copyright © 1888-1983 by Ethan Winer and Crescent Software. P.D.Q. was conceived and written by Ethan Winer, with substantial contributions [that is, the really hard parts) by Robert L. Hummel. The example programs were written by Ethan Winer, Don Malin, and Nash Bly, with additional contributions by Crescent and Full Moon customers. The floating point math package was written by Paul Passarelli. This manual was written by Ethan Winer. The section that describes how to use P.O.Q. with assembly language was written by Hardin Brothers. Full Moon Software 34 Cedar Vale Drive New Milford, CT 06776 Sales: 860-350-6120 Support: 860-350-8188 (voice); 860-350-6130 [fax) Sixth printing. LICENSE AGREEMENT Crescent Software grants a license to use the enclosed software and printed documentation to the original purchaser. Copies may be made for back-up purposes only. Copies made for any other purpose are expressly prohibited, and adherence to this requirement is the sole responsibility of the purchaser. However, the purchaser does retain the right to sell or distribute programs that contain P.D.Q. routines, so long as the primary purpose of the included routines is to augment the software being sold or distributed. Source code and libraries for any component of the P.D.Q. program may not be distributed under any circumstances. This license may be transferred to a third party only if all existing copies of the software and documentation are also transferred. WARRANTY INFORMATION Crescent Software warrants that this product will perform as advertised. In the event that it does not meet the terms of this warranty, and only in that event, Crescent Software will replace the product or refund the amount paid, if notified within 30 days of purchase. Proof of purchase must be returned with the product, as well as a brief description of how it fails to meet the advertised claims. CRESCENT SOFTWARE'S LIABILITY IS LIMITED TO mE PURCHASE PRICE. Under no circumstances shall Crescent Software or the authors of this product be liable for any incidental or consequential damages, nor for any damages in excess of the original purchase price. 11 11 1 11111 11111111i11111111111 111i111111111 1 To MY HONEY, ELLI MASTRANGELO WINER II II II Table of Contents 11111 Ill 1111 P.D.Q. Version 3.10 TABLE OF CONfENTS Chapter 1: Introduction About This Manual . 1-1 Installing P.D.Q. ............................... 1-2 P.D. Q. Overview . 1-4 Why BASIC? . 1-5 But Isn't That What C Is For? . 1-5 The Spirit Of Performance . 1-6 P.D. Q. Supported Key Words . 1-6 Differences Between P.D.Q. And Microsoft BASIC .......... 1-8 Floating Point Math . 1-8 Communications and Graphics . 1-9 DOS and Other Errors . 1-9 Ctrl-C and Ctrl-Break ........................... 1-10 Recursive Procedures . 1-11 Dynamic Arrays . 1-11 Huge Arrays . · . 1-11 BASIC 7 Advanced Features ....................... 1-12 Using Overlays ............................... 1-12 Differences By Key Word ........................ 1-12 ASC .................................... 1-12 BLOAD .................................. 1-13 CALL INTERRUPT .......................... 1-13 CHDRIVE ................................ 1-13 CHR$ ................................... 1-14 COLOR .................................. 1-14 COMMAND$ .............................. 1-14 CURDIR$ ................................. 1-14 DIR$ .................................... 1-14 ENVIRON and ENVIRON$ ..................... 1-15 ERR .................................... 1-15 ERROR .................................. 1-15 FILEATTR ................................ 1-16 FRE(-2) .................................. 1-16 FREEFILE ................................ 1-17 GET (binary file version) . ................... 1-17 INKEY$ .................................. 1-18 INPUT$ .................................. 1-18 LPRINT .................................. 1-18 LTRIM$ .................................. 1-18 CRESCENT SOFTWARE, INC. II TABLE OF CONTENTS P.D.Q. Version3.10 NAME ................................... 1-19 OPEN ................................... 1-19 PLAY .................................... 1-19 PRINT ................................... 1-19 PRINT# .................................. 1-20 PRINT USING ............................. 1-20 RANDOMIZE .............................. 1-20 RND .................................... 1-20 RTRIM$ .................................. 1-21 RUN .................................... 1-21 SCREEN (statement form) ...................... 1-21 SLEEP ................................... 1-21 SOUND .................................. 1-21 SSEG .................................... 1-22 S1DP .................................... 1-22 STRING$ ................................. 1-22 SWAP ................................... 1-22 TIMER .................................. 1-22 VAL .................................... 1-23 WIDTH .................................. 1-23 WRITE# ................................. 1-23 Changes From Earlier Versions Of P.D.Q ................. 1-24 Floating Point Math ............................ 1-24 Network Access and File Locking ................... 1-24 Arrays Containing More Than 65,535 Elements .......... 1-25 EGA and VGA Graphics ......................... 1-25 Changes to PRINT and STR$ ...................... 1-25 Linking With /Stack: ........................... 1-26 PopRequest Changes ............................ 1-26 MKD$, MKI$, MKL$, And MKS$ .................. 1-26 RESUME NEXT .............................. 1-26 Swapping TSR Programs ............... : ......... 1-26 New Routines and Programs ....................... 1-27 Files on the P.D.Q. Disk .......................... 1-31 Chapter 2: Compiling and Linking Overview . 2-1 Other LINK Options . 2-2 Creating A Quick Library . 2-4 Linking With Stub Files . 2-5 String Pool Stub Files . 2-6 The POPSWAP Stub File . 2-7 11111 ii CRESCENT SOFTWARE, INC. P.D.Q. Version 3.10 TABLE OF CONTENTS Other Stub Files . 2-7 Stub File Details . 2-7 The SMALLDOS Library File ....................... 2-15 APPEND . ............ 2-17 CLOSE .................................... 2-17 DATA ..................................... 2-17 GET ...................................... 2-18 INPUT .................................... 2-18 INPUT# ................................... 2-18 LINE INPUT ................................ 2-18 LINE INPUT # . .......... 2-18 LOCK and UNLOCK ........................... 2-19 OPEN ..................................... 2-19 PRINT and PRINT# ........................... 2-19 TAB ...................................... 2-20 Chapter 3: File and Error Handling File Handling In P.D.Q ............................. 3-1 Error Handling . 3-1 File Numbers . 3-4 Legal File Operations . 3-4 DOS Devices . 3-4 Chapter 4: TSR Programming Simplified Pop-Ups .............................. 4-1 Restrictions . 4-2 Critical Errors ................................ 4-3 Memory Allocation And Dynamic Arrays . 4-3 TSR Programs That Swap To Disk Or EMS . 4-3 Naming The Swap File .......................... 4-5 Deinstallation . 4-6 Dynamic Memory Allocation . 4-6 Handling Interrupts In A Swapping TSR . 4-6 Communicating With A Swapped TSR . 4-7 The Unique Identification String ...................... 4-8 Specifying The Hot Key . 4-9 Detecting Installation And Deinstalling .................................. .4-11 Advanced TSR Applications ......................... 4-13 P.D.Q. Interrupt Handling Services ................. .4-14 Related Routines ............................. .4-15 Resetting The 8259 PIC ......................... 4-16 CRESCENT SOFTWARE, INC. II iii TABLE OF CONTENTS P.D.Q. Version3.10 The Registers TYPE Variable . .4-17 Floating Point Considerations ....................... .4-18 Floating Point Interrupts ........................ .4-18 Using Floating Point In A TSR .................... .4-19 Floating Point Stub Files ......................... 4-20 Accessing A Resident Program ....................... 4-21 P.D.Q. Runtime Reentrance ........................ .4-22 Using PopRequest .............................. .4-23 Arbitrating Multiple Requests ..................... .4-26 Deinstalling and Unhooking Interrupts ................ 4-28 The DOSWA1CH Example Program ................... 4-29 Chapter 5: P.D.Q. Extensions Overview . 5-1 DOS Extensions . 5-1 Dynamic Memory Allocation .............· ......... 5-2 Input And Keyboard Routines ...................... 5-2 Miscellaneous Routines .......................... 5-3 String Handling Routines . 5-4 TSR And Interrupt Support Routines ................... 5-5 Video Routines . 5-6 Extensions Details . 5-7 AllocMem function . 5-8 BIOSinkey function ............................ 5-10 BIOSinput subroutine . ....................... 5-10 BIOSinput2 function . 5-11 BlockCopy subroutine ........................... 5-13 BreakHit function ............................. 5-13 BreakOff subroutine ............................ 5-14 BreakOn subroutine . ..... 5-15 Bufln function . ....................... 5-15 CallOldlnt subroutine ........................... 5-17 ColorRest subroutine ........................... 5-17 ColorSave function ............................. 5-18 CritErrOff subroutine . 5-18 CritErrOn subroutine ........................... 5-19 CursorOff subroutine ........................... 5-20 CursorOn subroutine ........................... 5-20 CursorRest subroutine ........................... 5-21 CursorSave function ...........................