¡ENB ACCEL3 1 EDIT EXEC2 FC (t Southern Software England BAL80'c Balcode Softw-w EMUCU SuperStep c Allen Gelrlei Soft»,

¡ENB ACCEL3 1 EDIT EXEC2 FC (t Southern Software England BAL80'c Balcode Softw-w EMUCU SuperStep c Allen Gelrlei Soft»,

Box 11721 San Francisco, CA 94101 (415) 681-S

Box 11721 San Francisco, CA 94101 (415) 681-S

and EDAS will substitute defaults for only the missing parameters (example 9) and fill the screen with graphics blocks. The missing #START and #COUNT parameters get substituted for by the defaults of 3C00H and 1024, respectively.

Advanced Features

Now that you have the basic idea of macros, let's look briefly at some of the more advanced things EDAS IV macros can do.

If you are very astute, you may be wondering what happens if a line in a macro includes a label. Since the macro code is generated every time the macro is called, a label would be multiply-defined, resulting in assembly-time errors.

EDAS IV gets around this problem in the following manner. If your labels include the character "?", EDAS will substitute a different character for '?' every time it expands the macro. Suppose your macro definition contains a line with a label like example 10. The first time you invoke the macro, EDAS will generate the label "LABELA"; the second time, "LABELB"; and so forth, cycling from A to Z, then AA to AZ, all the way to ZZ — a total of 702 different labels. If you need more than this, the *PREFIX command lets you tell EDAS to put another character in the expansion of'?'. *PREFIX '$', for example, would cause the first expansion of "LABEL?" to be "LABEL$A".

EDAS IV includes a series of macro comands that provide conditional assembly capability. Conditional assembly operators are a series of IF statements: IFEQ tests whether its operands are equal; IFGT tests if the first is greater than the second, etc. If the result of the test is true, all the code up to the next ELSE or matching ENDIF statement will be assembled. If the test is false, the corresponding code is skipped. If there is a matching ELSE, the code between the ELSE and the matching ENDIF is assembled.

Suppose that we don't want to allow the #COIJNT parameter to have a value greater than 1024. We could code this test in our LDB macro as in example 11. Now, if LDB is invoked with a value or more than 1024 for #COUNT, the IFGT test will be true and the ERR statement assembled, forcing an assembly-time error and printing the error message.

Examples of the use of conditional assembly include testing for errors, generating different code for different machines (e.g., Model I versus Model III), or generating different code based on different values of the macro parameters.

EDAS IV has these additional advanced features: There are IF statements to compare strings as well as numbers. IFDEF and IFREF test if their operands are defined or referenced in your program. IF,ELSE, and ENDIF can be nested up to 16 levels deep. The number of arguments in a macro call and the length of any argument can be determined. LORG sets the load origin different from the assembly origin. New expression operators .NOT., .NE., and .EQ. are included. One restriction is that macros cannot be recursive.

One of the most powerful features of EDAS IV is the *SEARCH command. To take full advantage of *SEARCH, you need the MISOSYS PDS (partitioned 46 Basic Computing

Example 1

Was this article helpful?

0 0

Post a comment