Board Ques Solution - 3
Board Ques Solution - 3
[2014]
Assembly Language:
2. Short note: Assembler, Complier, Linker, Debugger, Editor [2014][IST model test]
Assembler: A computer will not understand any program written in a language, other than
its machine language. The programs written in other languages must be translated into the
machine language. Such translation is performed with the help of software. A program
which translates an assembly language program into a machine language program is called
an assembler. If an assembler which runs on a computer and produces the machine codes
for the same computer then it is called self assembler or resident assembler. If an assembler
that runs on a computer and produces the machine codes for other computer then it is
called Cross Assembler.
Assemblers are further divided into two types: One Pass Assembler and Two
Pass Assembler. One pass assembler is the assembler which assigns the memory addresses
to the variables and translates the source code into machine code in the first pass
simultaneously. A Two Pass Assembler is the assembler which reads the source code twice.
In the first pass, it reads all the variables and assigns them memory addresses. In the
second pass, it reads the source code and translates the code into object code.
Compiler: It is a program which translates a high level language program into a machine
language program. A compiler is more intelligent than an assembler. It checks all kinds of
limits, ranges, errors etc. But its program run time is more and occupies a larger part of
the memory. It has slow speed. Because a compiler goes through the entire program and
then translates the entire program into machine codes. If a compiler runs on a computer
and produces the machine codes for the same computer then it is known as a self compiler
or resident compiler. On the other hand, if a compiler runs on a computer and produces
the machine codes for other computer then it is known as a cross compiler.
Linker: In high level languages, some built in header files or libraries are stored. These
libraries are predefined and these contain basic functions which are essential for executing
the program. These functions are linked to the libraries by a program called Linker. If
linker does not find a library of a function then it informs to compiler and then compiler
generates an error. The compiler automatically invokes the linker as the last step in
compiling a program.
Not built in libraries, it also links the user defined functions to the user
defined libraries. Usually a longer program is divided into smaller subprograms called
modules. And these modules must be combined to execute the program. The process of
combining the modules is done by the linker.
Editor:
An editor may refer to any of the following:
1) In general, an editor refers to any program capable of editing files. Good examples
are image editors, such as Adobe Photoshop, and sound editors, such as Audacity.
2) The term editor is commonly used to refer to a text editor, which is a software
program that allows users to create or manipulate plain text computer files. They
are often used in the field of computer programming.
Debugger:
Hardware Interrupts :
i) Maskable Interrupts
The processor has the facility for accepting or rejecting hardware interrupts. Programming the
processor to reject an interrupt is referred to as masking or disabling and programming the
processor to accept an interrupt is referred to as unmasking or enabling. In 8086 the interrupt flag
(IF) can be set to one to unmask or enable all hardware interrupts and IF is cleared to zero to
mask or disable a hardware interrupts except NMI. The interrupts whose request can be either
accepted or rejected by the processor are called maskable interrupts.
The interrupts whose request has to be definitely accepted (or cannot be rejected) by the
processor are called non-maskable interrupts. Whenever a request is made by non-maskable
interrupt, the processor has to definitely accept that request and service that interrupt by
suspending its current program and executing an ISR. In 8086 processor all the hardware
interrupts initiated through INTR pin are maskable by clearing interrupt flag (IF). The interrupt
initiated through NMI pin and all software interrupts are non-maskable.
Software Interrupts:
The software interrupts are program instructions. These instructions are inserted at desired
locations in a program. While running a program, if software interrupt instruction is encountered
then the processor initiates an interrupt. The 8086 processor has 256 types of software interrupts.
The software interrupt instruction is INT n, where n is the type number in the range 0 to 255.
Segmentation is the process in which the main memory of computer is divided into
different segments and each segment has its own base address. Segmentation is used to
increase the execution speed of computer system so that processor can able to fetch and
execute the data from memory easily and fastly.
Advantages of segmentation :
1. Allows the memory capacity to be 1 Mbyte although the actual addresses to be handled
are of 16-bit size
2. Allows the placing of code data and stack portions of the same program in different
parts (segments) of memory, for data and code protection.
3. Permits a program and/ or its data to be put into different areas of memory each time
program is executed, ie, provision for relocation may be done.
Memory Segmentation is the process in which the main memory of computer is divided
into different segments and each segment has its own base address. Segmentation is used to
increase the execution speed of computer system so that processor can able to fetch and
execute the data from memory easily and fastly.
Segmentation in 8086 :
1. The size of address bus of 8086 is 20 and is able to address 1 Mbytes ( ) of physical
memory.
2. The compete 1 Mbytes memory can be divided into 16 segments, each of 64 Kbytes size.
Types of Segmentation:
overlapping segment:
A segment starts at a particular address and its maximum size can go up to 64 Kbytes. But
if another segment starts along this 64 Kbytes location of the first segment, the two
segments are said to be overlapping segment. • The area of memory from the start of the
second segment to the possible end of the first segment is called as overlapped segment.
A segment starts at a particular address and its maximum size can go up to 64 Kbytes. But
if another segment starts before this 64 Kbytes location of the first segment, the two
segments are said to be Non- overlapping segment.
Transfers a byte or word between a register and a memory location addressed by an index
or base register
The address of the memory location where the operand resides is held by a register.
The registers used for this purpose are SI, DI, and BX
They must be combined with DS in order to generate the 20-bit physical address .
8. Define and Explain the importance of addressing mode.[2010,2 a][2013,2c]
An addressing mode means the method by which an operand can be specified in a register
or a memory location.
Advantage:
1. Addressing modes are an aspect of the instruction set architecture in most central
processing unit (CPU) designs.
2. The various addressing modes that are defined in a given instruction set
architecture define how machine language instructions in that architecture identify
the operand (or operands) of each instruction.
3. An addressing mode specifies how to calculate the effective memory address of an
operand by using information held in registers and/or constants contained within a
machine instruction or elsewhere.
4. Addressing modes helps the programmer to store or retrieve the data which is
stored in any part of the data memory.
5. In computer programming, addressing modes are primarily of interest
to compiler writers and to those who write code directly in assembly language.
9. What are the function of the control bits in the flag register of intel 8086?[2011,2
c][2013,2 b]
10. Describe the bus control signals generated by Intel 8086 in minimum mode.[2013,4b]
Microcontrollers are the devices that actually fit the profile “Computer – on – a chip” as it
consists of a main processing unit or processor along with some other components that are
necessary to make it a complete computer. The components that are present on a typical
microcontroller IC are CPU, memory, input / output ports and timers.
PLA has both programmable AND and OR planes whereas PAL has only
programmable AND planes and OR plane is fixed
PLA has more flexibility in the logic circuit function implementation than PAL
PAL is simpler to manufacture than PLA
PLA have reduced speed performance
PAL devices are manufactured in smaller size.
13. Define Microprocessor? What are the salient features of fourth and fifth generation
microprocessor?[IST][2013]
4th Generation:
5th Generation:
2nd Generation:
3rd Generation:
5th Generation:
17. Define base pointer and stack pointer? Write down the read and write operation of
stack pointer?[2014 ,1b][IST,1c]
Stack Operation:
1. Processor state is saved on the stack when changes in program flow occur. The
68HC05 has a 64-byte hardware-controlled stack. Reset initializes the stack pointer
to 00FF; the RSP instruction does the same. No other instructions allow direct user
manipulation of the stack.
2. When a byte is 'pushed' onto the stack, it is written to the location pointed to by the
stack pointer, and then the stack pointer is decremented by one. When a byte is
'pulled' from the stack, the stack pointer is incremented by one, and the location
pointed to by the stack pointer is then read.
3. When the stack pointer is at 00C0, the next push will store a byte at 00C0 and roll
the stack pointer to 00FF. This is stack pointer overflow.
4. Subsequent pushes will overwrite information stored on the stack from 00FF on
down. Similarly, underflow occurs when the stack pointer is at $00FF and the next
pull rolls the stack pointer to 00C0 and reads the byte there.
5. Subroutines called with the BSR and JSR instructions save a two byte return
address on the stack. Interrupts save a two byte return address, the index register,
the accumulator, and the condition code register.
18. Draw pin diagram of 8086 and briefly describe all minimum mode pins.[2010,6a]