home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / ASM / A86A.ZIP / DEMO.DOC < prev    next >
Encoding:
Text File  |  1986-06-22  |  4.9 KB  |  101 lines

  1. ---DEMO.DOC---
  2.  
  3. Demonstration of A86 and Associated Tools
  4.  
  5. To give you a feeling for the operation of A86, I have provided some source
  6. files for you to assemble.  You should print out this DEMO.DOC file, make
  7. sure your current directory is the one that contains this assembler package,
  8. and perform the following operations to see the assembler package in action:
  9.  
  10.  
  11. Assembling a Very Short Program: PAGE.COM
  12.  
  13. First, let's assemble a very short program; a program that sends an ASCII
  14. form-feed (hex 0C) to your line-printer.  The source for this program is
  15. PAGE.8; type the command TYPE PAGE.8 to see how simple this program is:
  16. note the lack of red-tape directives (NAME, ASSUME, END, PUBLIC, etc.)
  17. required by other assemblers.  Now type the command A86 PAGE.8 to assemble
  18. the file.  If you are working on a hard disk, make sure you don't blink your
  19. eyes after typing the command; you'll miss the assembly, because A86 is
  20. FAST, FAST, FAST.
  21.  
  22. You now have a file PAGE.COM, which is an executable program.  If you now
  23. type the command PAGE with your printer turned on, and if your printer
  24. recognizes the form-feed character, then it should advance to the next page.
  25. You have just created a useful tool.  By altering the DB line in the source-
  26. code that contains the form-feed, you can create tools to output other
  27. control-sequences to your printer.
  28.  
  29.  
  30. Demostration of Error-Reporting
  31.  
  32. Now type the command ERDEMO, invoking the batch file ERDEMO.BAT.  This will
  33. invoke an assembly of a source file PAGE.BAD, into which I have deliberately
  34. placed an erroneous statement, XCHG BL,AX.  Note that A86 tells you that it
  35. has inserted error messages into PAGE.BAD.
  36.  
  37. Now use your favorite text editor to edit PAGE.BAD.  You can use your editor's
  38. string-search function to find a tilde-symbol, which brackets all A86 error
  39. messages.  Without altering the messages, change the BL to BX, and exit your
  40. editor.  Now type the command A86 PAGE.BAD to reassemble the file.  You
  41. should get a successful assembly.  Now type the command TYPE PAGE.BAD, and note
  42. that A86 has removed the error messages for you.  Wasn't that easy?
  43.  
  44.  
  45. Assembling a Longer Program with Two Source Files: REV.COM
  46.  
  47. Now, let's see A86 assemble a program with two source files. I have provided
  48. a batch file for assembling this program, MAKREV.BAT.  You simply type the
  49. command MAKREV, and A86 will assemble the two source files REV.8 and ZLINES.8
  50. into the program REV.COM.
  51.  
  52. REV is a tool that exists in the Unix operating system.  It is a "filter";
  53. that is, it reads from standard input, transforms the input, and outputs
  54. the transformed data to standard output.  The transformation that REV performs
  55. is to reverse all lines, so that they come out backwards.
  56.  
  57. The usefulness of REV is in conjunction with other tools. In particluar,
  58. suppose you have a list of words that you wanted sorted according to their
  59. last letters, not their first.  You run the list through REV, to get the words
  60. spelled backwards.  Then you run that output through SORT, to sort them that
  61. way.  Finally, you run the output of SORT through REV again, to get the words
  62. spelled forwards again, but still sorted according to their backwards-spellings.
  63.  
  64. The normal usage of REV is, therefore, in conjunction with redirection of
  65. standard input and output; e.g. REV <infile >outfile.  If you want to just
  66. see if REV works, type REV, the enter key, your first name, the enter key,
  67. your last name, the enter key, the F6 key, and the enter key.  You'll get
  68. your first and last name spelled backwards.
  69.  
  70.  
  71. Using XREF on a medium-sized program: TCOLS.COM
  72.  
  73. Now type the command MTCOLS to execute the batch file MTCOLS.BAT.  Observe that
  74. the file assembles the file TCOLS.8 into the program TCOLS.COM.  Then the
  75. batch-file runs the XREF program, to produce a cross-reference listing
  76. TCOLS.XRF of the program.
  77.  
  78. Now type the command TCOLS.  The TCOLS program you just assembled will
  79. execute, notice that you have given it no parameters, and thus give you a
  80. self-documenting message.  Note that towards the end of the message is an
  81. example showing how TCOLS can be used to print XREF listings.  You can do
  82. so now by turning your printer on and typing an appropriate command; e.g.,
  83. TCOLS <TCOLS.XRF >PRN 4 6 80 66 for 4 columns, skip 6 lines between pages,
  84. which are 80 columns by 66 lines.
  85.  
  86.  
  87. Using EXMAC
  88.  
  89. Now type the command EXMAC TCOLS <TCOLS.8 >TCOLS.EXP to create a version
  90. of TCOLS with macros expanded.  Look at the file TCOLS.EXP, and note that
  91. the DEFAULT macro defined there has had all of its calls expanded.  Type
  92. the command A86 TCOLS.EXP and note that it assembles into TCOLS.COM just as
  93. the original file does.
  94.  
  95. Now type the command EXMAC TCOLS to enter interactive-mode.  The program
  96. pauses, waiting for you to type in lines.  Type a garbage line, e.g. "abc",
  97. and see the line echoed back to you.  Now type the macro-call:
  98. DEFAULT FOO,7 and see the macro expanded interactively.  Type F6 followed by
  99. the enter key to exit the EXMAC program.
  100.  
  101.