By now you should be familiar with the following terms to continue to the next lesson.
Symbolic Programming Language
Source Module, Object Module, Load Module, and Program Listing.
Byte and Bit Level
Machine Instructions, Assembler Instructions, Macro Instructions, and Macro Definitions.
Now let us start the second lesson?
Coding And Structure
Assembler Language Coding Convention:
Assembler Language statements usually occupy 80-Character line. Each line is divided into three main fields.
Continuation Indicator Field and
Identification Sequence Field
1234??????????????71 72 737475????.?80
Statement Field Continuation Identification Sequence
Indicator Field Field
Statement Field: The instructions and comment statements must be coded in Statement Field.
Continuation Indicator Field: The standard position of continuation field is column 72. A non-space character in this column indicates that the current statement is continued in the next line.
Note: The continue column is 16.
Identification Sequence Field: The Identification Sequence field can contain Identification characters or sequence numbers or both. If the ISEQ instruction has been specified to check this field, the assembler verifies whether or not the source statements are in correct sequence.
Continuation Line: To continue a statement in another line
1) Enter a non-space character in continuation indicator field (column 72). This non-space character must not be a part of the statement coding.
2) Continue the statement in next line starting from column 16. Columns to the left of column 16 should be spaces.
Note: If an operand is continued after column 16, it is taken to be a comment.
Blank Line: Blank lines are accepted in source programs.
Comment Statements: Comment statements require asterisk in the beginning of the column. Internal Macro definition comment statements require a period followed by asterisk. Internal macro comments are accepted as comment statements in open code.
Instruction Statement Format: Instruction Statement must consist of one to four entries in the statement field.
A Name Entry
An Operation Entry
An Operand Entry and
These entries must be separated by one or spaces, and must be written in order stated.
COMP CR 5,6 NEW SUM TO OLD.
Name Operation Operand Remarks
The symbol comp names the comparison instruction. The operation entry CR is the mnemonic operation code for register-to-register compare operations and the two operands (5,6) designate the two general registers, whose contents are to be compared. The Remarks instruction reminds the user that this instruction compares NEW SUM TO OLD.
Name Entry: Name entry is a symbol created to identify the instructions. Name entry is optional. If coded, should start from column 1, otherwise it is assumed no Name Entry. The symbol must consist of 63 or fewer alphanumeric characters.
Operation Entry: The operation entry is a symbolic operation code specifying the machine, assembler or macro instruction operation. An operation entry is mandatory and must appear in the same line if name specified.
Operand Entry: Operand Entries contain zero or more operands that identify and describe the data to be acted upon by the instruction. Commas separate operands and no spaces are allowed between operands and the commas that separate them.
Example: The following instruction is correct:
LA R1,4+5 NO SPACE
The following is wrong
LA R1,4 + 5 SPACES INCLUDED.
Note: Spaces inside the enclosed quotation is not wrong.
Topics to learn in next class are
Assembler Language Structure
Terms, Literals and Expressions.