Sie sind auf Seite 1von 13

Ques.no.1: Describe different types of Assemblers.

Ans.1: Types of Assemblers:


The assemblers are broadly classified namely:
Single pass assemblers
Two pass assemblers
Multi pass assemblers
Each reading of a program can be called as a pass.
Single pass Assemblers:
The entire translation of assembly language program into
object program is done in only one pass and the source
program is read only once. These are called to be single pass
assemblers. It is faster as it scans the program only once.
In this type of assemblers the object code are produced in two
different ways.
1. The object code is directly loaded into the main memory
for execution. Here, no loader is required. This type of
loading scheme is called compile and loading scheme.
2. The object program will be loaded into the main memory
for execution later as necessity arises. Here, a separate
loader program is necessary.
Handling the forward reference in a single pass assembler is
difficult. However it is handled to some extent. As assembler
scans the source program, instruction by instruction and
translates to machine codes. If any forward reference
instruction found, the assembler leaves the address of that
particular symbol and proceeds further. That symbol is entered
in the symbol table and marked as undefined. When the symbol
definition is encountered the assembler inserts the address in
the symbol table. The assembler also inserts the address to the
instructions, which use this symbol in the list of forward
references. Its how forward reference problem is handled in
single pass assembler in a single pass.
Two pass Assemblers:
It is the most widely used assembler where translation of
source program is done in two passes.
1. It collects all labels.
2. It produces the machine code for each instruction and
assigns address to each of them. It assigns addresses to
labels by counting their position from the starting address.

In this the problem of forward references is solved conveniently.


It provides many features than the single pass assembler.
Multi pass Assemblers:
In multi-pass assemblers the translation of the assembly
language program is done in more than two phases. In
assemblers, the passes are necessary to handle the forward
reference problem. In order to process the entire symbol
definitions several passes are made over the source program
by multi pass assemblers.

Ques.no.2: What is language Processor? Explain the two


Language processing activities.
Ans.2: Language Processor:
A language processor is software which bridges a specification
or execution gap. The program which inputs to the language
processor is called source program and to its output as the
target program. The languages in which these programs are
written are called source language and destination language
respectively. A language processor leaves the generation of
target program if it detects errors in the source program.
For example,
A language translator bridges the execution gap to the
machine language of a computer system.
The language migrator bridges the specification gap
between two programming languages.
The detranslator bridges the same execution gap as
language translator but in reverse direction.
The two language processing activities are namely:
1. Program Generation Activities
2. Program Execution Activities
Program generation activity aims at automatic generation of a
program. While a program execution activity organizes the
execution of a program written in a programming language in a
computer system.
1. Program Generation:
It is a software system that accepts the specifications of a
program to be generated, and generate the program in
target programming languages. Program generator is the
middleware between program generator and application.
Specification gap is the gap between application domain and
program generating domain.
The generator is Bridging the gap to the Programming
Language domain. The compiler or interpreter for the PL
bridges the execution gap between the target PL domain and
execution domain.
2. Program Execution:
In this Translation and interpretation are the two general
models.

Program translation: It bridges the execution gap by


translating a program written in a PL, called the source
program, into an equivalent program in the machine or
assembly language of the computer system called target
program.

Characteristics:
A program must be translated before it can be executed.
The translated program saved in a file may be executed
repeatedly.
Program must be retranslated by following the
modifications.

Program
interpretation:
During
interpretation,
interpreter reads a statement, determines its meaning and
performs actions which implement it and stores it in
memory. This includes computational and input-output
actions.

Program interpretation cycle consisting of following steps:


Fetch the statements.
Analyze the statement and find out its meaning, the
computation to be performed and its operands.
Execute meaning of the statement.

Ques.no.3: What is an assembly language? Explain its


basic features. State the advantages and disadvantages
of coding in assembly language.
Ans.3: Assembly Language:
An assembly language is a machine dependent, low level
programming language, specific to a certain computer system
or a family of computer systems. Assembly language uses
mnemonic codes to represent the low-level machine
operations. These instructions should be converted into
machine instruction for further processing.
The program or system software that translates Assembly
Language into machine language is termed to be an assembler.
Translation of assembly language into low level binary codes is
done by the assembler. Its function is to get assembly language
as input and convert it to corresponding object program.
Basic features of assembly language:
Comparing to the machine languages of a computer system,
assembly language provides three basic features that simplify
programming namely:
Mnemonic operation codes: Mnemonic operation
codes or mnemonic opcodes used for machine
instructions eliminates the need of memorizing
numeric operation codes. It also enables the assembler
to provide helpful diagnostics, for example indication
of misspell of operation codes.
Symbolic operation codes: Symbolic names can be
associated with data or instructions. These symbolic
names can be used as operands in assembly
statement. The assembler performs memory bindings
to these names. The assembler performs memory
bindings to the names, for that there is no need for the
programmer to know any details of the memory
binding performed by the assembler.
Data declarations: Data can be declared in a variety
of notations, including the decimal notation. This
avoids manual conversion of constants into their
internal machine representation. For example,
conversion of -5 into (11111010)2 or 10.5 into
(41A80000)16, i.e. converting to binary or hexadecimal
form.

The various advantages and disadvantages of coding


in assembly language are mainly:
Advantages:
It provide more control over handling particular
hardware components
It may generate smaller, more compact executable
modules
It often results in faster execution.
Disadvantages:
It is not portable
It is more complex
It requires understanding of hardware details.

Ques.no.4: List and explain the various issues which


must be considered to make device drivers portable
across CPU architectures.
Ans.4: Various CPU issues that influence device driver
design are:
It should be first kept in mind that, a device driver must be
designed so that it can accommodate peripheral devices to
operate on one or more than one CPU architecture. Issues that
must be considered to make drivers portable across CPU
architectures are:
i.
ii.
iii.
iv.
v.
vi.

Control Status register(CSR) access


I/O copy operation issues
Direct Memory Access(DMA) operation issues
Memory mapping issues
64-bit versus 32-bit
Memory barriers issues
i. Control status register(CSR) access:
Based on UNIX operating system, many device drivers access a
devices Control Status Register (CSR) addresses directly
through a device register structure. Where some CPU
architectures do not allow to access the device CSR addresses
directly.
ii. I/O copy operation issues:
Due to the differences in CPU architectures, I/O copy operations
get differs from one device driver to another. If techniques
other than the generic kernel interfaces are used that provides
digital technology for performing I/O copy operations, it is not
possible to write one device driver to operate on or more than
one CPU architecture or CPU type within the same architecture.
iii. Direct Memory Access(DMA) operation issues:
Because of the different types of buses used and of the DMA
hardware support features the Direct Memory Access (DMA)
operations can differs from one device driver to another.
iv. Memory mapping issues:
Some of the CPU architectures do not support an application's
use of memory map section, for that one should design the
device driver suitable for different types of memory map
section deployed to handle applications in different types of OS
and for the one that do not use memory map section also.

v. 64-bit versus 32-bit:


It should be mainly consider while declaring data types for 32bit and 64-bit CPU architectures. Lots of attention should be
paid to the data types as to make the device drivers to work on
both 32-bit and 64-bit systems.
vi. Memory barriers issues:
In some architecture of computer system, a CPU performs
independent memory operations in random order without any
problem, but this can be a problem for CPU-CPU interaction and
for I/O. For that Memory barriers (mb) are such interventions
that instruct the CPU to restrict the order over the memory
operations.

Ques.no.5:
Libraries.

Explain

briefly

Android

Architecture

Ans.5: Android Architecture Libraries:


In Android architecture, libraries include the Surface Manager,
Media Framework, WebKit, SQLite, OpenGL/ES, FreeType, SGL,
SSL, and Libc, as described below:
Libc: Libc is the standard C library that is tuned for
embedded devices.
SSL: It is a Secure Sockets Layer cryptographic protocol
for secure internet communications.
SGL: SGL is a scalable graphic library or also called clear
graphic library that gives the underlined 2D graphic
engine.
OpenGL/ES: OpenGL/ES is a 3D library, supports the CD
graphics which is based on OpenGL1.O.
FreeType: Freetype is used for bitmap and vector font
rendering. FreeType is a free, high quality and portable
font engine.
WebKit: It is the open source browser engine, used as a
core of Androids browser. It acts as the webrendering
engine that powers the default browser.
SQLite: It is the basic datastore technology for the
Android platform and is very lightweight relational
database engine that manages access to display
subsystem.
Media Frame work: The Media Framework was provided
by Packet Video, one of the members of the open handset
alliance and that contains the entire codex that make up
the core of the media experiences.
Surface Manager: The surface manager is responsible
for composing different drawing surfaces on to the screen.
LibWebCore: LibWebCore is a modern web browser
engine that gives us embeddable web view.
Media Libraries: Media libraries are based on
PackerVideosOpenCORE. So these libraries support
playback as well as recording of many popular audio and
video formats like MPEG4, H264 and MP3.
Android Runtime: The Android runtime layer includes
set of base libraries that are required for java libraries.

Core Libraries: Core Libraries are written in the Java


programming language, contains all of the collection
classes, utilities, I/O, all the utilities and tools that you use.
Dalvik Virtual Machine: Android based systems utilize
their own virtual machine, known as the Dalvik Virtual
Machine (DVM). It is extremely low-memory based virtual
machine, which was designed especially for Android to run
on embedded systems and work well in low power
situations.
The Bionic Library: Compared to Linux, Androids
incorporates its own c library known as Bionic library. The
Bionic library is not compatible with the Linux glibc and
has a smaller memory footprint.

Ques.no.6: Write the steps for addressing UPnP device


with proper flowchart.
Ans.6: The Steps for addressing UPnP devices with
proper flowchart:
All UPnP devices must follow the same steps in acquiring an IP
address.
Steps:
Steps for addressing UPnP devices are described below:
Step 1: Try to obtain an address via DHCP
I. An UPnP device must try to get an address from a
DHCP server.
II. If the device successfully acquires an address, it is
ready to continue with subsequent UPnP phases
Step 2: Failing DHCP, proceed with Auto-IP
If the UPnP device fails to acquire an address from a DHCP
server, it begins the process of selecting and testing an IP
address.
Step 2(a): Choose an IP address- Clients
implementing Auto-IP are expected to randomize
their IP address selection algorithm so as to help
keep clients from becoming stuck in a loop with
other clients while trying to allocate an address.
Step 2(b): Test whether the address is
available- When using Auto-IP to select an
address, the client tests to determine whether the
address is already in use. If so, the client chooses
another address and tries again.
Step2(c): Periodicity check for a DHCP
server- Whenever there is the availability of the
DHCP server, the devices must switch to a DHCP
assigned address. UPnP devices configured using
Auto-IP must therefore periodically test for the
availability of a DHCP server. When rechecking, if
the device determines that no DHCP server is
available, it waits for a period of time and then
tries again.
Step 2(d): Upon finding a DHCP server,
switch to a DHCP- assigned address- After
receiving a response from a DHCP server, the UPnP

device must respond and obtain a lease from the


server. If the client successfully obtains the lease,
it must drop any existing automatically configured
IP addresses unless the device supports multiple
addresses on the interface being configured.

Flow Chart: The steps, as specified by the UPnP device


architecture, are presented in the below flowchart.

STAR
T
Get addresses using
DHCP?
No

Choose an IP
address.
No

No

Is the address available?

DONE
Yes
Yes
Assign self chosen
address.

Sleep
No
Is DCHP server
available?

Das könnte Ihnen auch gefallen