Home
EMMYPL USER`S MANUAL by John D. Polstra April 1976 Technical
Contents
1. to be unconditionally exited If the lt IDENTIFIER gt is included it must be the name of a label which is attached to the beginning of a lt GROUP gt lt WHILE_GROUP gt or lt UNTIL GROUP gt which contains the enough statement When the enough statement is executed control is transferred to the first statement following the lt GROUP gt lt WHILE GROUP gt or lt UNTIL_GROUP gt whose label is named by the lt IDENTIFIER gt If the lt IDENTIFIER gt is omitted control is transferred to the first statement following the smallest lt GROUP gt lt WHILE_GROUP gt or lt UNTIL_GROUP gt which contains the enough statement It is illegal to use an enough statement to transfer control to a point not within the current procedure 2 15 SYNC BREAK STATEMENTS 15 1 Syntax lt SYNC_BREAK gt 15 2 Semantics The sync break statement forces the next generated EMMY instruction to begin in a new word of micromemory It forces a no operation code into the A machine instruction of the current instruction word if necessary 16 MACHINE LANGUAGE FUNCTIONS The machine language function is a mechanism designed to enable the programmer to directly specify an EMMY instruction to be generated At present the machine language functions are neither fully defined nor implemented This section is included only for completeness 28 17 _ PROCEDURE DECLARATIONS 17 1 Syntax lt PROCEDURE gt lt PROCHEAD gt END lt PROC
2. a machine register 1 2 2 4 Function Names An identifier which is declared in a data declaration statement with the FUNCTION attribute is a function name A function name is a reference to a particular EMMY instruction The use of a function name within a program causes the corresponding instruction to be generated and included in the object code oe 1 2 2 5 Procedure Names An identifier which is declared in a procedure declaration statement is a procedure name A procedure name refers to a block of EMMY object code which may be called from another portion of the program 1 2 2 6 Labels A label is a name which refers to a statement within the EMMYPL program The use of a label within a control statement causes a tranfer of control within the program A label is declared by placing it within the source program before the statement to which it refers followed by a colon Several labels may be attached to one statement if each label is followed by a colon Labels are the only identifiers which may be referenced before they are declared 1 2 3 Scope of Identifiers The scope of an identifier is the portion of the program in which the identifier is considered to be defined An identifier may not be referenced outside of its scope In EMMYPL the scope of an identifier is the BEGIN END or PROCEDURE END pair in which the identifier is declared Note that the DO END pair does not begin a new boundary of scope or lexic level 1 3 Res
3. generation of microcode for the EMMY computer The EMMYPL language was designed with the following goals in mind _ 1 Provide high level control and data structuring constructs 2 Retain full access to EMMY hardware features 3 Allow the programmer to easily and naturally predict and or control the actual microinstructions generated by the compiler This document is not intended to be a tutorial on high level language programming nor is it a tutorial on the EMMY computer The reader should have some knowledge of the architecture and instruction set of EMMY and should have had some experience with an ALGOL like language In particular experience with the PL360 language would be extremely valuable The structure of this language description is predominately bottom up Thus the smallest and simplest components of the language are described first and from these components the more complex phrase types are developed This type of development was chosen to minimize the use of terms before they have been defined Due to the recursive nature of the EMMYPL grammar this strategy breaks down at certain points At such points we have attempted to avoid confusion by providing previews or brief and incomplete descriptions of terms which are to be described in later chapters The EMMYPL language and parsing algorithm used in the compiler were developed by Robert M McClure at Palyn Associates Inc in 1974 The compiler was written in the summe
4. 1 5 STATEMENTS A PREVIEW Statements are the basic building blocks of EMMYPL programs In its simplest form a statement consists of a declaration or a description of an action to be performed We have already been introduced to two such simple statement types the data declaration statements Section 3 and the expressions Section 4 In the following sections we will examine some other types of statements which allow common program constructs such as conditional execution iterative execution multipath selection of execution and procedure declaration It is possible to construct statements which contain within them one or more simpler statements Each of these simpler component statements may in turn consist of one or more still simpler statements In this way statements of arbitrary size and power can be constructed Statements may be grouped into two general categories In the first category are the so called unlabeled statements All of the statements mentioned thus far are included in this group The second is made up of those statements which directly alter the flow of execution in an unstructured manner Either type of statement may have one or more labels attached to it A label is an identifier followed by a colon and is attached to the statement following it Labels are used within control statements as references to particular points within the program code aisa 6 CONDITIONAL EXPRESSIONS 6 1 Syntax lt CONDE
5. BINOP gt lt RELOP gt lt BINOP gt NAND IMP NOR EQU ORC CAND XOR 1 SETZ amp SLL RTL SRL SRA DSLL DRTL DSRL DSRA lt RELOP gt lt gt lt gt 4 2 Semantics An expression may perform one of two functions 1 alter a unit of data 2 return a truth value which is the result of a test made on one or more units of data While the syntax for expressions as given above is quite permissive in practice only those forms of expression which can be trivially and unambiguously translated into EMMY instructions will be accepted Thus a basic knowledge of the arithmetic and logical capabilities of EMMY is necessary in order to write legal and efficient expressions in the EMMYPL language The following translation rules should also be kept in mind 1 All expressions are translated strictly from left to right There are no implicit precedences associated with the various operators Parentheses are not permitted 2 No expressions are accepted which require the allocation of registers for temporary results This is in agreement with the general EMMYPL policy of avoiding those operations which cause invisible or unpredictable side effects aie 3 There is no guarantee that the condition codes will be set by an expression since some operations may be translated into A machine instructions In particular the arithmetic operations are subject to this phenomenon Setting of the conditi
6. EMMYPL USER S MANUAL by John D Polstra April 1976 Technical Note No 86 Digital Systems Laboratory Stanford Electronics Laboratories Stanford University Stanford California The work described herein was supported in part by the Army Research Office Durham under Grant DAAG 29 76 G 0001 Digital Systems Laboratory Stanford Electronics Laboratories Technical Note No 86 April 1976 EMMYPL USER S MANUAL by John D Polstra Abstract This report describes the EMMYPL programming language EMMYPL is a high level language designed for writing microprograms for the EMMY computer EMMYPL allows the programmer to use ALGOL like control constructs while retaining good contact with the unique hardware features of EMMY The work described herein was supported in part by the Army Research Office Durham under Grant DAAG 29 76 G 0001 INTRODUCTION During the past ten years high level languages have risen from the status of Specialized tools to general aids enabling non programmers to use a computer As a result of many studies atthetime quite controversial high level languages have be come accepted almost universally as important aids to the development of nearly all types of software In light of this rapid rise in popularity it was inevitable that the high level languages would invade the last stronghold of the assembly language purist the domain of microprogramming EMMYPL is a high level language designed for the
7. HEAD gt PROCEDURE lt IDENTIFIER gt lt REG ID gt lt PROCHEAD gt lt STATEMENT gt 17 2 Semantics The procedure declaration defines a subroutine which may be called from other parts of an EMMYPL program The lt IDENTIFIER gt is the name by which the procedure may be referenced The lt REG ID gt specifies a linkage register which will be used to hold the return address when the procedure is called The procedure declaration begins a new lexic level or level of scope for identifiers 17 3 Examples PROCEDURE DISPLAY PSW R7 DATA LIGHTS ADDRESS FE0001 R1 LIGHTS ADDRESS X R1 RO END 29 18 PROCEDURE CALLS 18 1 Syntax lt UNLAB_STATEMENT gt lt PR NAME gt 18 2 Semantics A procedure call consists simply of the name of the procedure to be called When a procedure call is executed the program status word register 0 is stored into the linkage register and control is transferred to the first statement of the procedure When the execution of the procedure is complete the program status word is restored to its previous value from the linkage register causing execution to resume with the statement following the procedure call ssie 19 PROGRAMS 19 1 Syntax lt PROGRAM gt lt STARTING ADDRESS gt lt STATEMENT gt lt STARTING ADDRESS gt lt CONSTANT gt 19 2 Semantics A program consists of a starting address followed by a single state ment The starting address i
8. If the first form of lt DEC gt is used then one word is allocated The second form of lt DEC gt allows the specification by the lt CONSTANT gt of the number of words to be allocated All allocated words are initialized to a value of 0 by the compiler 3 1 3 Examples DATA ALPHA allocates one word from the data area and declares ALPHA to be the name of the allocated word 8 DATA BETA 5 allocates five words from the data area and declares BETA to be the name of the first word 3 2 Allocation From Fixed Micromemory Addresses 3 2 1 Syntax lt DEC gt lt DEC gt lt ATTRIBUTE gt lt ATTRIBUTE gt SYN M lt CONSTANT gt 3 2 2 Semantics One or more words of data are allocated beginning at the specified micro memory address The data words are not initialized by the compiler It is the programmer s responsibility to assure that the allocation is from an unused portion of micromemory 3 2 3 Examples DATA GAMMA SYN M 10 declares the name GAMMA to refer to the word in micromemory whose address is hexadecimal 10 3 3 Bit and Field Declarations 3 3 1 Syntax lt ATTRIBUTE gt BIT lt CONSTANT gt FIELD lt CONSTANT gt lt CONSTANT gt 3 3 2 Semantics No storage is allocated The identifier is declared to be a field identifier referencing either a single bit in the first form or a contiguous field of bits in the second form A single bit is specified by its bit number where bit nu
9. X gt lt SCOND gt lt ANDCOND gt lt ORCOND gt lt SCOND gt lt EXPRESSION gt lt EXPRESSION gt lt RELOP gt lt RELOP gt lt gt lt gt 2 72 lt ANDCOND gt lt ANDC1 gt lt SCOND gt lt ANDC1 gt lt SCOND gt AND lt ANDCOND gt AND lt ORCOND gt lt QRC1 gt lt SCOND gt lt ORC1 gt lt SCOND gt OR lt ORCOND gt OR 6 2 Semantics A conditional expression computes a logical value of true or faise based on an arithmetic comparison or the values of various bits in the CCODE and ICODE fields of register 0 A bit whose value is 1 is considered to be true a bit value of 0 is considered to be false Several distinct tests may be combined to give a single result using the operators AND and OR However these operators may not be mixed within a single conditional expression they must either all be AND or they must all be OR Likewise bit tests may not be combined with relational comparisons If two or more bit tests are combined all bits must be in the ICODE field or all bits must be in the CCODE field If any bits are negated then all must be negated l 6 3 Examples 16 6 3 1 Legal Conditional Expressions R gt R2 A comparison is made between the contents of registers RI and R2 If the contents of RI is greater the value is true Otherwise it is false RO 24 24 Bit 24 of register zero the busy bit is tested If its value is 0 then
10. arentheses may be given identical attributes In general any attributes following the parenthesized list will apply to all identifiers in the list If initial values are specified for a list of identifiers the initial values will be assigned to the identifiers in sequence until the initial values are all used 3 5 3 Examples DATA A B C 1 2 3 will define variable A with initial value 1 variable B with initial value 2 and variable C with initial value 3 DATA E F G 5 will define three arrays each containing 5 elements 3 6 Multiple Declarations 3 6 1 Syntax lt DECLARATION gt lt DECLARATION gt lt DEC gt 3 6 2 Semantics Several independent declarations of the above forms may be included in a single data declaration statement separated by commas The effect is identical to the effect of a sequence of data declaration statements 1 1 3 6 3 Examples DATA ALPHA BETA 5 GAMMA SYN M 10 HALT BIT BIT 15 CCODES FIELD 31 24 TWENTY FIVE 25 INDEX 28 2 3 0 4 2 2 7 8 9 10 1 A B C 1 2 3 E F G 5 The above example incorporates all of the previous examples into a single data declaration statement 12 4 EXPRESSIONS 4 1 Syntax lt EXPRESSION gt lt DATA_REF gt lt DATA_REF gt lt DATA REF gt lt DATA_REF gt lt UNOP gt lt DATA_REF gt lt EXPRESSION gt lt OP gt lt DATA_REF gt lt UNOP gt lt OP gt lt UNOP gt lt
11. d by the number of its high order and low order bits respectively The bits in a register are numbered from 0 to 31 with 0 being the least significant bit and 31 being the most significant bit 2 3 3 Examples RO 31 24 refers to the CCODES field of the PSW R2 11 0 refers to the rightmost 12 bits of register 2 RO HALT BIT would refer to the halt bit in the PSW if HALT BIT had been declared with the attribute BIT 15 5 2 4 Micromemory Cells 2 4 1 Syntax lt DATA_REF gt lt MEM NAME gt lt MEM NAME gt lt CONSTANT gt M lt REG ID gt 2 4 2 Semantics A word in micromemory can be referenced in three ways The first form refers to a cell by its name which must have been previously declared in a data declaration statement The second form allows an offset to be specified relative to a named location The third form references the word whose address is contained in the low order 12 bits of the register specified by the lt REG_ID gt 2 4 3 Examples ALPHA refers to the cell whose name is ALPHA ALPHA 5 refers to the fifth cell after ALPHA M R1 refers to the cell whose address is in the low order 12 bits of register 1 2 5 External Cells 2 5 1 Syntax lt DATA_REF gt X lt REG ID gt 2 5 2 Semantics External cells include the cells in main memory and the various address data and status registers associated with I 0 devices attached to the system bus The bus address is taken fro
12. erved Words Certain identifiers are used for special purposes in the language These are called reserved words and may not be declared in an EMMYPL program The reserved words are as follows begin do end procedure function data integer bit field syn m x or and enough again goto while until else case of then if 1 4 Symbols Certain sequences of non alphanumeric characters make up the set of symbols in the EMMYPL language These symbols are not listed here but are introduced as needed in the statement descriptions which follow 2 DATA REFERENCES A data reference is used to gain access to a unit of data Depending on the type of data being accessed a data reference may take on several forms as described below 2 1 Constants A constant refers to a unit of data which is fixed at compile time and whose value does not change during program execution 2 2 Register Identifiers The EMMY fast registers are accessed by using the predeclared register identifiers RO through R7 When a register is referenced in this way code is generated which causes the contents of the appropriate machine register to be accessed or modified 2 3 Register Fields 2 3 1 Syntax lt DATA REF gt lt REG ID gt lt FIELD ID gt lt REG ID gt lt CONSTANT gt lt CONSTANT gt 2 3 2 Semantics A register field is a reference to a portion of a particular register The portion of the register which is referred to is specifie
13. is occasionally necessary for reasons of efficiency or simplicity they should be avoided whenever it is practical to do so The again statement Section 13 and the enough statement section 14 can often be used in place of the goto statement to yield the same efficiency and simplicity in a more structured manner 205 13 AGAIN STATEMENTS 13 1 Syntax lt CONTROL_STATEMENT gt AGAIN AGAIN lt IDENTIFIER gt 13 2 Semantics The again statement causes a lt GROUP gt lt WHILE GROUP gt or lt UNTIL_GROUP gt to be unconditionally repeated If the lt IDENTIFIER gt is included it must be the name of a label which is attached to the beginning of a lt GROUP gt lt WHILE GROUP gt or lt UNTIL_GROUP gt which contains the again statement When the again statement is executed control is transferred to the top of the lt GROUP gt lt WHILE GROUP gt or lt UNTIL_GROUP gt whose label is named by the lt IDENTIFIER gt If the lt IDENTIFIER gt is omitted control is transferred to the top of the smallest lt GROUP gt lt WHILE GROUP gt or lt UNTIL_GROUP gt which contains the again statement It is illegal to use an again statement to transfer control to a point not within the current procedure 26 14 ENOUGH STATEMENTS 14 1 Syntax lt CONTROL_STATEMENT gt ENOUGH ENOUGH lt IDENTIFIER gt 14 2 Semantics The enough statement causes a lt GROUP gt lt WHILE GROUP gt or lt UNTIL_GROUP gt
14. m the specified register and a bus cycle is initiated to access the desired cell ibo 2 6 Address Constants 2 6 1 Syntax lt DATA REF gt lt MEM NAME gt lt MEM NAME gt lt CONSTANT gt 2 6 2 Semantics The value of an address constant is the micromemory address of the cell named plus an offset if specified Address constants are fixed at compile time and their value is always between 0 and 4095 inclusive 3 DATA DECLARATION STATEMENTS Data declaration statements perform three functions 1 allocate words in the micromemory data area 2 assign names to micromemory words register fields and functions 3 place initial values into words in the micromemory data area Depending upon its specific content a given data declaration may perform one or more of these functions The data declaration statements employ a factored declaration syntax which allows great flexibility and power in data declarations For this reason we present the syntax piece by piece beginning with simple forms and developing the more complex and powerful forms as needed 3 1 Simple Allocation From the Micromemory Data Area 3 1 1 Syntax lt DECLARATION gt DATA lt DEC gt lt DEC gt lt SDEC gt lt SDEC lt CONSTANT gt lt SDEC gt lt IDENTIFIER gt 3 1 2 Semantics One or more words of data are allocated from the micromemory data area The identifier is declared as the name of the first cell allocated
15. mber 0 is the Teast significant bit and bit number 31 is the most significant bit of a register A field of bits is specified by the bit numbers of its high order and low order bits respectively 3 3 3 Examples DATA HALT BIT BIT 15 DATA CCODES FIELD 31 24 3 4 Data Initilization 3 4 1 Syntax lt ATTRIBUTE gt lt INIT_ITEM gt lt INIT_ITEM gt lt CONSTANT gt lt CONSTANT gt lt INIT_ITEM gt lt INIT LIST gt lt INIT LIST gt lt INIT_ITEM gt lt INIT LIST gt lt INIT_ITEM gt 3 4 2 Semantics Initialization of the data area is quite general A single word of memory may be initialized with a single value or a group of memory words may be initialized to a list of values separated by commas and enclosed in parentheses A repetition factor may precede either of these forms followed by a colon 3 4 3 Examples DATA TWENTY FIVE 25 DATA INDEX 28 2 3 0 4 2 2 7 8 9 10 1 In the second example the array INDEX would be initialized as follows I INDEX I II INDEX I I INDEX I I INDEX I 0 0 7 9 14 0 21 9 0 8 10 15 0 22 10 2 0 9 7 16 0 23 7 3 4 10 8 17 4 24 8 4 2 1 9 18 2 25 9 5 7 12 10 19 7 26 10 6 8 13 20 8 27 1 10 3 5 Multiple Identifiers With Identical Attributes 3 5 1 Syntax lt SDEC gt lt DECLIST gt lt DECLIST gt lt DEC gt lt DECLIST gt lt DEC gt 3 5 2 Semantics A list of identifiers separated by commas and enclosed in p
16. ntained in the selecting register This alteration consists of the subtraction of the lower lt CASE_RANGE gt bound from the register 11 3 Examples CASE RI OF 4 10 Following statement executed if R1 4 DO R2 ALPHA BETA R2 END Following statement executed if RI 5 DO R2 BETA ALPHA R2 END Following statement executed if RI 9 or RI 7 9 7 BEGIN 23 DATA TEMP TEMP R7 R7 INDEX WHILE R7 lt INDEX 28 DO X R7 M R7 3 R7 1 END R7 TEMP END Following statement executed if RI RO HALT BIT 1 END ELSE Following statement executed if RI 6 or RI 10 DO it R2 FEO001 X R2 RO RO HALT BIT 1 END 24 12 GOTO STATEMENTS 12 1 Syntax lt CONTROL STATEMENT gt GOTO lt IDENTIFIER gt 12 2 Semantics The goto statement causes direct and unconditional transfer of control to the point in the program which is marked by the label whose name is referenced by the goto statement Labels in EMMYPL follow exactly the same rules of scope as do all other types of identifiers However a label need not be defined before it is referenced by a goto statement This is the only exception to the rule that an identifier must be declared before it is referenced It is illegal for a goto statement to reference a label which is defined outside the procedure which contains the goto statement While it is recognized that the use of goto statements
17. on codes can be assured by forcing translation into the T machine instructions This is accomplished via the sync break statement Unary negation is never guaranteed to set the condition codes 4 In expressions which perform computations other than a single transfer of data the leftmost data reference must be a register identifier The register referenced is the implied destination for all results 4 3 Examples The following examples of legal and illegal expressions are intended to demonstrate the application of the above translation rules 4 3 1 Legal Expression Examples M R2 R5 The contents of register 5 is stored into the word of micromemory whose address is in the low order twelve bits of register 2 RI R2 5 XOR R3 RTL 12 a The contents of register 2 is transferred into register 1 b Five is added into the contents of register 1 c The contents of register 3 is exclusive ored into register 1 d Register 1 is rotated left by twelve bits R7 R5 R2 a The contents of register 5 is added into register 7 b The contents of register 2 is subtracted from register 7 4 3 2 Illegal Expression Examples ALPHA R R5 This expression is illegal because there is no EMMY instruction which can perform an addition directly into a micromemory cell A temporary register would be required 14 M R2 1 R5 This expression is illegal because a temporary register would be required to compute the expression R2
18. r of 1974 by the author while at Palyn Associates The compiler was completed in the first half of 1976 at Stanford 1 ELEMENTS OF THE LANGUAGE Every legal EMMYPL program is composed of a string of language elements Each element is a string of one or more EBCDIC characters The characters making up a language element must be contiguous i e no blanks may appear within an element If two elements appear side by side in a program and if the concatenation of the elements forms a legal language element then the two elements must be separated by one or more blanks Beyond these restrictions the presence or absence of blanks within a program is entirely insignificant Comments may be included in a program anywhere that a blank may appear Each comment must begin with two consecutive asterisks and end with a single semicolon A comment may contain any sequence of EBCDIC characters except the semicolon Each comment will appear in the program listing but will otherwise be ignored by the compiler 1 1 Constants 1 1 1 Syntax lt CONSTANT gt lt UNSIGNED NUMBER gt _ lt UNSIGNED NUMBER gt lt UNSIGNED NUMBER gt lt DEC_NUMBER gt lt HEX NUMBER gt lt DEC_NUMBER gt lt DEC DIGIT gt lt DEC_NUMBER gt lt DEC_DIGIT gt lt HEX NUMBER gt lt HEX DIGIT gt lt HEX NUMBER gt lt HEX DIGIT gt lt DEC DIGIT gt 0 1 2 3 4 5 6 7 8 9 lt HEX_DIGIT gt lt DEC_DIGIT gt A B C D E F 1 1 2 Semantics N
19. s a constant which specifies the absolute micromemory location address where loading should begin The statement will of course usually be a group which contains a number of statements within it The generated load module will cause the program to be placed into EMMY micromemory when loading takes place The program status would Register 0 will be initialized to begin execution at the first statement of the main program with the processor initially halted When execution is complete the processor will again be halted Register 1 is initially loaded with the address of the first unused micromemory address after the loaded program A period may optionally follow a program Soe
20. se then the second lt NL_STATEMENT gt is executed The potential ambiguity of this syntax is resolved by the rule that an ELSE is always matched with the nearest THEN preceding it Note that a lt NL_STATEMENT gt may not have a label attached to it 18 8 GROUPS 8 1 Syntax lt GROUP gt lt GR_HEAD gt END lt GR_HEAD gt DO BEGIN lt GR_HEAD gt lt STATEMENT gt 8 2 Semantics Groups provide a mechanism for combining a number of statements into one larger statement The individual statements which make up a group are executed in sequence A group which starts with the keyword BEGIN creates a new lexic level i e a new level of scope for identifiers A group which starts with the keyword DO does not create a new lexic level 19 9 WHILE GROUPS 9 1 Syntax lt WHILE_GROUP gt WHILE lt CONDEX gt lt GROUP gt 9 2 Semantics The while group allows a group to be executed iteratively as long as the lt CONDEX gt is true The lt CONDEX gt is evaluated at the top of the loop thus the group may be executed zero or more times The while group corresponds to the following flowchart lt CONDEX gt lt GROUP gt 20 10 UNTIL GROUPS 10 1 Syntax lt UNTIL_GROUP gt lt GR_HEAD gt UNTIL lt CONDEX gt 10 2 Semantics The until group allows a group of statements to be executed iteratively until the lt CONDEX gt becomes true The lt CONDEX gt is evaluated a
21. t the bottom of the loop thus the group of statements may be executed one or more times The until group corresponds to the following flowchart lt GROUP gt lt CONDEX gt FALSE PTa 11 CASE STATEMENTS 11 1 Syntax lt CASE_STATEMENT gt lt CASE HEAD gt END lt CASE_HEAD gt END ELSE lt NL_STATEMENT gt lt CASE_HEAD gt CASE lt REG ID gt OF lt CASE RANGE gt lt CASE HEAD gt lt CONSTANT gt lt CASE_HEAD gt lt NL_STATEMENT gt lt CASE_RANGE gt lt CONSTANT gt lt CONSTANT gt lt CONSTANT gt 11 2 Semantics The case statement allows the selection of a statement to be executed depending on the value held in a register Each case statement begins with a lt CASE HEAD gt The lt CASE_HEAD gt specifies the register whose value will be used to select the executed statement Also included in the lt CASE HEAD gt is the lt CASE RANGE gt The lt CASE RANGE gt specifies the range of values which the specified register may be expected to contain upon entry to the case statement If the lt CASE RANGE gt is two constants separated by a colon then it specifies the minimum value and the maximum value respectively of the register contents If the first constant and the colon are omitted zero is assumed as the minimum value This portion of the lt CASE HEAD gt is followed by zero or more statements each terminated by a semicolon Each of these statements may be preceded by
22. the conditional expression is true Otherwise the conditional expression is false lt The condition codes are examined If bit 31 is zero the conditional expression is true RI R2 AND R3 gt R4 AND R3 lt R5 If all of the comparisons are true then the conditional expression is true otherwise it is false 6 3 2 Illegal Conditional Expressions RI gt R2 AND RO 24 24 The conditional expression is illegal because it contains both an arithmetic comparison and a bit test RO 24 24 OR RO 25 25 The conditional expression is illegal because it contains both a negated bit test and a non negated bit test RO 24 24 AND RO 20 20 The conditional expression is illegal because it contains bit tests in both the CCODE field and the ICODE field RI R2 AND R3 gt R4 OR R3 lt R5 The conditional expression is illegal because it contains both the AND operator and the OR operator z472 7 IF STATEMENTS 7 1 Syntax lt IF_STATEMENT gt IF lt CONDEX gt THEN lt NL_STATEMENT gt IF lt CONDEX gt THEN lt NL_STATEMENT gt ELSE lt NL_STATEMENT gt lt NL_STATEMENT gt lt UNLAB_STATEMENT gt lt CONTROL_STATEMENT gt 7 2 Semantics The if statement permits conditional execution of statements It may take two forms In the first form if the lt CONDEX gt is true then the lt NL_STATEMENT gt is executed Otherwise no statement is executed The second form is similar but if the lt CONDEX gt is fal
23. umbers may be expressed in either decimal form or hexadecimal form Hexadecimal numbers are preceded by the pound sign Numbers may be negated by preceding them with the underscore character _ A11 numbers must have absolute magnitude less than 231 25 1 2 Identifiers 1 2 1 Syntax lt IDENTIFIER gt lt LETTER gt lt IDENTIFIER gt lt LETTER gt lt IDENTIFIER gt lt DEC DIGIT gt lt IDENTIFIER gt _ 1 2 2 Semantics An identifier is a name given to an entity within an EMMYPL program All identifiers with the exception of labels must be declared before they are referenced Identifiers are declared in data declaration state ments and procedure declaration statements 1 2 2 1 Register Identifiers The eight predeclared identifiers RO R1 R2 R3 R4 R5 R6 and R7 are names which correspond to the eight fast registers within the EMMY CPU These identifiers should not be used for any other purpose since the redefinition of these identifiers would make access to the machine registers impossible 1 2 2 2 Memory Names Any identifier which is declared in a data declaration statement without the BIT FUNCTION or FIELD attribute is a memory name A memory name is a reference to a 32 bit word within the EMMY micromemory 1 2 2 3 Field Identifiers An identifier which is declared in a data declaration statement with the BIT or FIELD attribute is a field identifier A field identifier is a reference to a bit field within
24. zero or more constants each followed by a colon Each constant must be within the bounds specified or implied by the lt CASE RANGE gt These constants indicate the values of the selecting register for which the corresponding statement should be executed If a statement has no constant attached then the value associated with the previous statement plus one is used If the first statement has no constant attached then the lower bound specified or implied by the lt CASE _RANGE gt is used oe It is possible and legitimate in a case statement to have one or more values of the selecting register which are within the lt CASE RANGE gt bounds but which do not select any of the statements to be executed If this occurs and if the case statement terminates with END only then no statement is executed and control proceeds to the statement following the case statement If however the case statement terminates with END ELSE lt NL_STATEMENT gt then the statement following the ELSE is executed The lt NL_STATEMENT gt may not have attached labels The lt CASE RANGE gt is used only for compile time generation of a jump vector No checking is performed at execution time to insure that the selecting register contains a value within the bounds set by the lt CASE RANGE gt Execution of a case statement with an out of bounds selecting register value produces unpredictable results Execution of a case statement in general alters the value co
Download Pdf Manuals
Related Search
Related Contents
FX400e Manual italiano English language 多機能シャワー vendredi 21 août Shark BG-2820 User's Manual 基本操作ガイド Owner`s Manual - Spanish Faça o do manual testo 420 Mode d`emploi Copyright © All rights reserved.
Failed to retrieve file