Comparison of Commercially Available Software Tools ... - IEEE Xplore

2 downloads 816 Views 1MB Size Report
dso evaluate the software tools available for that microprocessor. This paper describes the various kinds of software support tods that are commercially available ...
PROCEEDINGS O F THE IEEE, VOL. 64, NO. 6, JUNE 1976

910

Comparison of Commercially Available Software Tools for Microprocessor Programming IRENE M. WATSON

Aktmct-The software tools used to develop a microwmputer-bad This problem could also be expressed in the form of a strucproduct can have a substantial effect on the developmentcosts, develop- tured flowchart as follows: ment time cyde, and reliability of that product. The power and the appropriateness of the commercially available softwue tools for pro-t w e w r i t e rI I n i t i a l i z e 1 gramming microprocessors vary significantly. Hence, m addition to f o r e for v e r a particular at I enluating theappropriateness of a microprocessor product,thesystemsdesignermust dso evaluatethesoftware tools This paperdescribes the various availableforthatmicroprocessor. kinds of software support tods that are commercially available for a c hoianruwnt t i l f null I programming micro-asors The functions and features of the tool co on n tt rr o o llcchhaarr i n puuttcc h h aa rra ac of editors, assemblers andcomplers, loaders, simulators, and &buggers are discussed.Tdeoffs between cIosscomputexand resident I .\ True Fa 1s.Ise M itemized list of assemblerfeatures tods are presented.Finally, which support good program design is presented and six commercially E x e ccuot ne t r o l Save t ceih xna tr buffer function availablemicroprocessorassemblers (Fairchild’s F8 assembler, Intel’s 8080 assembler,Motorola’s 6800 assembler,National’s IMP-I6 assembler, Rockwell’s PPSB Psaembler,and Signetics’ 2650 assembler) This second method gives a more graphic representation of the are compared on the extent to which they provide these features. structure of the program. However, either of the previous two less desirable arpoaches is equally.acceptable.Athirdand

A

catem

INTRODUCTION methodistheconventionalflowchartapproach.The same N well-designed microcomputer systems the hardware and problem in this form looks like: software engineers worktogetherontheprojectfrom Initialize specification to final product. After all the tradeoffs are Typewriter Start considered, they together decide which portion of the product n p u t rorn will be implemented in hardware and which in software. It is keyboard then the job of the software engineer (programmer) to produce Start asequence of binary 0’s and 1’s in thecomputermemory, known as the computer program, which implements the software portion of the product. Software tools are the specialpurpose computer programs which the software engineer can use to facilitate the development of the product software. E x e c u t ec o n t r o l It is possible to develop productsoftwarewithout using software tools. However, it is rarely practical to do this.In fact the quality, cost, and development time cycle of the entire product is directly related to the appropriateness of the software tools used to develop the software. This is especially The primary problem with the conventional flowchart approach true since in most microcomputer applications, software development accounts for 50-80 percent of total development is that it gives the programmer too much flexibility, whereas costs. The steps involved in transforming a written specifica- in the high-level language and structured flowcharting methods the programmer is limited to control structures which have a tion into a computerprogram are as follows. 1) Using a topdown approach, the programmer designs a greater probability of working correctly and which force the design phase of the few fairly abstract statements which define the entire problem. designer t o putmorethoughtintothe project where it has a greater payoff ( a s compared tothe These statements can be expressed in the form of an existing, or a made-up,well-structured high-level programming language. testing phase). 2) The programmer must now progressively elaborate each For example, if a programmer wanted to design an intelligent of theabstractionsintheprogram(such as the “Initialize typewriter helshe might write: typewriter” statement or the “Execute control function” l n i t i a l i z ct y p c w r i t c r statement) until the entire program has been reduced to the Repeatforever particular instructions of the selected microcomputer in the Inputfromthekeyboard u n t i li n p u tc h a r a c t e r f null form of binary 0’s and 1’s. I f i n p u tc h a r is ac o n t r o lc h a r a c t e rt h e n Since the entiredevelopment process fromthe high-level e x e c u t ec o n t r o fl u n c t i o n abstractions to the binary 0’s and 1’s is one of translation from E l s es a v ei n p u tc h a r i n t e x tb u f f e r onerepresentation to another,the most significantway to cut development costs and time and improve product reliability End r e p e a t is to have as much of this translation done by a computer as Manuscript received December 15, 1975;rwised J a n u a r y 20, 1976. possible. Compilers and assemblers are software tools which perform part of this translation function. The author is at 27055 Moody Rd., Los Altos Hills, CA 94022.

II

U

I

WATSON: COMMERCIALLY AVAILABLE SOFTWARE TOOLS

91 1

and software, since software development is not dependent on hardware. the availability of the product or the prototyping SOURCE PROGRAM translation PROGWHOBJECT Such cross-computer tools are commercially available on a of timesharing The input to the compiler orassembler program is known as royalty charge per use basis fromanumber service companies. Many of these services are nationally availa source program. The output is the binary form of the proable; for instance, National CSS, United Computing Service, gram known as the objectprogram.Each of theseprogram forms is a language (since it contains certain rules of syntax, a General Electric Timesharing, and Tymshare, Inc. In order to As- use one of the services, the user must open an account with predefinedcharacter set, andapredefinedvocabulary). semblers translateprograms from assembly language to machine the timesharing company. Charges are then accrued to this aclanguage. Compilers translate programs from compiler or high- count each time the user connects to the service’s computer (generally via a telephone line from a remote terminal such as level language t o machine language. Theessentialdifference between assembly language and compiler a or high-level a Teletype machine) correctly identifying the account number andpassword. Charges are based on the length of time the language is that less elaboration of abstractions (as defined in user is connected to the service and the particular computer step 2 above) is required to reduce a program from specificaresources used; for example, CPU time, 1 / 0 operations pertion to a compiler or high-level language than to an assembly use of surchargeprolanguage. (Which means that a greater portion of the transla- formed,amount of storageused,and grams. Total charges typically run between 20 and 35 dollars tion process is done by a computer when you use a compiler for each connect hour. Microprocessor manufacturers and versus an assembler.) In an assembly-language program there is various software vendors have made their software tools availgenerally a one-to-one correspondence between the number of able on these timesharing services. Each time a user runs one computerinstructionstatementsinthesource programand the number of instructions in the object program. In a com- of these programs, a surcharge, generally based on the amount piler or high-levellanguage the ratio is typically one source- of CPU time used by the tool, is added to the user’s account. program instruction statement perfive to ten machine-language This surcharge is then returned by the timesharing company the timeto the tool developer(insome cases thismaybe instructions.Therefore,writing program a in compiler a sharing company itself). language is about five to tentimes faster than writingthe same Crosscomputertools, also, areoften available fromthe program in assembly language. microprocessor manufacturers andvarioussoftwarevendors The present paper categorizes the various kinds of software tools on the market and then takesa closer look at one of for purchase. Most of these tools are written in Fortran and these categories, assemblers, with a discussion of what features some are available in both large computer and minicomputer are needed in an assembler for it to support goodprogram de- versions. Thismeans the systemsdeveloper can payaone own timepurchasepriceand thenrunthetoolsonhis/her six popularmicroprosign. Comparisonsaremadebetween cessor assemblers (Fairchild’s F8 assembler, Intel’s 8080 in-house computer. He/she can also use a timesharing service with a copy of the tools in his/her own account area, thereby assembler, Motorola’s 6800 assembler, National’s IMP-16 used. assembler, Rockwell’s PPS-8 assembler,and Signetics’ 2650 accruing no surcharge each time the tools are is resident programs. These The other class of software tools assembler)with an indication of which of thesefeatures tools are programs which run on the microprocessor for which are provided. The category ofassemblerswas selected for availsoftware is being developed.Generally,thesetoolsare comparison since assemblers are the most universally available able for purchase from the microprocessor manufacturers as software support products on the market.Fewmicroprocespart of a total hardwaresoftware development system. (See sors have a compiler available, some do not have a simulator, Eugene Fisher’s paper on microprocessorprototyping systems.) but virtually all have an assembler. Many of thesetoolscan alsobe purchasedfromsoftware vendors or prototyping-system vendors other than the microCROSS-COMPUTERAND RESIDENTSOFTWARE TOOLS processor manufacturers. In order to run these programs, the systemdevelopermusteitherpurchase or develop a microThere are essentially five main categories of software tools: cases, the developer 1) editors, 2) translators (assemblers and compilers), 3) loaders, computerprototyping system.Insome may run these programs on the product hardwareprovided 4) simulators, and 5) debuggers. Each of these tool categories that the hardware configuration required by the tool is availfacilitatessome stage of the programdevelopment process. inputandoutput devices Editor programs facilitate the creation of the source program. able. (Thisincludesappropriate Translator programs create the object program from the source and sufficient memory space.) The tradeoffs between using cross-computer versus residentprogram. Loader programs transfer the object program from some external medium, such as a paper tape, into the micro- software tools are as follows: computer memory. Simulator programs make possible a subcross computersare generally fastermachines than the stantial portion of the testing of an object program when the microprocessors for which they produce programs; microcomputer is unavailable.Debugger programsfacilitate the initialcosts to use the cross-computer tools are usually the testing of an object program on the microcomputer. lower; All of these categories of tools are divided into two classes: the overall costs to use crosscomputer tools are usually 1) crosscomputer tools and 2) resident tools. Cross-computer higher; tools are programs which run on some computer other than the cross-computer method is generally more convenient, the microcomputer for which software is being developed. For since the peripherals are generally faster, and if the cross example, an assembler program itself could be written in the computer is a timesharing system, several programmers language of the IBM 370. However, the object-program outcan be using the system at one time; put by the assembler could be in the language of the 2650. the cross-computer method requires that the programThe availability of such cross-computer tools makes possible mer($learn two computer systems versus one for the thesimultaneousdevelopment of microcomputerhardware resident-tool approach. o u t p upt r o g r a m

1

readable

L

I

i n machine

I

912

PROCEEDINGS OF THE IEEE, JUNE 1976

CATEGORIES OF SOFTWARE TOOLS 1) Editors are programs which facilitate the development of source programs. Many microprocessors have a resident editor available. However, veryfew have a crosscomputereditor. The reason specific cross-computer editors for microprocessors are not provided is that the varioustimesharing services all provide general-purpose editor programs which can be used to generate source programs in any language. An editor program takes the source program entered into the computer, usually through a keyboard, but sometimes from a paper tape, and writesa “fide”of the program onthecomputer auxiliary memory,such as a disk or magnetic tape.Theeditor also acts on specialcommandsfromthe user to add,delete, or replace portions of the sourceprogramin the auxiliary memory. Editor programs operate on the source program as a text with no knowledge of the rules of syntax that apply to the product program. Editors vary significantly in the power they provide to makeprogram changes. For example,some editors can only operate on entire lines in a program, whereas othereditors can add,delete, or replacearbitrarycharacter stringsin the program.Sometimesharing services provide is that the less powerful more than one editor. The tradeoff editors are usually easier to learn to use. 2) Compilersand assemblers translatesourceprograms to object programs. Additionally, theyprint aprogram listing which displays side by side the source and object versions of the program,and lists error messages and other kinds of diagnosticinformation.Compilersand assemblers may be cross-computer or resident programs. The next section of this paper will discuss assemblers in detail. 3) Loaders are programs which transfer the object program from someexternalmedium,such as papertape or a data line, to the microcomputer RAM memory. This function of a loader program must be executed on the microcomputer for which the software is being developed. Loaders can also have thefunctions of 1)convertingarelocatable version ofthe object program to a loadable version and 2) establishing the linkages betweenobjectprogramswithreferences to each other,which is calledlinkage editing.Ineither of these cases the loader makes changes in the object program based on controlinformation passed to the loader bothfromthe language translator (assembler or compiler) and directly from the programmer. For example, a program might be assembled to reside inthemicrocomputermemorystartingat address zero. If the object program is relocatable, the programmer can specify the new base address of the program to the loader and theloaderprogram will modify all of the addressesin the object program accordingly. The relocation function requires a compiler or assembler capable of generatingarelocatable object program and a loader capable of performing the relocation.Thelinkageeditingfunctionrequiresbothacompiler or assembler and a loader which can communicate the appropriate linkage information. The relocation and linkageediting portions of a loader can be cross-computer or resident functions. 4) Simulators are crosscomputer programs which allow the user to test the object program when the microcomputer is unavailable. Inaddition,simulatorsoftenprovidecertain kinds of diagnosticinformationthat are unavailablewhen running on the microcomputerwitha debugger, such as a processor-stack overflowindicationor an indication of the program attempting to write into ROM memory. The simulator program, under direction from the user,simulates the

execution of theobjectprogramonthemicrocomputer. Simulators usuallyallow 1) manipulation and display of the simulated microcomputer memory and CPU registers; 2) breakpoints where processing can be stopped based on reaching a certain program address or based on the program’s reading or writing into a certain memory location;and, 3) tracing, whichcauses eachinstructionin the traceaddressrange to be printed out asit is executed.Simulators often provide timing information such as the number of instructions and/or machinecyclesexecuted from program starttostop.The power of simulators varies from manufacturer to manufacturer; however, nomatterhowgood asimulator is, it cannever completelyreplaceprogramtesting onthe microcomputer itself. This is because the specific timing and external environmental conditions of the microcomputer hardware can never be completely simulated. 5) Debuggers areresidentprograms which facilitate the testing of the objectprogram on the microcomputer.They usually accept commands from the userto perform the following functions: display or print out the contentsof the microcomputer ROM or RAM memory or thecontents of the CPU registers; modify RAM memory; start execution of the product program from a specific memory location; breakpoint or stop execution of the product program when the instruction at a specific memory location is reached or when a given condition is met.

WELL-DESIGNED PROGRAMS A welldesigned program is one which doesthe job-correctly and a s fast as possible and with as little memory as possible. It is easy to read and understand; it is easy to modify; it was developed in a short amount of time; and it was uncostly to develop. Atleast that is the designer’swish list.Actually,a welldesigned program is one which does the job and which represents the optimum tradeoffs in the goals just mentioned for the particular application. The next section of this paper examines an extensive list of assembler features, each of which supports one or moreof the design goals. Ideally,everyassembler would contain all of thesefeatures. However,because of space, time,andcost considerations there is currently no microprocessor assembler which includes all of thesefeatures.Furthermore,the assemblers availablevary significantly intheextent to which theysupplythesefeatures.Someofthesefeatures,such as relocatableobjectcodeand linkage editing, may not be necessary for a user’s particular application. Hence the designer must consider the available and unavailable features of a particularassemblerin view of theparticularapplicationfor which he/she intendsto develop software.

FEATURESOF

WHICH SUPPORT GOOD PROGRAMDESIGN

AN ASSEMBLER

Feature I : Source, Object, andListingFormats Whichare Easy to Use, Read,and Understand Figs. 1-3 showasamplesourceprogram,objectprogram, andprogramlisting,respectively. The program is written in Signetics 2650 assemblylanguage and it represents a typical microcomputer function (moving a sequence of bytes of data from one RAM area to another). In a typical microcomputer

WATSON: COMMERCIALLY AVAILABLE SOFTWARE TOOLS

assembly-language sourceprogramtherearethreetypesof statements: 1) symbolicmicrocomputerinstructions(which are translated into machine-language instructions in the objectprogram), 2) directive statements to the assembler regarding thetranslation of thesymbolicmicrocomputer instructions, and 3) comment statements which are reproduced in the program listing for documentation purposes but have no effect on the translation of the program. Symbolic instruction statements and assembler directive statements typically have four fields; however, one or moreof these fields may be blank in a particular statement. The first field in called the LABEL field. It is used to give symbolic names to data and program segments. Thesecond field is called the OPERATION or OP CODE field. It specifies theoperationorfunction to be performedby the instruction or assembler directive. The third field is known as the OPERAND field and it indicates the arguments to the operation or function. The fourth field is a COMMENT field which has no effect on the program translation but is reproduced in the program listing for documentationpurposes. (Note there is a comment field on assembler directives and instruction statements and there is a comment statement.Both serve the same purpose.) One ormore A LABEL blankstypicallyseparateonefieldfromanother. is usually optionalon all instructionsandsome assembler directives, the OPERATION mustalways be specified,some OPERATIONS require no OPERANDS, and COMMENTS are usually optional onall instructions and assemblerdirectives. The assembler usually recognizes a comment statement by some unique character at the start of the comment statement. Otherthanthischaracter,thestatement has no predefined fields. (In Fig. 1 each line is one complete statement and all lines which begin with an asterisk are comment statements.) All other statements are then either computer instructions or assembler directives and these are differentiated by the OPERATION field.Each assembler hasacertainrepertoire of assembler directives to which it responds and a repertoire of symbolic computer instructions that it translates. (In Fig. 1, the EQU, O R G , RES, and END operations areassembler and HALT operadirectives. The LODI,LODA,STRA,BDRR, tionsaresymbolic computerinstructions.Inthisparticular assembly language, some instructions require a certain operand to be included in the operation field, e.g., LODI,RO; LODA,RO; STRA,RO; and BDRR, R 3 . The remaining operands appear in the operand field. One operation, HALT, requires no operand.) Inmostmicrocomputer assemblylanguages eachsourceprogram line is one complete statement. Intel's 8080 assembly language is a notable exception to this. 8080 source-program statements canbe continuedatanypointin thestatement from one line to the next. Also more than one statement can appearon aline.This totalcolumnindependence of fields gives the programmerconsiderableflexibilityandcontrol over the source-program format. National'sIMP-16assembly languageallows column-independentfieldswithineach line withtherestrictionthat each line is adiscretestatement. Signetics' 2650, Fairchild's F8, and Motorola's 6800 assembly languages allowcolumn-independentfieldswithineachline with the restrictions that each line is a discrete statement and that column 1 must be a start of a label or a comment statement indicator or a blank. Rockwell's PPS-8 assembly language requires that each line be a discrete statement and fields must start within certain column ranges in the line. Intel and National achieve the column independence of the label field and the comment statement indicator by requiring

913

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*PROCESS03 SYMBOLS R0 fJ RI EQU 1 EQU R2 2 R3 EQU

EQU

PROCESSOR R E G I S T E R S

*

.......................................... *PROGRAM V A R I A B L E STOHAGE ORG H'IRfJ' START OF RAM MEMORY 3 LENGTH OF TABLE EACH T L E NE Q U A TTALB RETLEN EESL A TTALB RETLENB ESL B B

*

**.******

L.L . t *. * . * t t f * a . l i . . f, ... . . t . . .t * t f . . . .~ *.

. _.

*LILOCK MUVE PROGRAM 8 T H I S PROGRA;I MOVES THE UATA I N 'TABLE A ( T B L A ) TO T A B L E 3 ( T B L B ) . THE PROGHAN RECJUlRES THAT THE LENGTH OF EACH T A B L E BL EE S T SH A N 2 5 6 BYTES. THE T A B L E S MAY R E S I D E ANYWHERE I I V THE SANE MEMORY PAGE A S THE a w v ROUTINE.

* * * *

*

ORG 0 START OF ROM MEMORY BMOV LOO1 8 2 3 T L E N SET UP INDEX LOOP LODA.Ri3 T H L A - I J R ~ GET B Y T E F X O N T B L A STRA,RO T B L B - I n R J MOVE I T TO T A B L E B BORRsRJ LOOP I F NUT ENDnCONT. AT HALT HALT WHEN DONE

*

.......................................... END

BMOU

Fig. 1. A source program. r00000B1607030F6OFFCF6lO2FE784OF4:OOOOOOOO

Fig. 2 . An object program (for source program in Fig. 1 ) .

all labels to be terminated with a colon (:). This gives them the further capability of allowing more than one label field in a statement.The following is anexample of howmultiple labels might beadvantageous. Various programsegments for some aplication might be written by different programmers or atdifferentpointsintime.Each of these may referencea commonprogramsegment ordataitembut byadifferent symbolicname. In Intel's and National'sassemblylanguages this common programsegment or data item could be given more thanonename (label) thus making itunnecessary to modify any of the prewritten program segments that reference it. Both Intel's 8080 and National's IMP-1 6 assembly languages require a positive indication of the start of a comment field (all comment fields must be preceded by a semicolon). In the Signetics 2650, Fairchild F8, Rockwell PPS-8, andMotorola 6800 assembly languages the assembler assumes that the f i t nonblankcharacterfollowingoneormore blanks after the operand field (or operation field if the operation requires no operand) is the start of the comment field. With this latter space in approach, if aprogrammerinadvertantlyinsertsa the operand field at a point where the operand could legally stop (such as separating two arguments with a space when one or two arguments is acceptable), the assembler will not recognize that an error has occurred and it will treat the remainder of the operand after the space as part of the comment. Rockwell'sPPS-8 assembler, which has some operations that have optional operands, has a further consideration. If an optional operand is not present, the comment field must be preceded by an exclamation point (!). Exceptions of this type can be confusing and cause programming errors. When writing program, a programmer, a given enough flexibilityby the assembler, usuallydecides on acolumn specific formatforthe source. Usually, eachstatement is implemented as a separate line and the fields of the statements are aligned from one line to another. This makes the program

PROCEEDINGS OF THE IEEE, JUNE

914 P I P ASSEMBLERVERSION

GE

1976

3 LEVEL I

I

L I N E ADDR B I 82 8 3 8 4 ERR SOURCE

..........................................

I 2 3 0000

*PROCESSOR SYMBOLS EQU 0 EQU 1

R0 RI R2

4 0001

5 0002 6 0003 7 8

EQU

EQU R3

*

PROCESSOR R E G I S T E R S

2 3

..........................................

:PROGRAM VARIABLESTORAGE H'l00' S T A R T OF RAM MEMORY ORG ETQ LU EN 3 L E N G T H OF TEAABCLHE T LRETEN BSL A T A B L EA T B L BR E S TBTALBELNE

9

10 I I 0003 12 0100 13 0103 14

..........................................

15 16 17 18 19

20 21 22 23 24 25 0000 e7 26 0002 0F 2 7 0005 CF 28 0008 F B 2 9 00llA 4 G 30 31 32

*BLOCK MOVE PROGRAM :T H I S PROGRAM MOVES THE DATA I N T A B L EA ( T B L A T) OT A B L EB( T R L B )T. H E PROGRAM RERUIRESTHATTHELENGTH OF E A C HT A a L E BE LESS THAN 2 5 6 B Y T E ST. H E TABLES MAY R E S I D E ANYWHERE I N THE SAME MEMORY PAGE A ST H E BMOV R O U T I N E .

* * *

ORG 0 START OF ROM MEMORY BMOV L O D I , R 3T L E N SET UP INDEX LOOPLOOAnRBTBLA-I,R3GETBYTE F R O M TBLA S T R A s R BT B L B - I , R 3 MOVE I T TO T A S L EB I F NOT AT END,CONT. BDRR,R3 LOOP HALT HALT DONE UHEN

03 60 F F 61 02 78

TOTAL ASSEMBLER ERRJRS

.......................................... END

=

BMOV

0

Fig. 3. A program listing (for source program in Fig. 1).

BUFA EQU ~ ' 0 8 0 0 ' SET THE VALUE OF smm BUFA SET THE VALUE OF s m m BUFB BUFB EQU H'OWO' DRG H ' 0 1 0 0 ' OCI BUFA SET DCD TO BUFA STARTING AODRESS XDC STORE I NO C l D C I BUFB SET DCO TO BUFB STARTING AODRESS L I H ' 8 0 ' LOAD BUFFER L E M H INTO A C N M L A T O R LRl,A SAVE BUFFER LENGTH I N SCRATCHPAD BYTE 1 LOOP LH L 0 9 0 CONTENTS OF M W R Y BYTE ADDRESSED BY DCO XM EXCHANGE DCO AND OCI ST STORE A C C W I A T O R I N MEMORY B M E ADDRESSED BY OCO XDC EXCWNGE DCO AND O C l DS 1 DECREMEKT SCRATCHPAD BYTE 1 LOOP BNZ LOOP I F SCRATCHPAD BYTE 1 IS NOT ZERO, RETURN TO END

of fields for the particular program, and 2) the assembler will not reject a particular statement just because a particular field was inadvertantlystartedinthewrongcolumn.(Correcting errors of thistype can be expensive,timeconsuming,and unnecessary .) Motorola's 6800 assembler has useful a feature which automatically aligns the fields of each line of the source program for printing in the program listing. This feature allows a programmer t o input a source program looking somewhat like Fig. 4 and having a version looking somewhat like Fig. 5 a p Fig. 4. A source program with unaligned fields. pear inthe program listing. (Thesource itself remains unchanged.) An important aspect of this feature is that it can SET THE VALUEOF smm BUFA H'0800' BUFA EW also be optionallydeselected so thatthe programmer can SET THE VALUE OF smm BUFB BUFB EQU H'OWO' ORG H'0100' retain control over the listing format. SET DCO TO BUFA STARTINGAWRESS DC I W FA STORE I N D C I XDC Various assemblers recognize assembler-directive statements SET DCO TO BUFB STARTING ADDRESS DC I BUFB in the sourceprogram which control the vertical spacing of the LOAD BUFFERLENGTHINTO ACCUMULATOR H'80' LI SAVE BUFFER LENGTH I N SCRATCHPAD BYTE 1 LR 1 ,A program listing on the printer page. Signetics 2650, Fairchild LOAD CONTENTS OF REMORY BYTE ADDRESSED BY OCD LOOP Lu EXCHANGE DCO AND DCI xoc F8, National IMP-16, andRockwell PPS-8 assemblers recogSTORE K C M U L A T O RI N MEMORY BYTE ADDRESSED BY OCO ST nizea pageeject directive.Signetics2650,National IMP-16, EXCHANGE DCO AND OCI XDC DECREMENT SCRATCHPAD BYTE 1 DS I andRockwell PPS-8 assemblersrecognizeaspacedirective I F SCRATCHPAO BYTE I IS NOT ZERO, RETURN TO LOOP LOOP EN.? E!iU which spaces the printer page up a specified number of lines. Fig. 5. A source program with aligned ftelds. F8, National IMP-16, Motorola Signetics 2650, Fairchild 6800, and Rodcwell PPS-8 assemblers include a title directive t o be printed at the top of source and listing easier to read and understand. Fig. 4 shows which specifiesaprogramtitle an example of an F8 assembly-language program with unaligned each page of the program listing. These features can make it aligned fields. easier and less costlyto generate a readableprogram listing fields. Fig. 5 showsthesameprogramwith (Both versions are equally acceptable to the assembler but the Feature 2: The Ability to Define and Manipulate program in Fig. 5 is obviously easier for people to read.) The Meaningful Symbols importanceofcolumn-independentsourceinput to an asAn assembly language program usually contains two types of sembler is twofold: 1) the programmer can format the source which are part of the based on his/her own style andbased on the appropriate length symbols: 1) those predefined symbols

WATSON: COMMERCIALLY AVAILABLE SOFTWARE TOOLS

vocabulary of the language, such as computer-instruction operationcodes, assembler-directive operationcodes, micro2 ) symbolswhich are asprocessorregisternames,etc.,and signedby the programmer t o data values and program segments.The provisionof meaningfulpredefinedsymbolsand the ability t o define meaningful symbols are two features of an assembler which make good design possible. A meaningful symbol is defined here as a symbol whose meaning or defiinition is immediately or easily recognized or remembered so that frequent references t o awrittendefinition are unnecessary. An example program segment could look as follows: LODI SUBM

HILIMIT,A COUNTER,A

JPOS

AGAIN

These three instructions (in a hypothetical assembly language) cause the following steps in the microcomputer. 1) The constant data value HILIMIT is loaded into the CPU accumulator or A-register. (I in LODI identifies HILIMIT as a data constant whose absolute value is present in the instruction, called immediate addressing of data.) 2 ) The variable data value COUNTER is subtracted from the CPU accumulator. (M in SUBM identifies COUNTER as a data variable or constant whose memory address is present in the instruction rather than the data value itself.) 3) A test is made as to whether the result of the subtract operation is a positive number and, if so, program control is transferred to another pointintheprogram called AGAIN. (This is called a “jump” to AGAIN.) If the result is a negative number, program controlcontinuesatthenextsequential instruction (not shownin this example). In this particular program segment LODI,SUBM, and JPOS are symbolic names for CPU operations or instructions. A is the symbolicname forthe CPU accumulatoror A-register. These symbolic names are part of the vocabulary of the assembler.Thenames HILIMIT, COUNTER, and AGAIN were made up by the programmer. The absolute valuesassociated with each of these three symbols are defined by the programmer to theassembler elsewhere in the program. Assemblers vary regarding therestrictions placed on programmer-defined symbols. Usually, such symbols must begin with a certain kind of character and they must be less than a particular.number of charactersinlength.There is also a limit as to the number of programmer-defined symbols an assembler can handle. The following shows how this program segmentwould be implementedinfourdifferent assembly languages. 1) In Fairchild’s F8 assembly language, programmerdefined names must start with an alphabetic character and must be in the rangeof one t o six characters. The previousexample would look as follows in F8 assembly language. DCI LM COM INC AI BP

COUNTR

HILIMT AGAIN

Set memory pointer to COUNTR. Load COUNTR to accumulator. Complement accumulator. Increment accumulator by 1. Add immediate value HILIMT to accum. Jump (branch)to AGAIN if result is positive.

Note: The F8 has no subtractinstruction.However, complementing andincrementingthesubtrahend by1and then adding the minuendhas the sameeffect as subtractingthe subtrahend from the minuend.

91 5

2 ) In Signetics 2650 cross1 assembly language, programmerdefined symbols must begin with an alphabetic character and must be in the range of one to four characters. The previous example could look as follows: LODI,RO HILM Load immediate value HILM to register 0. SUBA,RO CNTR Subtract CNTR from register 0. BCTR ,P AGIN Jump (branch) to AGIN if result is positive. 3) In Intel’s 8080 assembly language, the first character of a symbol must be alphabetic or one of the special characters @ (at sign) or ? (questionmark).Thenamemust be in the rangeof one to five characters. The previous example could look as follows: MVI A,HILIM LXI H ,COUNT SUB M JP AGAIN

;Load immediate value HILIM to accum. ;Setmemorypointer to COUNT. ;Subtract COUNT from accumulator. ;Jumpto AGAIN if result is positive.

4) In Motorola’s 6800 assemblylanguage, symbolsmust begin with an alphabetic character and are limited to one to six characters. A # (pound) sign precedingasymbol in the operand field indicates the symbol is an immediate data value. # sign indicatesa variable or constant is Theabsenceofa stored elsewhere in memory.Theexample would look as follows: LDA A #HILIMT SUB A COUNTR BPL AGAIN

Load immed value HILIMT to accum A Subtract COUNTR from aCCUmUlatOr A . Branch to AGAIN if result is pos.

5) In Rockwell’sPPS-8assemblylanguage, symbolsmust contain at least one alphabetic or special character and maybe up to eight characters long.Any characters except +, -, and space may be used and the symbol may start with any character except a # or !. In each of the previous cases, theparticularoperations required are a function of the architecture of the microprocessor. However, the symbols which represent those operations are a feature of the assembler. There are essentially four ways to define a symbol in amicrocomputer assembly language. 1) By placing a unique symbol in the label field of a corn puterinstructionstatement.Inthepreviousexample,the s y m b o l ~ G ~ Iwould N appear in the label field of the instruction to which control is to be passed when the result of the subtract operation is a positively signed number. This mght appear as follows : AGAIN

LODM COUNTER

LODI SUBM JPOS

,A

HILIMIT,A COUNTER ,A AGAIN

The F8,2650,8080,6800, IMP-16, and PPS-8assembly languages allhandleinstructionlabels in this way (except Signetics’ resident assembler, not yet available at the writing of this paper, will allow a greater number of characters in the label.

PROCEEDINGS OF THE IEEE, JUNE 1976

916

that Intel’s and National‘s assemblers require that a colon (:) follow thelabel). 2) Byplacing auniquesymbol in the labelfield of an assembler-directive statement which equates the symbol with an absolutenumericalvalue.This valuemay beaconstant data value or an address of data in memory or an address of an instruction in memory. h the previous example, HILIMIT might be defined as follows: EQU

HILIMIT

10

In the previous examples, the absolute number 10 would be loaded into the accumulator if thisdirective was presentin the program. The EQU directive is available in the F8, 2650, 6800,8080,and PPS-8assemblers. In Nationals’sIMP-16 assembler this statement is written as: HILIM=IO 3) Byplacing auniquesymbolin the label field of an assemblerdirectivestatementwhich reserves oneormore memory locations and which equates the symbol to the address.of the first of these locations. This is the method for reserving RAM locationsfor data-variable storage. In the previous example, COUNTER is a data variable and the statement t o reserve one location for COUNTER would be written as follows:In Intel8080 assembly language (Ds=Defie Storage) COUNT: DS

1

In Motorola 6800 assemblylanguage(RMB=ReserveMemory Bytes) RMB

COUNTR

1

.=.+1

RRAM

RES

1

EQU

5 8 27 32 1

Intel 8080 assemblylanguage(DB=Define LUTAB:

Motorola Byt4s))

6800 assembly language

LUTABLE

Byte(s) of data)

5,8,27,32,1

DB

FCB

( F C B - F O ~Constant

5,8,27,32,1

National IMP-16 assembly language

Rockwell PPS-8 assembly language (DW=Define Word, word = byte in PPS-8 terminology)

1

DATA

5 8 27 32 1

5,8,27,32,1

Ifeach of thetableentriescontained a computermemory address, each value would be 2 bytes in length (instead of one, as above). The 2-byte values couldbe d e f i e d as follows: Fairchild F8 assemblylanguage(DCmay define 1- or 2-byte values; * = multiply). LUTABL

100

Inthis case, the programmermust do the housekeeping of memoryaddresses and assign the specificmemory address (100 here) of the variable. 4) Byplacing a symbol in the label field of an assemblerdirective statement which assigns anabsolute value(s) to be stored in one or more memory locations and which equates the symbol with the address of the first of theselocations. This is themethodforsettingupconstants in ROM. Data constants that require more memory to be expressed than is allocated in an immediate addressing instruction (usually one memorybyteorword) can belocatedelsewhere in ROM.

DW DW DW DW DW

Signetics 2650 assembly language LUTB

The operand field of each of these five examples indicates the numberofbytes of RAM storage to reserve. Thememory address of CNTR, COUNT, COUNTR , and COUNTER is assigned by the assembler. The F8 assembly language does not contain a directive of this type. However, data-variable symbols can be d e f i e d using the EQU directive, e.g., COUNTR

DC DC DC DC

reserve

In Signetics 2650 assembly language (RES = Reserve) CNTR

DC

LKUPTABL

In Rockwell’s PPS-8 assembly language RAM) COUNTER

LUTABL

LUTAB: .WORD 5,8,27,32,1

In National IMP-16 assembly language (. represents the address of this word in memory) COUNT:

These constants are then accessed by the program in the same way as are variables, i.e., the instruction contains the address of thedataratherthanthedata valuesthemselves. For example, a program may utilize an internal lookup table to convert variabledatainputfrom someexternal device to some otherformat. Since theinformationinthelookuptable is fixed (constant) all of the values in the table are defined as constants to the assembler. However, only one name or symbol need be associated with the table. The program will then refer to this symbol as the base address or the first location of the table. To access other data values in the table it will use this base address in combination with an offsetvalue. In a table with N data values (each contained in one computer byte or word) the addresses of the values range from “base address”’ to “base address+N-1 .” This table could be definedas follows: Fairchild F8 assembly language (DC = Define Constant)

DC DC DC

(5*256+8) (27*256+32) 1

Intel 8080 assembly language (Dw=Defie Word(s), a word=2 bytes in 8080 terminology) LUTAB:

DW

5,8,27,32,1

Motorola 6800 assembly language ( F D B = F o ~Double ~ Byte Constant(s)) LUTABL

FDB

5,8,27,32,1

National IMP-16assemblylanguage (sincememorylocations contain 16 bits, every constant defined by the .WORD directive

WATSON: COMMERCIALLY AVAILABLE SOFTWARE TOOLS

is adouble-byteconstant.There word constants.) Rockwell PPS-8assemblylanguage Address) LKUPTABL

DWA DWA DWA DWA DWA

ACON

(DWA = Define Word

5 8 27 32 1 ,

Signetics 2650 assemblylanguage LUTB

is no provision for double-

5,8,21,32,1

( A C O N = A ~ ~ TConstant) ~SS

917

’XY z ’

an unlimited number ASCII of characters canbespecified with theIntel 8080 and National IMP-1 6 assemblers; c ’XY ’ up to 2 ASCII characters can be specified with the Fairchild F8 assembler; not available Rockwell with PPS-8 assembler. Character strings are specified in Motorola’s 6800 assembler with the assemblerdirective FCC (FormConstant Characters) using one of the two following forms: Label FCC 3,xYz (3 indicates the number of characters) Label FCC /XY z I

Up to 255 characters can be specified with one FCC directive. Feature 3: The Ability to Specify Data Constants in the Most of these number base or formatindicators are fairly Program in the Most Meaningful Form straightforward except for Rockwell’s and Motorola’s hex and Numbers which have the most meaning to the programmer binaryindicatorsand Motorola’s octalindicator, which are as decimal numbers should be specified as decimal numbers, arbitrary special symbols that are difficult to remember. those which mean the most in ASCII format should be specified in ASCII, etc. The assembler should do these conversions to Feature 4 : The Ability to Specify an Arithmetic or Logical binary since assemblers can do them faster and more accurately Expression in the Operand Field o f a Computer Instruction than programmers.Thesymbols for specifying the base or or Assembler-Directive Statement format of constants should be clearand easily remembered. The assembler evaluates these expressions anduses the result Example formats for specifying constants are as follows. as the operand value of the statement. (Note that theseex(@indicates letter0 versus number zero.) pressions areevaluatedduring the assembly andnot during Hexidecimal constants (e.g., 2316) the execution of the object program on the microcomputer.) assembler; 8080 Intel 23H The ability to use an expression in the operand field enables H’23’ Fairchild F8 and Signetics 2650 assemblers; theprogrammer to writeaninstructioninasymbolicform #2 Rockwell 3 PPS-8 assembler; which does notrequire knowledge of the absolute value $23 Motorola 6800 assembler; represented by the expression and which remains correct even XI23 or 023 National IMP-16 assembler. though the program maybe changedsuch that the absolute Octal constants (e.g., 438) value represented by the expression, changes.Assemblers can 434 or 43@ Intel 8080 assembler; also evaluateexpressionsfasterandmoreaccurately than @43’ Fairchild F8 and Signetics 2650 assemblers; programmers. (243 Motorola 6800 assembler; Forexample,supposeaprogramperformsaparticular not available in National IMP-16 and Rockof several differentblocks of data in the functiononone well PPS-8 assemblers. memory depending on which key is depressed at the computer Decimal constants (e.g., 12310) console. The programcouldhandlethisbysettingup an National 123 IMP-16, Rockwell PPS-8, and address pointer t o the proper block of data when the key is Motorola 6800 assemblers; depressed and then executing the same function regardless of 123or123DIntel8080 assembler; which data block is selected. This function wouldaccess the 123 or D’123’ Fairchild F8 and Signetics 2650 assemblers. proper data byusing the address pointer. In an 8-bit microBinary constants (e.g., 1012) computer (each memory location contains 8 bits) with 15- or l O l B Intel8080 assembler; 16-bit memory addresses (this allowsaddressing up to 32 or B‘101’ Fairchild F8 and Signetics 2650 assemblers; 64K of memory), two memory locations are required to store %lo1 Motorola 6800 assembler; one memory address. If the program is to store the address of ’101’Rockwell PPS-8 assembler; the data in memory, then it must separately extract the upper not available in National IMP-1 6 assembler. half of the data address and then store it and then extract the ASCII constants (e.g., the letter x ) lower half of the data address and then store that. If the data ’x’ Intel 8080 and National IMP-16assemblers; address is represented by a symbol (ADDRESS in the following A’X’ Signetics 2650 assembler; example) then the upper and lower halves (8 bits each, or 8 c’x’ Fairchild F8 assembler; bits lower and 7 bits upper) can be extracted using the follow‘x Motorola 6800 assembler; ing expressions: not available in Rockwell PPS-8assembler. Upper half = ADDRESS + 256 EBCDIC constants (e.g., the letter x ) Lower half = ADDRESS modulo 256 E’X’ Signetics 2650 assembler; not available in Intel8080, Fairchild F8, Rockwell These expressions could appear in the fields of an instruction PPS-8, Motorola 6800,andNational IMP-16 as- as follows: semblers. LODI ADDRESS+256,A Character strings (e.g., the letters XYZ) STRM A,MEMORY A’XYZ’ or E’XYZ’ up to 16 ASCII or EDCBIC characters LODI ADDRESS modulo256,A may be specifiedwith the Signetics STRM A ,MEMORY +1 2650 assembler;

PROCEEDINGS OF THE IEEE, JUNE 1976

918

The previous expressions would look as follows in the various assembly languages. IntheIntel8080 assembler (theIntel 8080 has an instruction which permits a 16-bit operand to be loaded into a registerpair. If, however, itwas necessary to extract only the upper or lower half of a 16-bit quantity the following expressions would apply.)

TABLE I

m

ratrcnl F8

9080

In the Signetics 2650 assembler Upper half = ADDR

+

+

Upper half = (ADDRES/256) Lower half= (ADDRES-((ADDRES/256)*256)) IntheMotorola 6800 assembler (the Motorola 6800 has an instruction which permits a 16-bit operand to be loaded into a 16-bit index register. If, however, the upper orlower half of a16-bitquantity were deisred,thefollowingexpressions would apply.) Upper half = ADDRES/256 Lower half = - A D D R E S / ~ ~ ~ * ~ ~ ~ + A D D R E S The expression operators in Table I are available in the various assembly languages (ablankentryindicates theoperator is not available). Feature 5 : The Provision in the Program Listing of an Alphabetically Sorted Symbol Table Which Lists Each Symbol in the Program and Indicates the Numerical Value Associated with that Symbol The presence of such a table can reduce program debug and program modification time since it serves as a handy dictionary to program symbols. If the symbol table is to be meaningful, thenumber base of the values in thesymboltableshould match the number base of the object-program display in the programlisting.For 8- and16-bitmicrocomputers the most meaningfuldisplay of theobject programandprogramaddresses is in hexidecimal.Thefollowingassemblersprovide alphabetically sorted symbol tables: Fairchild F8, Intel 8080, and National IMP-16 assemblers. The Motorola 6800 assembler providesasymboltablewiththesymbolsappearingin the order in which they are defined in the program (not alphabetically listed).Each of these assemblers displays the object programand the numerical values inthesymbol tablein hexidecimalexcept the Fairchild F8 crossassembler. The Fairchildcrossassemblerallows the programmer to selecta decimal, hexidecimal, or octal display of the object program in the program listing. However, the symbol table values are always displayed in decimal. Feature 6: The Provision in the Rogram Listing o f an Alphabetically Sorted Cross Reference Table or Concordance Which Lists Each Symbol in the Rogram and then Indicates Which Statement Defines the Symbol and Which Statements Reference the Symbol The best cross reference also indicates whether each referencing statement merely uses (or reads) the value represented

+

/

I

Multiplication

llDD

Wulo aritktic Exponentiation Logicalnot

NOT

Logical and

Am,

Logicalinclusive

In the Fairchild F8 assembler(onlydecimalnumbersand symbols can be used in expressions)

PCS-8

subtraction Addition Division

Upper half = ADDRS SHR 8 Lower half = ADDRS AND OFFH

-

Unary minus o r

or

OR

Logicalexclusiveor

XOR

L i n e a rs h i f tr i g h t

SHR

L i n e a rs h i f tl e f t Extracts upper/iower byte o f 2 byte quantity Specified precedence of operators dierarchy of

Operator

I

SHL

!

I

I

0

iI Yes

7

by the symbol or in thecase of data-variable symbols, whether the statement modifies the data representedby the symbol. This is sometimes called a set-use table. Of the six considered assemblers onlythe Fairchild F8 andRockwell PPS8 assemblers provide cross-reference tables and neither of these is a set-use table. Feature 7: The Provision of Good Error Diagnostics Assemblers should flag any source-program statements which violate assembly-language syntax rules.(Anassemblermight assemble such a statement, making certain assumptions about what the programmer meant, but it should never not alarm the statement.) Assemblers shouldalarm computerinstructions which violate the architecture of the microcomputer, e.g., an operand value which is to fit into 8 bits and is greater than 255, oraninstruction whichtransfers controltoanother instruction which is out of range when relative addressing is used (i.e., jumpforward x locationsorjump backwards x locations where x is too large). Errors which cause an abnormal termination of the assemblershould always be alarmed by the assembler(rather than an abortwithno message). The absence of an END directive should not cause an abnormal (as it doeswithsome assemblers). unalarmedtermination Statementswhichgenerateinternalassemblererrorsshould be alarmed, e.g., the statement which defines the Nth symbol in the programwhenonly N-1 symbolsmaximum can be handled internally in the assembler. Error messages should be clear explicit statements that are meaningful to the programmer.Theyshould,wheneverpossible,indicate the specific program statement or field of statement containing the error. An assemblershould also notabort at the firsterror but should flag the error, place a skeleton instruction in the object code with the incorrect fields set to zero, and then continue as much of the program translation as possible. This approach can often permit the programmer to begin debugging the program bymakingafewpatches totheobject programand without having t o reassembleimmediately. An assembler

WATSON: COMMERCIALLY AVAILABLE SOFTWARE TOOLS

919 7FOWL

/ ; ,

PARAMETERS

FETCH X M C RO

( A SU R I T -

4

END

SUM --”--

7 .----+ M C CR AO L L

FETCH Z

ASSEM-

!

BLY

1CALL SUH UACRO A,B,C’

PROGRAM

!I

T E NB Y

!

PROGRAM-

1

MER)

STORE Z

TION

1

SET ASSEMBLY Y

PROGRAn

Y ADD

DEFINI-

!

.

T E NB Y

i .

PROGRAH-

i tf-

1

1z iyH

t F . - M C R O

(AS W D I -

STORE Z

F l E DB Y

FETCH Z

ASSEMBLER)

f C T UPAALM M E T EI N RS

2 FETCH Z

cPROGRAM

, /

( A SU R I T -

MER)

ASSEMBLY

SET

1 EXPANSION

L . Fig. 6. A macro example.

should also include a message in the program listing which indicates thetotalnumber of errorsfound. Gooderror checking and clear error messages by an assembler can significantly reduce the program debug time and the program assemblycosts. The currently available assemblers vary considerably in their ability to provide these “sho~lds.” Feature 8: The Provision of a Parameterized Macro Facility Often times programs wiU have functions or sequences of instructions which are executedat more than one point in the program. These functions or instruction sequences can be included in the object program in two different ways. 1) An instruction sequence can appear only once in the object program and at each point where the function is to be executed, control can be transferred to thisinstruction sequence. As soon as the function is executed, control is then transferred back t o where processing left off before thefunction was executed.Theinstruction sequence in this case is called a subroutine.2)Theinstruction sequence can be repeated in the objectprogram at each point that the function is to be performed. This is called the inlinecode method. Obviously, method 2) requires more ROM for program storage since the same sequence of instructions exists several times in the program instead of once as in method 1). The second method, however,results in afasterprogram execution since no instructions are executed to transfer control back and forth. Because of this tradeoff situation, aprogrammermay use subroutinesfor some functions andinline codefor others.

SY E T

I

F E T C H A;

1

BLY PROGRAM A SM O O I -

;

1

ASSEM-

.

F l E DB Y ASSEM-

BLER)

1 I

ADD

B ~ ~ - + F ( A C R EOX P A N S I O N

STORE CJ

I

1. Fig. 7 . A parameterized macro example.

For example, if thefunction can be performed in a small number of instructions, and speed is important, the programmer will probably chose theinlinesodemethod. What the programmerneeds in this case isa method for writing the sequence of instructions one time and then having the assembler program repeat the sequence in the object program at each appropriate point. Thefacility to do this in an assembly language is called a macro facility, and theinstruction sequence that is to be repeated is called a macro. Fig. 6 ‘showsa macroexample in a hypothetical assembly language. Somewhere near the start of the program the programmer defines the macro by associating a name with the sequence of instructions. Wherever the programmer then writesa statementin the program with this name in theoperation field, the assembler substitutesthe sequence of instructionsfor this statement. If a program requiresa function which involves a slightly differentsequence of instructions each time the function is t o be performed, then the inlinecode method is a must. For example,a function might be performed using one set of CPU registers or one set of data constants or variables one time and another set another time.Thefacility t o insert slightly different versions of the same instruction sequence in an object program is called a parameterized macro facility. Fig. 7 shows aparameterized macro facility.Parameterizedmacros are macros which are definedwithformalparameters (argu-

PROCEEDINGS OF THE IEEE, JUNE 1976

920

ments) for which different actual parameterscan be substituted in different macro calls. The macro body can be thought of as a template with holes in it. The formal parameters serve as place markers for the holes. The assembler, for each macro call, then substitutes the actual parameters in these holes. The advantages of programming with macros are 1) program development effort can be reduced byone-half when compared to programming without macros, 2) standard functions can be defined in a macro library, and hence be available to all programs onasystem, and 3) since theamount of repetitive coding is reduced the error factor is also reduced. Assemblers which provide a parameterized macro facility are Intel’s 8080 assemblerandFairchild’s F8 crossassembler.(Fairchild’s F8 residentassemblerdoes notcontainamacrofacility.) Macro facilities vary from assembler to assembler by the number of macros that can be defined in a program, the total number of characters that can be included in all macros in the program, the level to which macro calls can be nested in macro bodies, the number of parameters permitted for each macro, the fields of an instruction that can be represented by a formal parameter,theability to placenonblankcharacters in the label and comment fields of the macro call statement, and the ability to give statement labels in a macro body a local definition which is peculiar for each expansion of the macro (called local scope of labels). The Intel 8080 macro facility is more powerful than the F8 facility on most of these points. Feature 9: Provision of a Conditional Assembly Facility This is the ability to direct the assembler to translate or not translate (into object code) particular blocks of source-program statements. Using this facility, one program can be written for different versions or models of thesame system. The programmer can then, by changing a few statements at the beginning of the program, select which model specific program segments the assembler is to include in the object program. The Intel 8080 and National IMP-16 assemblers both include this feature. An example of this feature in 8080 assembly language is as follows: IF

CRT

OUT ENDIF IF

PORT1

OUT

NOT CRT PORT2

ENDIF

An example of this feature in IMP-I6 assembly language is as

follows: .IF CRT ROUT PORT 1 .ELSE ROUT PORT2 .ENDIF

In the beginning of the programcontainingeither of these examplestherewould be an assemblerdirective which sets CRT to true (zero for the 8080 and positive nonzero for the IMP-16) or false, depending on which model of the program

was to be assembled, the CRT model or the Teletype model, for example. Feature 10: The Ability to Produce a Relocatable Object Program This is the ability of an assembler to output an object program which can be loadedforexecutionintoanysuitable All ofthe addresses in theprogram are area ofmemory. assembled relative to some base address. A relocating loader program must then modify the object program addresses for it to run at the deisred location. This feature is provided by National’s IMP-16 assembler. Feature 11 : The Provision o f a Linkage-Editing Capability This istheability to definesymbolsinoneprogramand reference them in another independently assembled program. A linking loader or linkageeditor program is required then to modify the object programs to establish the cross references. This feature isprovided by National’s IMP-16 assembler.

IN SUMMARY Softwaretoolsarethespecialpurposecomputerprograms which the software engineer can use to facilitate the develop ment of the product software. The quality, cost, and development time cycle of an entire microcomputer-based product is directly related to the appropriateness of the software tools used to develop the software. More specifically, if an assembler program is used for program development, the availability of certainfeaturesintheassembler can reduceprogramming time, errors, and costs and improve product reliability. These features are as follows. 1) Program source,object,andlistingformats which are easy to use, read, and understand. 2) The ability to define and manipulate meaningful program and data symbols. 3) The ability to specify data constants in the program in the most meaningful form or number base, e.g, ASCII, hex, decimal, binary, etc. 4) The ability to specify an arithmetic or logical expression in the operand field of a computer instruction or assembler directive statement. 5) The provision in the program listing of an alphabetically sorted symbol table. 6) The provision in the program listing of an alphabetically sorted cross-reference table or concordance. 7) The provision of good error diagnostics. 8) The provision of a parameterized macro facility. 9) The provision of a conditional assembly feature. 10)Theability to producearelocatableobjectprogram. 1 1) Theprovision of a linkage editing capability. sigThe degree to which these features are provided varies nificantlyfromonecommercially available microprocessor assembler to another.Ideally, every assemblerwouldfully provide all of the features. However, since this is not the case, the user must decide to what extent these features are required in anassemblerfor hisper applicationandthenevaluate available assemblers from the perspectiveof this decision.