I ■ ■ ■ I 91a In ■ Dna ■ n NBA LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAICN Digitized by the Internet Archive in 2013 http://archive.org/details/ibalmanualilliac469schw Report No. U69 coo-2118-0017 IBAL MANUAL The Illiac III Basic Assembler Language by John C. Schwebel revised by Ahmad E. Masumi July, 1971 DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN URBANA, ILLINOIS DIVERSITY QF ILLINOIS CAMPAIGN -9 COO-2118-0017 Report No. U69 IBAL MANUAL* The Illiac III Basic Assembler Language by John C. Schwebel revised by Ahmad E. Masuml July, 1971 Department of Computer Science University of Illinois Urbana, Illinois 6l801 ^Supported in part by Contract AT ( 11-1 ) -2118 with the United States Atomic Energy Commission. % C*# IBAL MANUAL Table of Contents 1. Introduction 2. Definition of the Language 2.1 Terminal Symbols 2.2 Basic Elements 2.3 Program Structure 2.k Declarations 2.5 Instructions 2.6 Commands 2.7 Directives 3. Segmentation 3.1 Procedure Segments 3.2 Data Segments 3.3 Storage Attributes 3.k Intersegment Communication h. Pointer Register Allocation Appendix 1 - The 60 Character Set Appendix 2 - Reserved Words Appendix 3 - Complete IBAL Syntax Appendix k - Sample Program Segment Appendix 5 - Instruction Mnemonic Code Date: 8/1+/71 Section: Table of Contents Page 1 of 1 Revision: IBAL MANUAL 2. Definition of the Language Contents 2.1 Terminal Symbols 2.1.1 Basic Characters 2.1.2 Compound Punctuations 2.1.3 Reserved Words 2.2 Basic Elements 2.2.1 Comments and Blanks 2.2.2 Identifiers 2.2.3 Unsigned Integers 2.2.U Constants 2.2.5 Literals 2.2.6 Self-Defining Values 2.2.7 Expressions 2.3 Program Strucutre 2.3.1 Blocks 2.3.2 Procedures 2.3.3 Scope 2.3.1+ Storage Allocation 2.1+ Declarations 2.14.1 Attributes 2.1+.2 Conditional Format Item 2.1+.3 Structure Declaration and the LIKE Attribute 2.5 Instructions 2.5.1 Pointer 2.5.2 Operand 2.5.3 Data Transfer 2.5.1+ Stack Utility, Logical and Shift 2.5.5 Decision 2.5.6 Utility 2.5.7 List Processing Date: 8/1+/71 Section: 2 Outline Page : 1 of 2 Revision: IBAL MANUAL 2.5.8 Imprimitive Instruction 2.5.8.1 Asynchronous Information 2.5.9 System Instructions 2.5.9.1 Supervisory 2.5.9.2 Interrupt 2.5.9.3 Input /Output 2.5.9.U Coordinating 2.5.9.5 Timing 2.5.10 Arithmetic 2.5.11 Pattern Articulation 2.5.11.1 Boole Function 2.6 Input /Output 2.6.1 Interrupt Command 2.6.2 Device Dependent Command 2.6.3 Device Independent Command 2.7 Directives 2.7.1 Control Directive 2.7.2 Assignment Directive 2.7.3 Source Format Directive 2.7. ^ Assembler Directive Date: 8 A/71 Section: 2 Outline Page: 2 of 2 Revision: IBAL MANUAL 1. Introduction This manual describes IBAL, the Illiac III Basic Assembler Language. It is intended that IBAL will be the lowest level language used for Illiac III programs. With suitable constraints upon the naming of operands, each primitive operation in IBAL directly corresponds to ""-pne Illiac III machine instruction. The reader should be familiar with ,the Illiac III machine instructions and their formats as given in the Illiac III Reference Manual [ 1 ] . It is possible to specify information structures more general than those of the machine instructions. A statement in IBAL may be a block, declaration, instruction or directive. Blocks permit the specification of nested structures of statements. Declarations allow specification of generalized tree-structured data sets whose irreducible constituents are the smallest addressable basic elements of the machine. The block structure of IBAL corresponds to the block structure of ALGOL 60 [2] and PL/l [3]. The declarations of IBAL are based on those given in [U] . In comparison to other programming languages usually classified as "assembler languages", IBAL allows very general data declarations. It is believed that this capability is essential to any 'programming language adequate to provide a target language for the translation of procedure- oriented languages having the complexity of PL/1. Date: 3/26/71 Section: Introduction Page: 1 of 1 Revision: IBAL MANUAL 2. Definition of the Language Syntax is described in this report by metalinguistic formulae with a metalinguistic variable on the left-hand side of the symbol ": :=" and a concatenation of metalinguistic variables, symbols or operators on the right-hand side. A metalinguistic variable has the form: . Its values are finite sequences of symbols. The metalinguistic operators used and their meaning follows: Operator Meaning Logical OR; the element on the left or the right of the vertical stroke is selected. { } Only one of the elements within the brackets is to be selected. [ ] The element within the bracket may occur once or not at all. The element within the brackets may occur any finite number of times. |_L _JJ The element within the brackets may occur any finite non-zero number of times . Any character in a formula which is not a metalinguistic variable or operator denotes itself. A syntactically correct program is generated from the basic variable by replacing it with the right-hand side of any formula in which this variable appears as a left-hand member. Then by continued replacement of variables, a string of symbols, all of which denote themselves is obtained. Date: 2/9/68 Section: 2 Page: 1 of 2 Revision: IBAL MANUAL Examples: = | generates or = [] generates , or concatenated with « •-= J _ _[ generates concatenated with an arbitrary number of « = JJ_ Jl generates - Date: 2/26/68 Section: 2 Page: 2 of 2 .Revision: IBAL MANUAL 2-1 Terminal Symbols The terminal symbols in IBAL are all those elements which denote themselves in a syntax formula(and occur only on the right of such formulae) These symbols are thus terminal elements in the language. A terminal symbol may be a basic character, a compound punctuation, or a reserved word Date: 2/9/68 Section: 2.1 Page: 1 of h Revision: IBAL MANUAL 2.1.1 Basic Characters : := $|#| @| a|b| c|d|e|f|g|h|i|j|k|l |m|n|o|p|q|r|s|t|u|v|w|x|y|z : := 0|l|2|3|U|5|6|T|8|9 ::= |=| + |-|*|/|(|)|,|.|'|^ U|:H<l>l ::= single space ::= alphabet ic> | : := < alphanumeric> -special character> The character set is the same as the 60 character set of PL/l and is given in Appendix 1. There are 29 characters defined as alphabetic characters : Letters A through Z and the three characters $, @, and #. Decimal digits constitute the ten numeric characters . Finally, the character set is supplemented by 21 special characters . The language character * |' is denoted by 'f' in the syntactic formulae to distinguish it from the metalanguage character ' | ' . Date: 7/26/71 Section: 2.1 Page 2 of h Revision: IrAL MANUAL 2.1.2 Compound Punctuations A compound punctuation is a predefined pair of special characters appearing immediately adjacent to each other. All the compound punctuations are listed below: comment delimiters: /* V PR allocation operator: -> relational operators: : <= >= -?= ~i< -|> Date: 8A/70 Section : 2.1 Page: 3 of h Revision: IBAL MANUAL 2.1.3 Reserved Words Reserved words are predefined strings of immediately adjacent alpha- numeric characters. A reserved word may only be used in those places in the pro- gram where it is explicitly permitted by a syntactic formula. All the reserved words in IBAL are listed in Appendix 2. Examples: BEGIN PROCEDURE PUSH END Date: 8 A/70 Section: 2.1 Page: U of U Revision : IBAL MANUAL 2 .2 Basic Elements 2.2.1 Comments and Blanks ::= /* */ A comment is a string of basic characters not including */ which is delimited by /* and */. Comments are reproduced on the listing but otherwise have no effect on the program. For simplicity, the syntactic formulae in this manual do not specify where comments or blanks may occur. The syntactic rules concerning the use of comments and blanks are given below. These rules apply to all places in a pro- gram except within a character constant. IBAL is a free format language. This means that wherever one blank is allowed, any number of blanks may be used. A comment may be used wherever a blank is permitted. A blank is not permitted within a compound punctuation, an identifier or within a construct made up of alphanumeric characters. A blank is required to separate two alphanumeric constructs. A blank is permitted in all other places. Date: 8 A/70 Section: 2.2 Page: 1 of 10 Revision: IBAL MANUAL 2.2.2 Identifiers : : - j {[-] An identifier is a string cf maximum length 31 over the set of alpha- numeric characters and the "break character. The first character must be alpha- betic. The syntactic class, identifier, includes the following language ele- ments: label name reserved word symbol parameter event name task name entry name Date: 3/26/71 Section: 2.2 Page: 2 of 10 Revision : IBAL MANUAL 2.2.3 Unsigned Integers ::= | An unsigned integer is a string of decimal digits of maximum length 5 in the range to 65,535 (2-1). Examples: Identifiers: BA13D #5B ABC is one identifier AB C are two identifiers X+Y is equivalent to X + Y /* is a compound punctuation / * are two operators 26A is not an identifier 26 is an unsigned integer ABC Date: 2/9/68 Section: 2.2 Page: 3 of 10 Revision: IBAL MANUAL 2.2.U Constants ::= S | L |F | D : : ---■ |a|b|c|d|e|f : := o|l . : -- +| ■ • exponent> ::- E [] ::- S [] ::- [] {^unsigned integer> [.] [] | Xunsigned integer>} [] : . - I J [] : : - |[ J [] ::- - ' ' ' | , J 'B ' i , J 'X | - ' j| J[ 'F [] i distant flag bits> n tant flag t coristant> : ft sons tant specifics a character string or a hexadecimal, binary, or Lmal number to be c bed to the Illiac III internal representation. The number of bytes used for any constant is determined and the binary representa- tion of the constant is i in the data bits of the bytes. The constant flag bits which s> e specified are placed in the flag bits of the bytes. If the specification of either the constant data bits or the constant flag bits are omitted, then tlierse bits are set to zero. Th' Lstant flag bits which are specified are used repeatedly from left to right, to set the flags in all the bytes used by the immediately pre- seclmg cons tant da J :a bits . Date: 2 /9/68 Section: 2.2 Page : h of 10 Revision IBAL viANUAL Examples : constant bytes used flag bits 'ABC '101' F 3 10 1 «98AO'X *01» F 2 1 'AJKGLSP' '10' F 7 1010101 '0A1F2VX 3 A character string constant consists of a string of basic characters, with quotation marks occuring only in adjacent pairs, delimited by a quotation mark on the left and on the right. Each pair of quotation marks is interpreted as one quotation mark to be placed in the store. A single quotation mark is interpreted as the delimiter terminating the character string. The eight bit code for each character, including blanks, is placed in each byte in the store. A comment that is inserted within a character string will not be recognized as a comment but will be considered to be part of the character string data. A binary constant or a hexadecimal constant consists of a string of binary numbers or hexadecimal numbers separated by commas , enclosed in quota- tion marks, and followed by B or X respectively. A binary number is a string of bits followed by an optional scale field. A hexadecimal number is a string of hexadigits followed by an optional scale field. The scale field specifies a decimal integer. A positive integer adds binary or hexadecimal zeros to the right of the number, and a negative integer adds binary or hexadecimal zeros to the left of the number. The number is transformed to an unsealed number before the binary representation is placed in the store. If an unsealed binary number does not consist of a multiple of 8 bits, then zeros are inserted to the left of the number until it does. Two hexadigits in a hexadecimal number correspond to one byte in the store. If an unsealed hexadecimal number consists of an odd number of hexadigits, an additional zero hexadigit is added to the left end. The U-bit code for each hexadigit is placed in the store. A decimal constant consists of a decimal number followed by a letter indicating the number type. A decimal number may contain a decimal point, and may be preceded by a sign. Decimal numbers may be followed by an exponent which represents a decimal integral power of 10 by which the number is multi- plied before conversion. Date : 8/U/T0 Sect ion: 2.2 Page : 5 of 10 Revi sion IBAL MANUAL Number type D specifies that the decimal number is to be converted to the double-word decimal representation. The decimal point and exponent are ig- nored* The leftmost byte contains the U-bit sign code. Then up to ik most significant digits are right justified within the double word and padded with zeros on the left, if necessary, to fill seven bytes. Number types S or L specify the short (half-word) or long (full-word) fixed point binary representation. The decimal number is converted to a decimal integer by rounding and truncating if any fractional part remains after adjust- ment by the exponent. Then the decimal integer is converted to the 2-byte or U-byte binary integer representation. Number type F specifies the double-word floating point binary represen- tation. The decimal number is converted to a normalized binary fraction. If necessary, rounding and truncation are performed on the rightmost portion of the fraction. Then the normalized double-word floating point form is placed in the store. Examples: Character string constants: 'ABD' 'E?+' '* ' ' ' binary constants: '101'B '11001S3'B ' 00,01,10,11' B hexadecimal constants: '1A3,4FB'X 'ACB S-1'X ' 12 ' X decimal constants: 253. 9I+ D .2|?E2 S -U.3E-6F 68 s 1000 L Date: 2/9/68 Section: 2,2 Page: 6 of 10 Revision: IBAL MANUAL 2.2.5 Literals ::= = A literal specifies a program constant in a decimal, binary, hexadeci- mal, or character form. When a literal is used as operand, the constant is as- sembled in an area of fast storage called the literal pool and a pointer to the literal replaces the literal in the program. If identical literals are defined within the same program, the pointers are the same. The literal pool is con- sidered as data which is global to the program. The method of specifying a lit- eral is by an equal sign preceding a constant. Date: 2/9/68 Section: 2.2 Page: 7 of 10 Revision: IBAL MANUAL 2.2.6 Self -Defining Values ::= '' B '' X '' C A self-defining value is used alone or in an expression to denote a positive integer value. An unsigned integer expresses a decimal value. A bi- nary number expresses a binary value. A hexadecimal number expresses a hexa- decimal value. A character string expresses the binary value obtained by con- "16 verting each character to its 8-bit code. The value is evaluated modulo 2 l6 Thus the integer value is in the range to 2 -1. Examples: self-defining value binary equivalent 9 1001 1 11011 ' B 11011 'AlB'X 101000011011 Date: 2/9/68 Section: 2.2 Page: 8 of 10 Revision: IBAL MANUAL 2.2.7 Expressions