home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / gendoc / ucpm10.ark / PART5.STR < prev    next >
Encoding:
Text File  |  1988-02-01  |  33.8 KB  |  755 lines

  1. .hm 1
  2. .he
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                 PART 5:
  22.  
  23.  
  24.                    Programming Reference Information
  25.  
  26. .pa
  27. è.he UCPM Manual, Reference, Page #
  28.  
  29. A.  CP/M BDOS AND BIOS REFERENCE
  30.  
  31.      1.  BDOS Calls
  32.  
  33.      Function and Number      Input Parameters    Output Parameters
  34.  
  35.      System Reset      0      None                None
  36.      Read Console      1      None                ASCII Char in A
  37.      Write Console     2      ASCII Char in E     None
  38.      Read Reader       3      None                ASCII Char in A
  39.      Write Punch       4      ASCII Char in E     None
  40.      Write List        5      ASCII Char in E     None
  41.      Direct Con I/O    6      ASCII Char in E     I/O Status in A if E=0FFH
  42.      Get I/O Status    7      None                I/O Status in A
  43.      Put I/O Status    8      I/O Status in E     None
  44.      Print Buffer      9      Address of string   None
  45.                                terminated by $
  46.                                in DE
  47.      Read Buffer      10      Address of Read     Read Buffer is filled
  48.                                Buffer in DE
  49.      Console Ready    11      None                LSB of A is 1 if char
  50.                                                    ready
  51.      *All function numbers are passed in Reg C.
  52.  
  53.  
  54.      2«  BIOS Calls
  55.  
  56.      Function and Number      Input Parameters    Output Parameters
  57.  
  58.      Return Version # 12      None                Version Info in HL
  59.                                                   H=0 CP/M, H=1 MP/M
  60.                                                   L=00 CP/M 1.x, 2x 2.x
  61.      Init BDOS        13      None                None
  62.      Log-In Disk      14      Value in Reg E      None
  63.                                A=0, B=1, C=2,
  64.                                D=3
  65.      Open File        15      Address of FCB      Byte address of FCB
  66.                                in DE               if found or 0FFH if not
  67.      Close File       16      Address of FCB      Byte address of FCB
  68.                                in DE               if found or 0FFH if not
  69.      Search for File  17      Address of FCB      Byte address of FCB (0-3)
  70.                                in DE               if found or 0FFH if not
  71.      Search for Next  18      Address of FCB      Byte address of next FCB
  72.                                in DE               if found or 0FFH if not
  73.      Delete File      19      Address of FCB      Byte address of FCB (0-3)
  74.                                in DE               if found or 0FFH if not
  75.      Read Next Record 20      Address of FCB      0=successful read
  76.                                in DE              1=read past EOF
  77.                                                   2=reading random data
  78.      Write Next Rec   21      Address of FCB      0=successful write
  79.                                in DE              1=error in extending
  80.                                                   2=end of disk data
  81.                                                   255=no more dir space
  82.      Make File        22      Address of FCB      Byte address of FCB or
  83. è                               in DE               255 if no more dir space
  84.      Rename FCB       23      Address of FCB      Byte Address of Dir entry
  85.                                in DE               or 255 if no match
  86.      Return Log Code  24      None                Login vector in HL
  87.      Read Drive No    25      None                Number of logged-in drive
  88.                                                    (A=0, B=1, C=2, D=3)
  89.      Set DMA Address  26      Address of 128      None
  90.                               byte buffer in DE
  91.      Get Alloc Vect   27      None                Allocation  Vect Addr  in 
  92.                                                    HL
  93.      Write Prot Disk  28      None                None
  94.      Get R/O Vect     29      None                HL=R/O Vect Val
  95.      Set File Attrib  30      Ptr to FCB in DE    Dir code in A
  96.      Get Disk Parms   31      None                HL=DPB Address
  97.      Set/Get Usr Code 32      E=0FFH (get)/Code   A=Current code (get)/no
  98.                                (set)               value (set)
  99.      Read Random      33      DE=FCB addr         A=return code
  100.                                                   1=reading unwritten data
  101.                                                   2=(not used)
  102.                                                   3=can't close curr ext
  103.                                                   4=seek to unwritten ext
  104.                                                   5=(not used)
  105.                                                   6=seek past end of disk
  106.      Write Random     34      DE=FCB addr         A=return code
  107.                                                   1=reading unwritten data
  108.                                                   2=(not used)
  109.                                                   3=can't close curr ext
  110.                                                   4=seek to unwritten ext
  111.                                                   5=dir overflow
  112.                                                   6=seek past end of disk
  113.      Compute File Siz 35      DE=FCB addr         Random Rec Field set
  114.                                                    to file size
  115.      Set Random Rec   36      DE=FCB addr         Random Rec Field set
  116.  
  117.  
  118.      *All function numbers are passed in Reg C
  119.  
  120. .pa
  121. èB.  Reference for Standard CP/M Assembly-Language Tools
  122.  
  123.  
  124.      1.  ASM
  125.  
  126.      The ASM Command loads and executes the CP/M 8080 assembler.   It is of 
  127.      the form --
  128.  
  129.           ASM filename.xyz
  130.  
  131.      where
  132.  
  133.           filename  ... is the name of the file 'filename.ASM' to assemble
  134.           x         ... designates the disk name which contains the source
  135.           y         ... designates the disk name to contain the hex file
  136.                          (y=Z suppresses generation of the hex file)
  137.           z         ... designates the disk name to contain the print file
  138.                          (y=X lists on CON:, y=Z suppresses listing)
  139.  
  140.  
  141.      2.  LOAD
  142.  
  143. áááááThσá LOA─á CommanΣ read≤ thσ filσ specified¼á whicΦ i≤á assumeΣá t∩ ì
  144. ááááácontaiεá Inte∞ he° forma⌠ machinσ codσ anΣ produce≤ ß memor∙á imagσ ì
  145. áááááfilσá whicΦá caε bσ subsequentl∙ executeΣ (convert≤á .HE╪á t∩á .CO═ ì
  146. áááááfiles)«  I⌠ i≤ oµ thσ forφ --
  147.  
  148.           LOAD filename
  149.  
  150. áááááwherσ filenamσ i≤ thσ namσ oµ thσ filσ 'filename.HEX'.
  151.  
  152.  
  153.      3.  DDT
  154.  
  155.  
  156. áááááThσá  DD╘  Prograφ allow≤ dynamiπ interactivσ testinτ anΣ debugginτ  ì
  157. áááááoµ program≤ generateΣ iε thσ CP/═ environment«  I⌠ i≤ invokeΣ b∙ --
  158.  
  159.           DDT
  160.           DDT filename.HEX
  161.           DDT filename.COM
  162.  
  163.      where 'filename' is the name of the program to be loaded or tested.
  164.  
  165.      DDT responds to the normal CP/M input line editing characters.
  166.  
  167.      DDT responds to the following commands --
  168.  
  169.      As   Perform inline assembly starting at the specified address s.
  170.      D    Display memory from the current address for 16 display lines.
  171.      Ds   Display memory from address s for 16 display lines.
  172.      Ds,f Display memory from address s to address f.
  173.  
  174.      Fs,f,c
  175.           Fill memory from start address s to final address f with byte c.
  176. è
  177.      G    Start execution at the current value of the PC.
  178.      Gs   Start execution at the specified address s.
  179.      Gs,b Start execution  at the specified address s and set a  breakpoint 
  180.           at the address b.
  181.      Gs,b,c
  182.           Same as above with breakpoints at b and c.
  183.      G,b  Start execution at the current value of the PC with breakpoint b.
  184.      G,b,c
  185.           Same as above with breakpoints at b and c.
  186.  
  187.      If   Insert a file name f into the default FCB.
  188.  
  189.      L    List 12 lines of disassembled code from the current address.
  190.      Ls   List 12 lines from the specified address s.
  191.      Ls,f List lines of disassembled code from s to f.
  192.  
  193.      Ms,f,d
  194.           Move the block from address s to f to destination at address d.
  195.  
  196.      R    Read file in FCB into memory at 100H.
  197.      Rb   Read file in FCB into memory with offset b from 100H.
  198.  
  199.      Ss   Set (examine and alter) memory starting at address s.
  200.  
  201.      T    Trace the next instruction.
  202.      Tn   Trace the next n instructions.
  203.  
  204.      U    Untrace -- like Trace, but intermediate steps are not displayed.
  205.  
  206.      X    Examine all registers and flags.
  207.      Xr   Examine specified registers or flag, where r may be --
  208.                C    Carry flag
  209.                Z    Zero flag
  210.                M    Minus (sign) flag
  211.                I    Interdigit Carry flag
  212.                A    Accumulator
  213.                B    BC Reg pair
  214.                D    DE Reg pair
  215.                H    HL Reg pair
  216.                S    Stack pointer
  217.                P    PC
  218.  
  219.  
  220.      4.  MAC
  221.  
  222. áááááMA├á i≤ thσ CP/═ StandarΣ Macr∩ Assembler╗á i⌠ i≤ upward-compatablσ ì
  223. áááááwitΦá ASM¼á  thσ CP/═ StandarΣ Assembler«á   Thσ facilitie≤ oµá MA├ ì
  224. áááááincludσá assembl∙á oµá   Inte∞á   808░á  microcompute≥á  mnemonics¼   ì
  225. áááááalonτá   witΦ   assembly-timσ expressions¼á  conditiona∞á assembly¼  ì
  226. ááááápagσ formattinτ features¼  anΣ ß macr∩ processo≥  whicΦ  i≤  compaì
  227. ááááátablσá witΦá thσ standarΣ  Inte∞  definitioε  (MA├á implement≤á thσ ì
  228. ááááámid-197╖ revisioε oµ Intel'≤ definition).
  229.  
  230. .cp 6
  231. è     MAC is invoked by the following command --
  232.                          MAC d:filename $parms
  233. áááááOnl∙ 'filenameº i≤ required¼á anΣ i⌠ represent≤ ß filσ nameΣ 'fileì
  234. áááááname.ASM'«á  MA├á  ma∙  theε generatσ u≡ t∩ │ othe≥ file≤á -- fileì
  235. áááááname.HE╪ (thσ Inte∞  He° Forma⌠ File)¼á  filename.PR╬ (thσ Prin⌠ o≥ ì
  236. áááááListinτ file)¼á  anΣ  filename.SY═ (ß filσ containinτ ß sorteΣ lis⌠ ì
  237. áááááoµ thσ symbol≤ useΣ iε thσ program).
  238.  
  239. áááááMACR╧ Librar∙ file≤ ma∙ bσ referenceΣ b∙ thσ program╗á  thesσ file≤ ì
  240. áááááarσ nameΣ 'filename.LIB'.
  241.  
  242. ááááá$parm≤á  represent≤ thσ optiona∞ assembl∙ contro∞ parameter≤á whicΦ  ì
  243. áááááarσ discusseΣ iε thσ nex⌠ section.
  244.  
  245. áááááMA├á  ma∙á bσá executeΣ b∙ employinτá thσá SUBMI╘á  filσá  MAC.SUB«   ì
  246. áááááMAC.SU┬ assemble≤  thσ  specifieΣ MA├ .AS═ file¼á  convert≤ i⌠ int∩ ì
  247. áááááßá .CO═á filσá  viß LOAD¼á anΣ erase≤ thσ .HE╪á file«á  MAC.SU┬á i≤ ì
  248. áááááinvokeΣ b∙ --
  249.  
  250.           SUBMIT MAC filename
  251.  
  252. áááááwherσ 'filenameº i≤ thσ namσ oµ thσ MA├ filσ 'filename.ASM'.
  253.  
  254. áááááThσ contro∞ paramete≥ lis⌠ i≤ precedeΣ b∙ ß $¼  anΣ ma∙ contaiε an∙ ì
  255. áááááoµ thσ followinτ iε an∙ orde≥ --
  256.           A - controls the source disk for the .ASM file
  257.           H - controls the destination of the .HEX machine code file
  258.           L - controls the source disk for the .LIB files
  259.           M - controls MACRO listing in the .PRN file
  260.           P - controls the destination of the .PRN listing file
  261.           Q - controls the listing of LOCAL symbols
  262.           S - controls the generation and destination of the .SYM file
  263.           1 - controls pass 1 listing
  264.  
  265. áááááIε thσ casσ oµ thσ A¼á  H¼á L¼á P¼á anΣ ╙ parameters¼á the∙ ma∙á bσ ì
  266. áááááfolloweΣ b∙ thσ drivσ namσ froφ whicΦ t∩ obtaiε o≥ t∩ whicΦ t∩ senΣ ì
  267. ááááádata¼ wherσ --
  268.  
  269.           A,B,C,D -- designates that particular drive
  270.           P       -- designates the LST: device
  271.           X       -- designates the user console (CON:)
  272.           Z       -- designates a null file (no output)
  273.  
  274.      For example,
  275.           $PB AA HB SX
  276. ááááásend≤á  thσ .PR╬ filσ t∩ drivσ B:¼á  get≤ thσ .AS═ filσ froφá drivσ ì
  277. áááááA:¼á  send≤á thσ .HE╪ filσ t∩ drivσ B:¼á anΣ send≤ thσ .SY═ filσ t∩ ì
  278. áááááCON:.
  279.  
  280. áááááThσ parameter≤ L¼  S¼  M¼ Q¼ anΣ ▒ ma∙ bσ precedeΣ b∙ eithe≥ ½ o≥ - ì
  281. ááááát∩ enablσ o≥ disablσ thei≥ respectivσ function≤ --
  282.  
  283.      +L - list the input lines read from the MACRO library
  284.      -L - suppress listing of the MACRO library (default)
  285.  
  286. è     +S - append the .SYM output to the end of the .PRN file (default)
  287.      -S - suppress the generation of the sorted symbol table
  288.  
  289.      +M - list all MACRO lines as they are processed (default)
  290.      -M - suppress all MACRO lines as they are processed
  291.      *M - list only HEX code generated by macro expansions in listing
  292.  
  293.      +Q - list all LOCAL symbols in the symbol list
  294.      -Q - suppress all LOCAL symbols in the symbol list (default)
  295.  
  296.      +1 - produce a listing file on the first pass (for MACRO debugging)
  297.      -1 - suppress listing on pass 1 (default)
  298.  
  299. áááááThσá  programme≥á  caεá  interspersσá  control≤á  throughou⌠áá  thσ  ì
  300. áááááassembl∙ languagσ sourcσ o≥ librar∙ files«á   IntersperseΣ control≤ ì
  301. áááááarσá denoteΣá b∙  ß "$ó  iε  thσ  firs⌠  columε oµ thσá inpu⌠á linσ  ì
  302. áááááfolloweΣ  immediatel∙  b∙  ß parameter.
  303.  
  304.      The following Pseudo-Ops are supported --
  305.           DB        defines data bytes or strings of data
  306.           DS        reserves storage areas
  307.           DW        defines words of storage
  308.           ELSE      alternate to IF
  309.           END       terminates the physical program
  310.           ENDIF     marks the end of conditional assembly
  311.           ENDM      marks the end of a MACRO
  312.           EQU       performs a numeric "equate"
  313.           EXITM     abort expansion of the current MACRO level
  314.           IF        begins conditional assembly
  315.           IRP       INLINE MACRO with string substitution
  316.           IRPC      INLINE MACRO with character substitution
  317.           LOCAL     define LOCAL variables unique to each MACRO repetition
  318.           MACLIB    specify MACRO Library to load
  319.           MACRO     defines beginning of a MACRO
  320.           ORG       sets the program or data origin
  321.           PAGE      defines the listing page size for output
  322.           REPT      defines the beginning of a INLINE MACRO
  323.           SET       performs a numeric "set" or assignment
  324.           TITLE     enables page titles and options
  325.  
  326.  
  327. ááááá┬á  - Balancσ  error║á  MACR╧ doesn'⌠ terminatσ properl∙ o≥  condiì
  328. ááááátiona∞ assembly is ill-formed
  329. ááááá├á  - Commßá  error║áá   expressioεá  wa≤á  encountereΣá  bu⌠á  no⌠  ì
  330. ááááádelimiteΣ properly from the next item by a comma
  331. ááááá─á - Datσá error║á  elemen⌠ iε ß datß statemen⌠ (DB,DW⌐á canno⌠á bσ  ì
  332. áááááplaceΣ iε thσ specifieΣ datß area
  333.      E - Expression error:  expression is ill-formed and cannot be computed
  334.      I - Invalid character:  a non-graphic character has been found
  335.      L - Label error:  label cannot appear in this context
  336.      M - MACRO overflow error:  internal MACRO expansion table overflow
  337.      N - Not implemented error:  unimplemented feature used
  338. ááááá╧  - Overflo≈  error║á  expressioε i≤ to∩ complicateΣ o≥ thσ numbe≥  ì
  339. áááááoµ LOCA╠ label≤ ha≤ exceedeΣ 9999
  340. ááááá╨á  - Phasσá  error║á   label≤ doe≤ no⌠ havσ samσ valuσá  oεá  botΦ  ìèááááápasse≤ (multiplσ label)
  341. ááááá╥á - Registe≥ error║á  valuσ specifieΣ fo≥ ß registe≥ i≤ no⌠á  comì
  342. ááááápatablσ witΦ o≡ code
  343.      S - Statement/Syntax error:  statement is ill-formed
  344.      V - Value error:  operand is improperly formed or out of range
  345.  
  346.      Console Error Messages:
  347.  
  348.      NO SOURCE FILE PRESENT - .ASM file not found
  349.      NO DIRECTORY SPACE - Directory is full
  350. áááááSOURC┼á  FIL┼á NAM┼á ERRO╥ - Thσ forφ oµ thσ sourcσá filσá namσá i≤ ì
  351. áááááinvalid╗á notσ tha⌠ MA├ i≤ invokeΣ b∙ 'MA├ filename'¼  anΣ thσ .AS═ ì
  352. áááááfilσ typσ i≤  NO╘ specified.
  353.      SOURCE FILE READ ERROR - Error in reading source file
  354.      OUTPUT FILE WRITE ERROR - Error in writing output file
  355.      CANNOT CLOSE FILE - An output file cannot be closed.
  356.      UNBALANCED MACRO LIBRARY - No ENDM encountered for a MACRO definition
  357. áááááINVALI─á  PARAMETE╥ - InvaliΣ assembl∙ paramete≥ wa≤ founΣá iεá thσ ì
  358. áááááinpu⌠ line.
  359.  
  360.  
  361.      5.  LINK
  362.  
  363.      The format for the invocation of Linker is
  364.  
  365.  
  366.           LINK <filename1.ext/s,filename2.ext/s,....>
  367.  
  368.      where filename stands for Disk drive letter followed by a colon
  369.      followed by the absolute file name
  370.  
  371.             ext  is used if the module extension is different than .rel
  372.             
  373.             /s   stands for switch options.
  374.  
  375.      EXAMPLE of a link
  376.  
  377.      LINK MAIN,FORLIB/S,MAIN/N/G/E
  378.  
  379.       The first MAIN is the name of the module from the fortran compiler
  380.       The FORLIB/S  is the library of standard fortran routines that will
  381.            be selected
  382.       The MAIN/N/G/E  means to name the .COM file MAIN and to save it on
  383.            current disk then execute MAIN automatically.
  384.  
  385.                           SWITCH OPTIONS
  386.  
  387.     Each switch option is preceded by a /
  388.  
  389.     E ....  Exit to operating system
  390.     
  391.     G ....  Go   start execution
  392.           Start execution of the program as soon as the current command
  393.           line has been interpreted.
  394.  
  395. è    M ....  Map all symbols
  396.           List both all the defined globals and their values and all 
  397.           undefined globals followed by an asterisk.
  398.  
  399.     R ....  Reset the linker
  400.           Puts the linker back to its initial state.   the /R is used
  401.           to restart LINK if the wrong file was loaded by mistake.
  402.  
  403.     S ....  Search file
  404.           Search the disk file having the filename immediately preceding
  405.           the /S in the command string, to satisfy any undefined globals.
  406.           This is convenient for having the linker search a library file
  407.           of musch-used routines.
  408.  
  409.     U ....  List all undefined globals
  410.           List all undefined globals as soon as the current command line
  411.           has been interpreted and executed.  Link defaults to this 
  412.           switch; therefore it is generally not needed.
  413.  
  414.      ERROR MESSAGES:
  415.  
  416.      No start address       a /G is issued but no main program module
  417.                             has been loaded.
  418.  
  419.      Loading error          The file given is not a properly formatted
  420.                             link object file.
  421.  
  422.      Fatal Table Collision  There is not enough memory
  423.  
  424.      Command error          Unrecognizable link command
  425.  
  426.      File not found         Specified file not on specified disk
  427.  
  428.      mult def global        More than one definition of the global name
  429.                             (possibly wrong modules combined)
  430.  
  431.  
  432.      6.  SID
  433.  
  434.      Syntax:
  435.  
  436.           SID {pgm-filespec} {,sym-filespec}
  437.  
  438.      Explanation:
  439.  
  440. áááááThσá SI─ symboliπ debugge≥  allow≤  yo⌡  t∩   monito≥   anΣá   tes⌠ ì
  441. áááááprogram≤á  developeΣ  fo≥  thσ  808░ microprocessor«á  SI─ support≤ ì
  442. áááááreal-timσ  breakpoints¼á  full∙  monitoreΣ   execution¼á   symboliπ ì
  443. ááááádisassembly¼á  assembly¼á  anΣ  memor∙  displa∙ anΣ fil∞ functions«  ì
  444. áááááSI─á  caε  dynamicall∙  loaΣ  SI─  utilit∙  program≤  t∩á   providσ ì
  445. ááááátracebacδ anΣ histograφ facilities.
  446.  
  447. .cp 6
  448. è     Commands:
  449.  
  450.      Command              Meaning
  451.  
  452.      As              (Assemble)    Enter assembly language
  453.                                    statements
  454.                                    s is the start address
  455.  
  456.      Cs{b{,d}}       (Call)        Call to memory location from SID
  457.                                    s is the called address
  458.                                    b is the value of the BC register
  459.                                    pair d is the value of the DE
  460.                                    register pair
  461.  
  462.      D{W}{s}{,f}     (Display)     Display memory in hex and ASCII
  463.                                    W is a 16-bit word format
  464.                                    s is the start address
  465.                                    f is the finish address
  466.  
  467.      Epgm-filespec   (Load)        Load program and symbol table
  468.       {,sym-filespec}              for execution
  469.  
  470.  
  471.  
  472.      E*sym-filespec  (Load)        Load a symbol table file
  473.  
  474.      Fs,f,d          (Fill)        Fill memory with constant value
  475.                                    s is the start address
  476.                                    f is the finish address
  477.                                    d is an eight-bit data item
  478.  
  479.      G{p}{,a{,b}}     (Go)         Begin Execution
  480.                                    p is a start address
  481.                                    a is a temporary breakpoint
  482.  
  483.      H                (Hex)        Displays all symbols with
  484.                                    addresses in Hex
  485.      H.a                           Displays hex, decimal, and ASCII
  486.                                    values of a where
  487.                                    a is a symbolic expression
  488.  
  489.      Ha,b                          Computes hex sum and difference
  490.                                    of a and b where
  491.                                    a and b are symbolic expressions
  492.  
  493.      Icommand tail   (Input)       Input CCP command line
  494.  
  495.      L{s}{,f}        (List)        List 8080 mnemonic instructions
  496.                                    s is the start address
  497.                                    f is the finish address
  498.      Ms,h,d          (Move)        Move Memory Block
  499.                                    s is the start address
  500.                                    h is the high address of the block
  501.                                    d is the destination start address
  502.  
  503. è     P{p{,c}}        (Pass)        Pass point set, reset, and display
  504.                                    p is a permanent breakpoint address
  505.                                    c is initial value of pass counter
  506.  
  507.      Rfilespec{,d}   (Read)        Read Code/Symbols
  508.                                    d is an offset to each address
  509.  
  510.      S{W}s           (Set)         Set Memory Values
  511.                                    s is address where value is sent
  512.                                    W is 16 bit word
  513.  
  514.      T{n{,c}}        (Trace)       Trace Program Execution
  515.                                    n is the number of program steps
  516.                                    c is the utility entry address.
  517.  
  518.      T{W}{n{,c}}     (Trace)       Trace Without Call
  519.                                    W instructs SID not to trace
  520.                                    subroutines
  521.                                    n is the number of program steps
  522.                                    c is the utility entry address
  523.  
  524.      U{W}{n{,c}}     (Untrace)     Monitor Execution without Trace
  525.                                    n is the number of program steps
  526.                                    c is the utility entry address
  527.                                    W instructs SID not to trace
  528.                                    subroutines
  529.  
  530.      V                (Value)      Display the value of the next
  531.                                    available location in memory
  532.                                    (NEXT), the next location after
  533.                                    the largest file read in (MSZE),
  534.                                    the current value of the Program
  535.                                    counter (PC), and the address of
  536.                                    the end of available memory (END)
  537.  
  538.      Wfilespec,s,f  (Write)        Write the contents of a contiguous
  539.                                    block of memory to filespec.
  540.                                    f is finish address
  541.  
  542.      X{f}{r}        (Examine)      Examine/alter CPU state.
  543.                                    f is flag bit C,Z,M,E or I.
  544.                                    r is register A,B,D,H,S or P.
  545.  
  546. .pa
  547. èC.  Microsoft BASIC Reference
  548.  
  549. 1.  General Statements
  550.  
  551. Command   Syntax                        Function
  552. AUTO      AUTO [line][,inc]             Generate line numbers
  553. CLEAR     CLEAR [,[exp1][,exp2]]        Clear program variables;  Exp1 sets 
  554.                                         end  of memory and Exp2 sets amount 
  555.                                         of stack space
  556. CONT      CONT                          Continue program execution
  557. DELETE    DELETE [[start][-[end]]]      Delete program lines
  558. EDIT      EDIT line                     Edit a program line
  559.  
  560. FILES     FILES [filename]              Directory
  561. LIST      LIST [line[-[line]]]          List program line(s)
  562. LLIST     LLIST [line[-[line]]]         List program line(s) on printer
  563. LOAD      LOAD filename[,R]             Load program; ,R means RUN
  564. MERGE     MERGE filename                Merge prog on disk with that in mem
  565.  
  566. NAME      NAME old AS new               Change the name of a disk file
  567. NEW       NEW                           Delete current prog and vars
  568. NULL      NULL exp                      Set num of <NULL>s after each line
  569. RENUM     RENUM [[new][,[old][,inc]]]   Renumber program lines
  570. RESET     RESET                         Init CP/M; use after disk change
  571. RUN       RUN [line number]             Run a prog (from a particular line)
  572.           RUN filename[,R]              Run a prog on disk
  573. SAVE      SAVE filename[,A or ,P]       Save prog onto disk;  ,A saves prog 
  574.                                         in ASCII and ,P protects file
  575. SYSTEM    SYSTEM                        Return to CP/M
  576. TROFF     TROFF                         Turn trace off
  577. TRON      TRON                          Turn trace on
  578. WIDTH     WIDTH [LPRINT] exp            Set term or printer carriage width; 
  579.  
  580. 2.  Program Control Statements
  581.  
  582. CALL      CALL variable [(arg list)]    Call assembly or FORTRAN routine
  583. CHAIN     CHAIN [MERGE] filename [,[line exp][,ALL][,DELETE range]]
  584.                Call  a program and pass variables to it;  MERGE with  ASCII 
  585.                files allows overlays; start at line exp if given; ALL means 
  586.                all variables will be passed (otherwise COMMON only); DELETE 
  587.                allows deletion of an overlay before CHAIN is executed
  588. COMMON    COMMON list of vars           Pass vars to a CHAINed prog
  589. DEF       DEF FNx[(arg list)]=exp       Arith or String Function
  590.           DEF USRn=address              Define adr for nth assembly routine
  591.           DEFINT range(s) of letters    Define default var type INTeger
  592.           DEFSNG "        "   "         "         "     "   "   Single
  593.           DEFDBL "        "   "         "         "     "   "   Double
  594.           DEFSTR "        "   "         "         "     "   "   String
  595. DIM       DIM list of subscripted vars  Allocate arrays
  596.  
  597. END       END                           Stop prog and close files
  598. ERASE     ERASE var [,var ... ]         Release space and var names
  599. ERROR     ERROR code                    Generate error code/message
  600. FOR       FOR var=exp TO exp [STEP exp] FOR loop
  601. GOSUB     GOSUB line number             Call BASIC subroutine
  602. èGOTO      GOTO line number              Branch to specified line
  603. IF/GOTO   IF exp GOTO line [ELSE stmt ... ]
  604.                                         IF exp <> 0 then GOTO
  605. IF/THEN   IF exp THEN stmt[:stmt] [ELSE stmt ... ]
  606.                                         IF exp <> 0 then ... else ...
  607. LET       [LET] var=exp                 Assignment
  608.  
  609. MID$      MID$(string,n[,m])=string2    Replace  a  portion of string  with 
  610.                                         string2; start at pos n for m chars
  611. NEXT      NEXT var[,var ... ]           End FOR
  612. ON ERROR  ON ERROR GOTO line            Error trap subroutine
  613.   GOTO
  614. ON/GOSUB  ON exp GOSUB line[,line]      Computed GOSUB
  615. ON/GOTO   ON exp GOTO line[,line]       Computed GOTO
  616. OPTION    OPTION BASE n                 Min val for subscripts (n=0,1)
  617.   BASE
  618. OUT       OUT port,byte                 Output byte to port
  619. POKE      POKE address,byte             Memory put
  620. RANDOMIZE RANDOMIZE [exp]               Reseed random number generator
  621. REM       REM any text                  Remark -- comment
  622. RESTORE   RESTORE [line]                Reset DATA pointer
  623. RESUME    RESUME or RESUME 0            Return from ON ERROR GOTO
  624.           RESUME NEXT                   Return to stmt after error line
  625.           RESUME line                   Return to specified line
  626. RETURN    RETURN                        Return from subroutine
  627. STOP      STOP                          Stop prog and print BREAK msg
  628. WAIT      WAIT prot,mask[,select]       Pause until input port [XOR select] 
  629.                                         AND mask <> 0
  630. WHILE/    WHILE exp stmts ... WEND      Execute stmts as long as exp is T
  631.   WEND
  632.  
  633. 3.  Input - Output Statements
  634.  
  635. Statement Syntax/Function
  636. CLOSE     CLOSE [[#]f[,[#]f ... ]]
  637.            Close disk files; if no arg, close all
  638. DATA      DATA constant list  
  639.            List data for READ statement
  640. FIELD     FIELD [#]f,n AS string var [,n AS string var ...]
  641.            Define fields in random file buffer
  642. GET       GET [#]f[,record number]
  643.            Read a record from a random disk file
  644. INPUT     INPUT [;] [prompt string;] var [,var ...]
  645.           INPUT [;] [prompt string,] var [,var ...]
  646.            Read  data from the terminal;  leading semicolon suppresses echo 
  647.            of  <CR>/<LF> and semicolon after prompt string causes  question 
  648.            mark  after prompt while comma after prompt suppresses  question 
  649.            mark
  650. KILL      KILL filename
  651.            Delete a disk file
  652. LINE      LINE INPUT [;] [prompt string;] string var
  653. INPUT      Read an entire line from terminal;  leading semicolon suppresses 
  654.            echo of <CR>/<LF>
  655.           LINE INPUT #f,string var
  656.            Read an entire line from a disk file
  657. èLSET      LSET field var=string exp
  658.            Store data in random file buffer left-justified or  left-justify 
  659.            a non-disk string in a given field
  660. OPEN      OPEN mode,[#] f,filename
  661.            Open a disk file; mode must be one of --
  662.                I = sequential input file
  663.                O = sequential output file
  664.                R = random input/output file
  665. PRINT     PRINT [USING format string;] exp [,exp ...]
  666.            Print data at the terminal using the format specified
  667.           PRINT #f, [USING format string;] exp [,exp ...]
  668.            Write data to a disk file
  669.           LPRINT [USING format string;] var [,var ...]
  670.            Write data to a line printer
  671. PUT       PUT [#] f [,record number]
  672.            Write data from a random buffer to a data file
  673. READ      READ var [,var ...]
  674.            Read data from a DATA statement into the specified vars
  675. RSET      RSET field var = string exp
  676.            Store  data  in  a random file buffer right justified  or  right 
  677.            justify a non-disk string in a given field
  678. WRITE     WRITE [list of exps]
  679.            Output data to the terminal
  680.           WRITE #f, list of exps
  681.            Output data to a sequential file or a random field buffer
  682.  
  683. 4.  Mathematica∞ Functions
  684.  
  685. Function       Action
  686.  
  687. ABS(exp)       Absolute value of expression
  688. ATN(exp)       Arctangent of expression (in radians)
  689. CDBL(exp)      Convert the expression to a double precision number
  690. CINT(exp)      Convert the expression to an integer
  691. COS(exp)       Cosine of the expression (in radians)
  692. CSNG(exp)      Convert the expression to a single precision number
  693. EXP(exp)       Raises the constant E to the power of the expression
  694. FIX(exp)       Returns truncated integer of expression
  695. FRE(exp)       Gives memory free space not used by MBASIC
  696. INT(exp)       Evaluates the expression for the largest integer
  697. LOG(exp)       Gives the natural log of the expression
  698. RND[(exp)]     Generates a random number
  699.                  exp <0 seeds new sequence
  700.                  exp =0 returns previous number
  701.                  exp >0 or omitted returns new random number
  702. SGN(exp)       1 if exp >0
  703.                0 if exp =0
  704.                -1 if exp <0
  705. SIN(exp)       Sine of the expression (in radians)
  706. SQR(exp)       Square root of expression
  707. TAN(exp)       Tangent of the expression (in radians)
  708.  
  709. .cp 6
  710. è5«  Strinτ Functions
  711.  
  712. ASC(str)       Returns ASCII value of first char in string
  713. CHR$(exp)      Returns a 1-char string whose char has ASCII code of exp
  714. FRE(str)       Returns remaining memory free space
  715. HEX$(exp)      Converts a number to a hexadecimal string
  716. INPUT$(length [,[#]f])
  717.                Returns a string of length chars read from console or from a 
  718.                disk file; characters are not echoed
  719.  
  720. INSTR([exp,]str1,str2)
  721.                Returns  the first position of the first occurrence of  str2 
  722.                in str1 starting at position exp
  723. LEFT$(str,len) Returns leftmost length chars of the string expression
  724. LEN(str)       Returns the length of a string
  725. MID$(string,start[,length])
  726.                Returns chars from the middle of the string starting at  the 
  727.                position  specified  to the end of the string or for  length 
  728.                characters
  729. OCT$(exp)      Converts an expression to an Octal string
  730. RIGHT$(str,len)
  731.                Returns rightmost length chars of the string expression
  732. SPACE$(exp)    Returns a string of exp spaces
  733. STR$(exp)      Converts a numeric expression to a string
  734. STRING$(length,str)
  735.                Returns  a string length long containing the first  char  of 
  736.                the str
  737. STRING$(length,exp)
  738.                Returns  a string length long containing chars with  numeric 
  739.                value exp
  740. VAL(str)       Converts  the  string  representation of  a  number  to  its 
  741.                numeric value
  742.  
  743. 6«  Othe≥ Functions
  744.  
  745. Function       Action
  746. CVI(str)       Converts a 2-char string to an integer
  747. CVS(str)       Converts a 4-char string to a single precision number
  748. CVD(str)       Converts an 8-char string to a double precision number
  749. EOF(f)         Returns TRUE (-1) if file is positioned at its end
  750. ERL            Error Line Number
  751. ERR            Error Code Number
  752. INP(port)      Inputs a byte from an input port
  753. LOC(f)         Returns next record number to read or write (random file) or 
  754.                number of sectors read or written (sequential file)
  755. LPOS(n)        Returns carriage position of line printer (n is dummy)
  756. MKI$(value)    Converts an integer to a 2-char string
  757. MKS$(value)    Converts a single precision values to a 4-char string
  758. MKD$(value)    Converts a double precision value to an 8-char string
  759. PEEK(exp)      Reads a byte from memory location specified by exp
  760. POS(n)         Returns carriage position of terminal (n is dummy)
  761. SPC(exp)       Used in PRINT statements to print spaces
  762. TAB(exp)       Used in PRINT statements to tab to specified position
  763. èUSR[n](arg)    Calls the user's machine language subroutine with the arg
  764. VARPTR(var)    Returns address of var in memory or zero if var has not been 
  765.                assigned a value
  766. VARPTR(#f)     Returns the address of the disk I/O buffer assigned to  file 
  767.                number
  768.  
  769. .pa
  770. è