home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / basic / bmag / bmag01-1.doc < prev    next >
Encoding:
Text File  |  1994-05-01  |  6.7 KB  |  150 lines

  1. ╔═════════════════════════════════════════════════════════════════════╗
  2. ║                  BASIC Magazine vol. 1 number 1                     ║
  3. ║                            April, 1994                              ║
  4. ║           Copyright 1994, Ken Witherow. All Rights Reserved.        ║
  5. ║                  All code below is public domain                    ║
  6. ║                     unless specifially marked.                      ║
  7. ║                                                                     ║
  8. ║          See subscrip.doc for information on subscribing            ║
  9. ╚═════════════════════════════════════════════════════════════════════╝
  10.  
  11. Contents
  12. 1.      Intro to BMag
  13. 2.      Legal stuff
  14. 3.      Authors wanted
  15. 4.      Interfacing assembly language with BASIC
  16. 5.      Review of PowerBASIC
  17. 6.      Ending notes
  18.  
  19.  
  20. 1. BMag - What is it?
  21.  
  22. BMag, or BASIC Magazine, is a magazine totally dedicated to the BASICs.
  23. Within it, you can find code for all the various compilers EXCEPT Visual
  24. BASIC unless demand is great enough to warrant it. Assembly language
  25. code will also be included on occasion to provide routines with a faster
  26. way to execute. Assembly .OBJ files will be included in the regular
  27. version, but all assembly source will be included in the registered
  28. version. Included in this archive will be an archive with all of the
  29. decent source code posted in the FidoNet QUIK_BAS, BASIC7, and POWER_BAS
  30. echoes. A new magazine should come out every month.
  31.  
  32.  
  33. 2. The legal stuff
  34.  
  35. BMag is the property of Ken Witherow and may not be modified without
  36. permission from him and only him. Any source code may be used freely
  37. unless otherwise stated. Ken Witherow and any other contributing authors
  38. take no responsibility of any problems that may arise from the use of
  39. anything distributed in this package. Ken Witherow will not pay for the
  40. use of any programmer's material that they wish to contribute.
  41.  
  42. Windows, Visual BASIC, Quick BASIC, QBasic, PDS, and MASM are registered
  43. trademarks of MicroSoft, Inc.
  44.  
  45. PowerBASIC is the registered trademark of PowerBASIC, Inc.
  46.  
  47. TASM is the registered trademark of Borland International, Inc.
  48.  
  49. Sound Blaster is the registered trademark of Creative Labs, Inc.
  50.  
  51. 3.  Authors wanted
  52.  
  53. BMag is currently looking for programmers that would like to
  54. contribute to the magazine. It doesn't matter if it's source code, the
  55. review of a product, how to do different programs in the BASICs, or
  56. anything else. If your program is selected, you will be creditted in
  57. the magazine.
  58.  
  59. Snail Mail:
  60. Ken Witherow
  61. 6769 Cadyville Rd.
  62. Livonia, NY 14487
  63.  
  64. Netmail:
  65. Ken Witherow @ 1:2613/280
  66.  
  67. InterNet:
  68. Ken.Witherow@f280.n2613.z1.fidonet.org
  69.  
  70.  
  71. 4.  Featured Topic - Assembly language for BASIC
  72.                         -by Ken Witherow
  73.  
  74. This month, we will focus on the idea of combining assembly language
  75. programs with BASIC programs for speed and/or size.
  76.  
  77.         Many people have complained about BASIC programs being large,
  78. slow, and inefficient. By combining assembly language with your BASIC
  79. programs, you can defeat all three of these problems. The hardest part
  80. of creating assembly language procedures for BASIC is just learning
  81. assembly. After that, it's pretty easy.
  82.         The first thing that you'll want to do is make the model
  83. MEDIUM, BASIC. Next, add the PUBLIC FunctionName command into the .ASM
  84. file. After that, when you start getting into the nitty gritty of
  85. programming the code, you have to define your procedure with the proper
  86. call length. In most cases, you can define your PROC as FAR but in some
  87. special cases, you'll need or want to use NEAR calls. To pass
  88. parameters, you'll need to first push BP onto the stack and then move
  89. the value of SP into BP. When you're ready to retrieve the variable,
  90. move the address BP+6 into the SI register. Then simply move the byte at
  91. SS:SI into the register you wish to work with. When you're done with the
  92. procedure, be sure to get BP back off the stack and after your RET
  93. statement, include the number of bytes you want to pop off the stack
  94. (ie, the number of bytes your variables use). Another thing I recommend
  95. is to give the routine it's own segment using the SEGMENT and ASSUME
  96. commands. In the file CURSCRN.ASM, you'll find a fully commented
  97. routine showing how to do this (since the featured topic is assembly
  98. language, all source will be included in this issue). Then simply
  99. assembly the program and link it in with your BASIC program.
  100.         If all this is confusing, the source code includeded is well
  101. commented so you will know what you're doing.
  102.         *** Inside of your BASIC file, you will define your procedures
  103. by using the DECLARE statement.
  104.         *** Note for PowerBASIC users. PowerBASIC has built in inline
  105. assembly allowing you to directly code your routines there. Another
  106. feature allows you to directly link the .OBJ files to your program
  107. ($LINK).
  108.  
  109.  
  110. 5.  Review of PowerBASIC
  111.                    -by Ken Witherow
  112.  
  113.         This month's program review consists of PowerBASIC, Inc.'s,
  114. formerly Spectra Publishing, PowerBASIC compiler. Currently at version
  115. 3.0c, I find PowerBASIC to be the best in BASIC compilers out there.
  116. It's powerful features include thing such as inline assembly, use of
  117. unions, more data types, 8086-80386 coding, a full debugger, and a slew
  118. of others. The editor, which I sometimes find very annoying, is fully
  119. configurable and gives a good amount of detail about your programs and
  120. includes a great help system. With the recent death of the MicroSoft DOS
  121. compilers, I find it a great addition to my programming tools. Many
  122. libraries have been put together for it ranging from Sound Blaster
  123. programming to hi-res graphics programming to just about anything else
  124. you can imagine. I recommend it to any serious programmer who would like
  125. to program optimized code or anything huge. PowerBASIC allows programs
  126. to get as big as you want them to be so we never have to live up to the
  127. limitations of those 'other compilers'. While I still like the QB
  128. series, PowerBASIC takes the cake and then some in my opinion. BTW-look
  129. for PB/WIN which has just been released and there are rumors of PB/2.
  130.  
  131. You can purchase PowerBASIC from the address below for $159.
  132.  
  133.    PowerBASIC, Inc.
  134.    235 Oak St. Ste 21
  135.    Brentwood, CA  94513
  136.    Order Desk: 800-780-7707
  137.    Voice:      510-516-7700
  138.    Fax:        510-634-0439
  139.  
  140.  
  141. 6.  Ending notes
  142.  
  143. With this I wrap up this month's copy of BMag. Next issue, expect a
  144. plethora of BASIC source code as well as more reviews and programming
  145. topics. I know, this issue was pretty ruff, but it was all done in one
  146. night's work. As I sit here at 12:39am, I wonder how well this will fare
  147. out there in modem land... Last minute news, Wayne Venables will be
  148. doing some stuff on VB/DOS next issue.
  149.  
  150.