Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Assembler: Role in Translating Source Code to Object Code, Summaries of Systems Design

An overview of the role of an assembler in translating mnemonic language code to its equivalent object code. It explains the basic features of an assembler, the functions it performs during the translation process, and the use of assembler directives. The document also includes examples of object codes and their corresponding source codes.

What you will learn

  • What are assembler directives and how are they used?
  • What are the basic features of an assembler?
  • How does an assembler translate symbolic operands to their equivalent machine addresses?

Typology: Summaries

2021/2022

Uploaded on 10/15/2022

gaurangi-tyagi
gaurangi-tyagi 🇮🇳

1 document

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Assemblers
Prepared By: Dr. D. P. Singh
pf3
pf4
pf5
pf8

Partial preview of the text

Download Assembler: Role in Translating Source Code to Object Code and more Summaries Systems Design in PDF only on Docsity!

Assemblers

Prepared By: Dr. D. P. Singh

Basic Assembler Features

Assembler Object Program

  • Translating mnemonic language code to its equivalent object code.
  • Assigning machine addresses to symbolic labels.

Source Program

Simple SIC Assembler

The translation of source program to object code requires to

accomplish the following functions

  1. Convert mnemonic operation codes to their machine language

equivalents

  1. Convert symbolic operands to their equivalent machine addresses
  2. Decide the proper instruction format
  3. Convert the data constants to internal machine representations
  4. Write the object program and the assembly listing

All of these functions except 2 can easily be accomplished by

sequential processing of the source program one line at a time

Forward Referencing

PROG START 1000

1000 LDA FIVE

1003 STA ALPHA

1006 LDCH CHARZ

1009 STCH C

100C ALPHA RESW 1

100F FIVE WORD 5

1012 CHARZ BYTE C’Z’

1013 C1 RESB 1

END

Because of Forwarding Referencing

most assemblers make two passes over

the source program

First pass: scan the source program for

label definitions and assign addresses

Second pass: perform actual

translation

In addition to translating the instructions of the source

program, assembler must process the assembler

directives.

Finding Object Codes cntd…

Example 2

PROG2 START 0

0000 LDT(74) #11 75000B

0003 LDX(04) #0 050000

0006 MOVECH LDCH(50) STR1,X 53A

0009 STCH(54) STR2,X 5 7A

000C TIXR(B8) T B

000E JLT(38) MOVECH 3B2FF

0011 STR1 BYTE C’TEST STRING’ 54455354205

35452494E

001C STR2 RESB 11

END

disp= TA- (PC)

disp= TA- (PC)

=001C-000C=

disp=TA-(PC)

=-000B

2’s complement

= FF

Size of the Program=0027-0000=0027(in Hex)

Thank You