home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / basic / bas-rel1.lbr / BAS-REL.DZC / BAS-REL.DOC
Encoding:
Text File  |  1988-02-27  |  5.8 KB  |  127 lines

  1. February 23, 1988
  2. Lawrence Davis
  3.  
  4. BAS-REL.LBR is a collection of assembly language sub-routines that may be 
  5. called by a compiled MBASIC program (CP/M only).  Although some of these 
  6. functions can be duplicated by BASIC code it is much slower.
  7.  
  8. It is encouraged that those that use assembly language sub-routines make 
  9. them available to the CP/M community.  Such sub-routine libraries are 
  10. available to the MS/DOS community and many are either shareware or 
  11. commercial.  Those that work with compiled MBASIC (BASCOM) in the CP/M 
  12. world are far fewer in number and it would not be a practical venture to 
  13. market such a collection.  Therefore, I again appeal to those few 
  14. programmers that use assembly language sub-routines in their BASCOM 
  15. programs to make them available to the CP/M community at large.
  16.  
  17. Submissions should be made to the Glendale Litera QBBS-RCP/M at
  18. 818/956-6164 (HST-9600 - 24 hours).  Sub-routines should in Microsoft 
  19. REL format so they can linked into the BASIC program with L80 or LD80.
  20. Note the following format for desribing the usage of the each REL
  21. file.  Where examples are necessary a short program or a few coded
  22. lines will suffice to explain.  Submissions will be verified and
  23. placed in BAS-REL.LBR.  A BAS-REL.UPD file will note new additions to
  24. the library.
  25.  
  26. ------------------------------
  27. Assembly Language Sub-Routines
  28. ------------------------------
  29.  
  30. Sub-Routine Name:  UCASE
  31. File            :  UCASE.REL
  32. Purpose         :  Convert a string to upper case
  33. Syntax          :  CALL UCASE (A$) - Returns A$ in upper case
  34. Example         :  INPUT "Enter your first name: ",A$
  35.                 :  CALL UCASE (A$)
  36. Explanation     :  Convert name (A$) to upper case
  37. ------------------------------------------------------------------
  38. Sub-Routine Name:  LCASE
  39. File            :  LCASE.REL
  40. Purpose         :  Convert a string to lower case
  41. Syntax          :  CALL LCASE (A$) - Returns A$ in lower case
  42. Example         :  INPUT "Enter your first name: " , A$
  43.                 :  A1$ = LEFT$ (A$ , 1) : CALL UCASE (A1$)
  44.                 :  A2$ = MID$ (A$ , 2): CALL LCASE (A2$)
  45.                 :  NAME$ = A1$ + A2$
  46. Explanation     :  Convert name to normal upper/lower case mix
  47. ------------------------------------------------------------------
  48. Sub-Routine Name:  CTAIL
  49. File            :  CTAIL.REL
  50. Purpose         :  Read the CP/M command line
  51. Syntax          :  CALL CTAIL (A$) - Returns command line in A$
  52. Example         :  CALL CTAIL (CMD$)
  53.                 :  IF CMD$ = "" THEN INPUT "ENTER YOUR COMMAND" , CMD$
  54. Explanation     :  Check for command line arguments from CP/M command line
  55. ------------------------------------------------------------------
  56. Sub-Routine Name:  RRUN
  57. File            :  RRUN.REL
  58. Purpose         :  To re-run the BASCOM program
  59. Syntax          :  CALL RRUN
  60. Explanation     :  Executes a JMP 100H (more efficient than BASIC run command)
  61. ------------------------------------------------------------------
  62. Sub-Routine Name:  BDOS
  63. File            :  BDOS.REL
  64. Purpose         :  To make a CP/M BDOS call
  65. Syntax          :  CALL BDOS (CMD , DAT, RES ) - Integers only
  66.                 :  CMD = Function number in C reg
  67.                 :  DAT = Data in E or DE reg
  68.                 :  RES = Returned value in A reg
  69. Example         :  CMD = 32 : DAT = 15 : RES = 0
  70.                 :  CALL BDOS (CMD, DAT, RES)
  71. Explanation     :  Set user area to 15
  72. -----------------------------------------------------------------
  73. Sub-Routine Name:  BDOSHL
  74. File            :  BDOS.REL
  75. Purpose         :  To make a CP/M BDOS call
  76. Syntax          :  CALL BDOSHL (CMD , DAT, RES ) - Integers only
  77.                 :  CMD = Function number in C reg
  78.                 :  DAT = Not used (set to zero)
  79.                 :  RES = Returned value in HL regs
  80. Example         :  CMD = 12 : DAT = 0  : RES = 0
  81.                 :  CALL BDOS (CMD, DAT, RES) : VERS = RES
  82. Explanation     :  Get CP/M version number in variable VERS
  83. ------------------------------------------------------------------
  84.  
  85. Note: Both the BDOS and BDOSHL calls can be used with the BYE5 or NUBYE 
  86. programs to access their extended BDOS calls.
  87.  
  88. CMD = 32 : DAT = 241 : RES = 0
  89. CALL BDOS (CMD, DAT , RES)
  90. IF RES <> 77 THEN PRINT "BYE not active"
  91.  
  92. Above call checks to see if BYE is present
  93.  
  94. CMD = 79 : DAT = 0 : RES = 0
  95. CALL BDOSHL (CMD, DAT, RES) : RTC = RES
  96.  
  97. Address of RTC buffer in RTC variable
  98.  
  99. -----------------------------------------------------------------
  100. Sub-Routine Name:  SETDMA
  101. File            :  DIR.REL
  102. Purpose         :  Set DMA buffer for subsequent file operations
  103. Syntax          :  CALL SETDMA (ARRAY(0))
  104. Example         :  DIM ARRAY(64)
  105.                 :  CALL SETDMA (ARRAY(0))
  106. Explanation     :  Define 128 byte array for DMA buffer
  107.                 :  Set DMA to starting address of array
  108.                 :  See RDIR.BAS
  109. ------------------------------------------------------------------
  110. Sub-Routine Name:  GET1ST
  111. File            :  DIR.REL
  112. Purpose         :  Scans directory for a match to file named in the FCB
  113. Syntax          :  CALL GET1ST (FCB(0),FLG)
  114. Example         :  DIM FCB (20) : FLG = 0
  115.                 :  CALL GET1ST (FCB(0),FLG)
  116. Explanation     :  Passes address of FCB array
  117.                 :  Directory code returned in FLG variable
  118.                 :  See RDIR.BAS
  119. ------------------------------------------------------------------
  120. Sub-Routine Name:  GETNXT
  121. File            :  DIR.REL
  122. Purpose         :  Continues to scan directory for a match to file named in 
  123.                 :  the FCB
  124. Syntax          :  CALL GETNXT (FCB(0),FLG)
  125. Explanation     :  See RDIR.BAS
  126. ------------------------------------------------------------------
  127.