comp229-slide-2 - Concordia university Department of...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Lesson 2 - Assemblers 1 Concordia university Department of computer science System software – COMP229 Lesson 2 : Assemblers © Author : Kerly Titus
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lesson 2 - Assemblers 2 Assemblers Contents 1. Principles of assemblers 3 2. Machine-dependent features of assemblers 21 3. Machine-independent features of assemblers 32 4. Design options of assemblers 57 5. Key points 69 6. References 71
Background image of page 2
Lesson 2 - Assemblers 3 1. Principles of assemblers Characteristics of assemblers and assembly languages Format of an assembly language statement Introduction to the SIC assembler The assembly process
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lesson 2 - Assemblers 4 Principles of assemblers Characteristics of assemblers and assembly languages An assembler is a program that translates the symbolic statements of an assembly language program into machine code. Each symbolic statement occupies a single line and is associated with exactly one machine instruction. An assembly language is simply more convenient for the programmer than a machine language which uses binary representation. An assembly language program has access to all the features and instructions of the machine. An assembly language program is specific to a family of machines and is not portable to other machines.
Background image of page 4
Lesson 2 - Assemblers 5 Principles of assemblers Format of an assembly language statement • Label field. – The label is a symbolic name that represents the memory address of an executable statement or a variable. • Opcode/directive field. – The opcode (e.g. operation code) specifies the symbolic name for a machine instruction. – The directive specifies commands to the assembler about the way to assemble the program. • Operand field. – The operand specifies the data that is needed by a statement. • Comment field. – The comment provides clear explanation for a statement.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lesson 2 - Assemblers 6 Principles of assemblers Introduction to the SIC assembler 1 COPY START 1000 Copy a file from input to output. 2 F I R S T S T L R E T A D R S a v e r e t u r n a d d r e s s . 3 CLOOP JSUB RDREC Read input record. 4 L D A L E N G T H T e s t f o r E O F ( L E N G T H = 0 ) . 5 C O M P Z E R O 6 J E Q E N D F I L E x i t i f E O F i s d e t e c t e d . 7 J S U B W R R E C W r i t e o u t p u t r e c o r d . 8 J C L O O P L o o p . 9 E N D F I L L D A E O F I n s e r t e n d o f f i l e m a r k e r . 1 0 S T A B U F F E R 1 1 L D A T H R E E S e t L e n g t h = 3 . 1 2 S T A L E N G T H 1 3 J S U B W R R E C W r i t e E O F . 1 4 L D L R E T A D R G e t r e t u r n a d d r e s s . 1 5 R S U B R e t u r n t o c a l l e r . 1 6 E O F B Y T E C , E O F 1 7 T H R E E W O R D 3 1 8 Z E R O W O R D 0 19 RETADR RESW 1 2 0 L E N G T H R E SW 1 L e n g t h o f r e c o r d . 21 BUFFER RESB 4096 Buffer area size.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/25/2010 for the course COMP COMP229 So taught by Professor Guy during the Spring '10 term at Concordia Canada.

Page1 / 71

comp229-slide-2 - Concordia university Department of...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online