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