home *** CD-ROM | disk | FTP | other *** search
- ---DEMO.DOC---
-
- Demonstration of A86 and Associated Tools
-
- To give you a feeling for the operation of A86, I have provided some source
- files for you to assemble. You should print out this DEMO.DOC file, make
- sure your current directory is the one that contains this assembler package,
- and perform the following operations to see the assembler package in action:
-
-
- Assembling a Very Short Program: PAGE.COM
-
- First, let's assemble a very short program; a program that sends an ASCII
- form-feed (hex 0C) to your line-printer. The source for this program is
- PAGE.8; type the command TYPE PAGE.8 to see how simple this program is:
- note the lack of red-tape directives (NAME, ASSUME, END, PUBLIC, etc.)
- required by other assemblers. Now type the command A86 PAGE.8 to assemble
- the file. If you are working on a hard disk, make sure you don't blink your
- eyes after typing the command; you'll miss the assembly, because A86 is
- FAST, FAST, FAST.
-
- You now have a file PAGE.COM, which is an executable program. If you now
- type the command PAGE with your printer turned on, and if your printer
- recognizes the form-feed character, then it should advance to the next page.
- You have just created a useful tool. By altering the DB line in the source-
- code that contains the form-feed, you can create tools to output other
- control-sequences to your printer.
-
-
- Demostration of Error-Reporting
-
- Now type the command ERDEMO, invoking the batch file ERDEMO.BAT. This will
- invoke an assembly of a source file PAGE.BAD, into which I have deliberately
- placed an erroneous statement, XCHG BL,AX. Note that A86 tells you that it
- has inserted error messages into PAGE.BAD.
-
- Now use your favorite text editor to edit PAGE.BAD. You can use your editor's
- string-search function to find a tilde-symbol, which brackets all A86 error
- messages. Without altering the messages, change the BL to BX, and exit your
- editor. Now type the command A86 PAGE.BAD to reassemble the file. You
- should get a successful assembly. Now type the command TYPE PAGE.BAD, and note
- that A86 has removed the error messages for you. Wasn't that easy?
-
-
- Assembling a Longer Program with Two Source Files: REV.COM
-
- Now, let's see A86 assemble a program with two source files. I have provided
- a batch file for assembling this program, MAKREV.BAT. You simply type the
- command MAKREV, and A86 will assemble the two source files REV.8 and ZLINES.8
- into the program REV.COM.
-
- REV is a tool that exists in the Unix operating system. It is a "filter";
- that is, it reads from standard input, transforms the input, and outputs
- the transformed data to standard output. The transformation that REV performs
- is to reverse all lines, so that they come out backwards.
-
- The usefulness of REV is in conjunction with other tools. In particluar,
- suppose you have a list of words that you wanted sorted according to their
- last letters, not their first. You run the list through REV, to get the words
- spelled backwards. Then you run that output through SORT, to sort them that
- way. Finally, you run the output of SORT through REV again, to get the words
- spelled forwards again, but still sorted according to their backwards-spellings.
-
- The normal usage of REV is, therefore, in conjunction with redirection of
- standard input and output; e.g. REV <infile >outfile. If you want to just
- see if REV works, type REV, the enter key, your first name, the enter key,
- your last name, the enter key, the F6 key, and the enter key. You'll get
- your first and last name spelled backwards.
-
-
- Using XREF on a medium-sized program: TCOLS.COM
-
- Now type the command MTCOLS to execute the batch file MTCOLS.BAT. Observe that
- the file assembles the file TCOLS.8 into the program TCOLS.COM. Then the
- batch-file runs the XREF program, to produce a cross-reference listing
- TCOLS.XRF of the program.
-
- Now type the command TCOLS. The TCOLS program you just assembled will
- execute, notice that you have given it no parameters, and thus give you a
- self-documenting message. Note that towards the end of the message is an
- example showing how TCOLS can be used to print XREF listings. You can do
- so now by turning your printer on and typing an appropriate command; e.g.,
- TCOLS <TCOLS.XRF >PRN 4 6 80 66 for 4 columns, skip 6 lines between pages,
- which are 80 columns by 66 lines.
-
-
- Using EXMAC
-
- Now type the command EXMAC TCOLS <TCOLS.8 >TCOLS.EXP to create a version
- of TCOLS with macros expanded. Look at the file TCOLS.EXP, and note that
- the DEFAULT macro defined there has had all of its calls expanded. Type
- the command A86 TCOLS.EXP and note that it assembles into TCOLS.COM just as
- the original file does.
-
- Now type the command EXMAC TCOLS to enter interactive-mode. The program
- pauses, waiting for you to type in lines. Type a garbage line, e.g. "abc",
- and see the line echoed back to you. Now type the macro-call:
- DEFAULT FOO,7 and see the macro expanded interactively. Type F6 followed by
- the enter key to exit the EXMAC program.
-