0% found this document useful (0 votes)
33 views

Lap Manual

Lab Manual

Uploaded by

Vimal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Lap Manual

Lab Manual

Uploaded by

Vimal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 133

EXP.

NO :
DATE :

AIM:
To write an Assembly Language Program (ALP) for performing the Addition operation of two byte
numbers.

ALGORITHM:
 Initialize the MSBs of sum to 0000
 Get the first number
 Add the second number to the first number.
 If there is any carry, increment MSBs of sum by 1.
 Store LSBs of sum.
 Store MSBs of sum.

FLOWCHART

PROGRAM FOR ADDITION OF TWO 16-BIT NUMBERS


EXP.NO :
DATE :

ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV DX,0000 C7,C2,00,00 Move the values of 0000 to


DX register.

1004 MOV AX,[2000] 8B,06,00,20 Move the values in the


address 2000 to AX.

1008 MOV BX,[2002] 8B,1E,02,20 Move the values in the


address 2002 to Bx.

100C ADD AX,BX 01D8 Add the values in the register


AX, BX.

100E JNC L1 7301 If there is no carry jump to


loop1.

1010 INC DX 42 Increment the values in DX


register.

1011 L1 MOV[2004],AX 89,06,04,20 Move the values in AX to


address 2004.

1015 MOV[2006],DX 89,16,06,20 Move the values in DX to


address 2006.

1019 HLT F4 Stop the program.

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2000 22 22 2004 33 33

2002 11 11 2006 00 00

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the Addition operation of two
byte numbers is performed and result is stored.

VIVA-VOCE QUESTIONS & ANSWERS


EXP.NO :
DATE :

1. What is Microprocessor? Give the power supply & clock frequency of 8085
A microprocessor is a multipurpose, programmable logic device that reads binary instructions from a
storage device called memory accepts binary data as input and processes data according to those instructions
and provides result as output. The power supply of 8085 is +5V and clock frequency in 3MHz.

2.List few applications of microprocessor-based system.


It is used:
i.For measurements, display and control of current, voltage, temperature, pressure, etc.
ii.For traffic control , speed control and industrial tool control.

3.What are the functions of bus interface unit (BIU) in 8086?


(a)Fetch instructions from memory.
(b)Fetch data from memory and I/O ports.
(c)Write data to memory and I/O ports.

4. Explain ALIGN.
The ALIGN directive forces the assembler to align the next segment at an address divisible by specified
divisor. Example: ALIGN 8.

5.Explain ASSUME.
The ASSUME directive assigns a logical segment to a physical segment at any given time. It tells the
assembler what address will be in the segment registers at execution time. Example: ASSUME CS: code, DS:
data, SS: stack

6. What is assembler?
The assembler translates the assembly language program text which is given as input to the assembler to
their binary equivalents known as object code

7. State the significance of LOCK signal in 8086?


If 8086 is working at maximum mode, there are multiprocessors are present. If the system bus is given
to a processor then the LOCK signal is made low. That means the system bus is busy and it cannot be given of
any other processors.

8. Explain SEGMENT & ENDS


An assembly program in .EXE format consists of one or more segments. The starts of these segments
are defined by SEGMENT and the end of the segment is indicated by ENDS directive.

9.How many addressing modes present in 8086?


There are 12 addressing modes present in 8086.

10. What is a recursive procedure?


A recursive procedure is a procedure, which calls itself. Recursive procedures are used to work with
complex data structures called trees.

AIM:
EXP.NO :
DATE :

To write an Assembly Language Program (ALP) for performing the subtraction operation of two byte
numbers.

ALGORITHM
 Initialize the MSBs of difference to 0
 Get the first numbers
 Subtract the second number from the first number.
 If there is any borrow, increment MSBs of difference by 1.
 Store LSBs of difference
 Store MSBs of difference.

FLOWCHART

PROGRAM FOR SUBTRACTION OF TWO 16-BIT NUMBERS


EXP.NO :
DATE :

ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV DX,0000 Move the values of 0000 to DX register.

Move the values in the address 2000 to


1004 MOV AX,[2000] AX.

Move the values in the address 2002 to


1008 MOV BX,[2002] BX.

Subtract the values in register AX,BX


100C SUB AX,BX
If the there is no carry jump to loop1.
100E JNC L1
Increment the values in DX register.
1010 INC DX
Moves the values in AX to address 2004.
1011 L1 MOV[2004],AX
Moves the values in DX to address 2006.

1015 MOV[2006],AX Stop the program.

1019 HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2000 22 22 2004 11 11

2002 11 11 2006 00 00

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the subtraction operation of two
byte numbers is performed and result is stored.

VIVA-VOCE QUESTIONS & ANSWERS


EXP.NO :
DATE :

1. What are Macros?


Macro is a group of instruction. The macro assembler generates the code in the program each time
where the macro is called. Macros are defined by MACRO & ENDM directives.

2.How do 8086 interrupts occur?


An 8086 interrupt can come from any of the following three sources
•External signals
•Special instructions in the program
•Condition produced by instruction

3.What are the 8086 interrupt types?


Dedicated interrupts: Type 0: Divide by zero interrupt ,Type 1: Single step interrupt,
Type 2:Non maskable interrupt, Type 3: Breakpoint, Type 4: Overflow interrupt.
Software interrupts :Type 0-255

4.What is interrupt service routine?


Interrupt means to break the sequence of operation. While the CPU is executing a program an interrupt
breaks the normal sequence of execution of instructions & diverts its execution to some other program. This
program to which the control is transferred is called the interrupt service routine.

5.Define BIOS
The IBM PC has in its ROM a collection of routines, each of which performs some specific function
such as reading a character from keyboard, writing character to CRT. This collection of routines is referred to
as Basic Input Output System or BIOS.

6. What are the 4 segment registers present in 8086.


1.Code Segment (CS) register 2.Data Segment (DS) register
3.Stack Segment (SS) register 4.Extra Segment (ES) register

7. Define pipelining?
In 8086, to speed up the execution of program, the instructions fetching and execution of instructions
are overlapped each other. This technique is known as pipelining.

8. What is the function of instruction queue in 8086?


In 8086, a 6-byte instruction queue is presented at the Bus Interface Unit (BIU). It is used to pre-fetch
and store at the maximum of 6 bytes of instruction code from the memory.

9.What are the conditional flags available in status register of 8086?


CF - Carry Flag, PF - Parity Flag , AF - Auxiliary Carry Flag, ZF - Zero Flag, SF - Sign Flag, OF - Overflow
Flag.

10.What is mean by loosely coupled multiprocessor system?


In loosely coupled multiprocessor system, each processor has a set of Input/output devices and a large
memory, where it accesses most of the instructions and data.

AIM:
EXP.NO :
DATE :

To write an Assembly Language Program (ALP) for performing the multiplication operation of two byte
numbers.

ALGORITHM
 Get the multiplier
 Get the multiplicand
 Initialize the product to 0
 Product = product + multiplicand
 Decrement the multiplier by 1
 If multiplicand is not equal to 0,repeat from step (d) otherwise store the product.

FLOWCHART

PROGRAM FOR MULTIPLICATION OF TWO 16-BIT NUMBERS


EXP.NO :
DATE :

ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV DX,0000 Move the values of 0000


to DX register.

1004 MOV SI,2000 Move the values in the SI


register.

1008 MOV AX,[SI] Move the SI in address to


AX register.

100A MOV CX, Move the values in the


[2002] address SI+2 to CX
register.
100D
MUL CX Multiply the values in SI,
DX register CX.
100F
MOV SI,2100 Move the values in 2100
to SI register.
1013
MOV [SI],AX Move the values in AX to
the SI address.
1015
MOV Move the values in DX to
[2102],DX the SI+2 address.
1018
Stop the program.
HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2000 11 11 2100 42 86

2002 22 22 2102 46 02

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the multiplication operation of
two byte numbers is performed and result is stored.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS

1.What are the advantages of multiprocessor system?


•High level performance can be attained when parallel processing.
•Robustness can be improved by isolating system functions.

2.What are the problems occurred in multiprocessor system?


1.Bus contention
2.Interprocess communication
3.Resource sharing

3.What is Coprocessor?
The coprocessor is a processor which specially designed for processor to work under the control of the
processor and support special processing capabilities. Example : 8087 which has numeric processing capability
and works under 8086.

4.What are the basic multiprocessor configurations?


1.Coprocessor configuration
2.Closely Coupled configuration
3.Loosely coupled configuration

5.Write the advantages of loosely coupled system over tightly coupled systems?
1.More number of CPUs can be added to improve the system performance.
2.The system structure is modular and hence easy to maintain and troubleshoot.
3.A fault in a single module does not lead to a complete system breakdown.

6.What are the schemes for establishing priority in order to resolve bus arbitration problem?
There are three basic bus access control and arbitration schemes,
1.Daisy Chaining
2.Independent Request
3.Polling

7.What are the advantages of daisy chaining method?


1.It requires less number of control lines.
2.It is simple and cheap.

8.What are the disadvantages of daisy chaining method?


1.Propagation delay
2.The priority of master is fixed by its physical location.

9.Give the instruction set of 8087?


1.Data Transfer Instructions
2.Arithmetic Instructions
3.Comparison Instructions.
4.Transcendental Operations.
5.Constant Operations.
6.Coprocessor Control Operations.

10.What is the main advantage of polling method?


The priority can be dynamically changed by altering the polling sequence stored in the controller.

AIM:
EXP.NO :
DATE :

To write an Assembly Language Program (ALP) for performing the division operation of two byte
numbers.

ALGORITHM
 Get the dividend
 Get the divisor
 Initialize the quotient to 0.
 Dividend = dividend – divisor
 If the divisor is greater, store the quotient. Go to step g.
 If dividend is greater, quotient = quotient + 1. Repeat from step (d)Store the dividend value as
remainder.
FLOWCHART
EXP.NO :
DATE :

PROGRAM FOR DIVISION OF TWO 16-BIT NUMBER

ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV DX,0000 Move 0000 to DX register.

1004 MOV SI,2000 Move 2000 to SI register.

1008 MOV AX,[SI] Move [SI] to A register.

100A MOV CX, Move the value in address SI+2


[2002] to CX register.

100D Divide value in CX.


DIV CX
100F Move the values to 2100 SI
MOV SI,2100 register.
1013
MOV [SI],AX Move the values in address SI to
1015 AX .
MOV[2102],DX
Move the values in address SI+2
1010 to DX.
HLT
Stop the program.

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2000 88 88 2100(Q) 00 04

2002 22 22 2102(R) 00 00

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the division operation of two byte
numbers is performed and result is stored.

VIVA-VOCE QUESTION AND ANSWERS


EXP.NO :
DATE :

1.What is an instruction set?


The entire group of instructions, determines what functions the microprocessor can perform is called
instruction set.

2. Give the instructions that perform the logical operations?


o AND, OR, Exclusive-OR
o Rotate
o Compare
o Complement

3. What is a three-byte instruction?


In a three-byte instruction, the first byte specifies the Opcode, and the following two bytes specifies the
16- bit address.

4. Define a program?
A program is a sequence of instructions written to tell the computer to perform a specific function.

5. Define ASCII code?


ASCII code is a 7-bit code that represents both decimal numbers, alphabets. Extended ASCII is an 8-bit
code.

6. What is STA in data transfer instruction?


Copy the data from the accumulator in the memory location specified by the 16-bit address.

7. What is an IN instruction?
This is a 2-byte instruction. It accepts data from the input port specified in the second byte.

8. What is an OUT instruction?


This is a 2-byte instruction. It sends the content of the accumulator to the output port specified in the
second byte.

9. How is the instruction set classified?


The instruction set is classified in three groups according to the word size:
1-byte instruction
2-byte instruction
3-byte instruction

10. What are the signals used by the DMA controller?


The Signals are:
o HLDA
o DMA request
o DMA acknowledge
o AEN – address enable
o ADSTB- address strobe

AIM:
EXP.NO :
DATE :

To perform logical AND operation between two numbers.

ALGORITHM:
 Initialize the MSBs of sum to 0
 Get the first number
 And operation the second number to the first number.
 Store LSBs of sum.
 Store MSBs of sum.

FLOWCHART

PROGRAM FOR AND OPERATION BETWEEN OF TWO NUMBER


EXP.NO :
DATE :

ADDRESS LABEL MNEMONICS OPCODE COMMENT


ORG 1000H
1000 MOV AL,0F5h

1002 MOV BL,03h

1004 AND AL,BL

1006 MOV SI,1100h

1009 MOV [SI],AL

100B HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 01

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the AND operation of two byte
numbers is performed and result is stored.

VIVA-VOCE QUESTIONS & ANSWERS


EXP.NO :
DATE :

1.How many flags are included in 8086 programming model?


Six data flags and three control flags.

2.Write down the additional flags included in the 8086?


 OF----- Overflow
 DF-----Direction Flag
 IF------Interrupt Flag
 TF-----Trap Flag

3.Write the advanced design features of Pentium processor?


 Superscalar architecture
 On-chip cache memory for code and data
 Branch prediction
 Performance monitoring

4.Write the data transfer from master MPU to slave MPU?


The master MPU reads the status
The master writes the data into port A
The slave checks the OBF signal
The slave MPU reads the data from port A

5.List the operating modes of 8255A PPI?


Two 8-bit ports (A and B)
Two 4-bit ports(Cu and CL )
Data bus buffer
Control logic

6.Specify the bit of a control word for the 8255, which differentiates between the I/O mode and the BSR mode?
 BSR mode D7=0,
 I/O mode D5=1

7.Write the input /output feature in Mode 9 for the 8255A PPI?
Outputs are latched
Inputs are not latched

8.Define machine cycle?


Machine cycle is defined, as the time required completing one operation of accessing memory, I/O, or
acknowledging an external request.

9. Define T-state?
T-state is defined as one subdivision of the operation of performed in one clock period.

10. What is the purpose of 8255 PPI?


The 8255A is widely used, programmable, parallel I/O device .It can be programmed to transfer data
under various conditions, from simple I/O to interrupt I/O.

AIM:
To perform logical OR operation between two numbers.

ALGORITHM:
EXP.NO :
DATE :

 Initialize the MSBs of sum to 0


 Get the first number
 OR operation the second number to the first number.
 Store LSBs of sum.
 Store MSBs of sum.

FLOWCHART

PROGRAM FOR OR OPERATION BETWEEN OF TWO NUMBER

ADDRESS LABEL MNEMONICS OPCODE COMMENT


ORG 1000H
EXP.NO :
DATE :

1000 MOV AL,0F5h

1002 MOV BL,03h

1004 OR AL,BL

1006 MOV SI,1100h

1009 MOV [SI],AL

100B HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 F7

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the OR operation of two byte
numbers is performed and result is stored.
VIVA-VOCE QUESTION & ANSWERS

1.What are the flags supported by 8051 controller?


 Carry flag
EXP.NO :
DATE :

 Auxiliary carry flag


 Over flow flag
 General purpose user flag
 Register bank select bit one
 Register bank select bit zero
 Parity flag

2. What is the significance of wait state generator?


This is used to transfer data between slower I/O device and the microprocessor. In some applications,
the speed of I/O systems is not compatible with the microprocessor’s timings. So the microprocessor has to
confirm whether the peripheral is ready or not.

3. What is a Non-maskable interrupt?


It is unaffected by any mask or interrupt enable. Eg: TRAP

4. What is a Data pointer register?


The data pointer register (DPTR) consists of a high byte(DPH) and a low byte (DPL) functions to hold
16 bit address. It may be manipulated as a 16-bit data register or as independent 8-bit registers. It serves as a
base register in indirect jumps, look up table instructions and external data transfer.

5.Write a program to mask the 0th and 7th bit using 8051?
MOV A,#data
ANL A,#81
MOV DPTR,#4500
MOVX @DPTR,A LOOP: SJMP LOOP

6.What is IMR(Interrupt mask register)?


IMR stores the masking bits of the interrupt lines to be masked. This register can be programmed by an
operation command word (OCW).

7.What is priority resolver?


It determines the priorities of the bits set in the Interrupt request register (IRR), bit corresponding to the
highest priority interrupt input is set in the ISR during INTA input.

8.What is the use of IRR?


The interrupt request register is used to store all the interrupt levels which are requesting the service.
The eight interrupt inputs sets corresponding bits of the Interrupt Request Register upon the service request.

9.What is Interrupt service register(ISR)?


The interrupt service register stores all the levels that are currently being serviced.

10.Write the difference between LDA and STA instruction?


 LDA – Load data in to Accumulator register(A) directly from the address specified with in the
instruction.
 STA – Store the contents of Accumulator register(A) to the address specified with in the instruction.

AIM:
To perform logical XOR operation between two numbers.

ALGORITHM:
 Initialize the MSBs of sum to 0
EXP.NO :
DATE :

 Get the first number


 XOR operation the second number to the first number.
 Store LSBs of sum.
 Store MSBs of sum.

FLOWCHART

PROGRAM FOR XOR OPERATION BETWEEN OF TWO NUMBER

ADDRESS LABEL MNEMONICS OPCODE COMMENT


ORG 1000H
EXP.NO :
DATE :

1000 MOV AL,0F5h Move 0000 to DX register.

1002 MOV BL,03h Move 2000 to SI register.

1004 XOR AL,BL Move [SI] to A register.

1006 MOV SI,1100h Move the value in address SI+2


to CX register.

1009 MOV [SI],AL Divide value in CX.

100B HLT Move the values to 2100 SI


register.

Move the values in address SI to


AX .

Move the values in address SI+2


to DX.

Stop the program.

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 F6

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the XOR operation of two byte
numbers is performed and result is stored.
VIVA-VOCE QUESTION AND ANSWERS

1.What are machine language and assembly language programs?


The software developed using 1's and 0's are called machine language,
programs. The software developed using mnemonics are called assembly language programs.
EXP.NO :
DATE :

2.What is the drawback in machine language and assembly language,


programs?
The machine language and assembly language programs are machine
dependent. The programs developed using these languages for a particular machine
cannot be directly run on another machine .

3.Define bit.
A digit of the binary number or code is called bit. Also, the bit is the
fundamental storage unit of computer memory.

4.Define byte.
The 8-bit (8-digit) binary number or code is called byte .

5.Define word.
16-bit binary number or code is called word. (Some microprocessor manufactures refer the basic data
size operated by the processor as word).

6.What is processor cycle (Machine cycle)?


The processor cycle or machine cycle is the basic operation performed
by the processor. To execute an instruction, the processor will run one or more machine cycles in a particular
order.

7.What is Instruction cycle?


The sequence of operations that a processor has to carry out while
executing the instruction is called Instruction cycle. Each instruction cycle of a processor indium consists of a
number of machine cycles.

8.What is fetch and execute cycle?


In general, the instruction cycle of an instruction can be divided into
fetch and execute cycles. The fetch cycle is executed to fetch the opcode from memory. The execute cycle is
executed to decode the instruction and to perform the work instructed by the instruction.

9.What is Block transfer mode DMA?


In Block transfer mode, the DMA controller will transfer a block of data and relieve the bus for
processor. After sometime another block of data is transferred by DMA .

10. What is Demand Transfer mode DMA?


In Demand transfer mode the DMA controller will complete the entire data transfer at a stretch and then
relieve the bus to processor.

AIM:
To perform logical NOT operation between two numbers.

ALGORITHM:
EXP.NO :
DATE :

 Initialize the MSBs of sum to 0


 Get the first number
 NOT operation the second number to the first number.
 Store LSBs of sum.
 Store MSBs of sum.

FLOWCHART

PROGRAM FOR NOT OPERATION BETWEEN OF TWO NUMBER

ADDRESS LABEL MNEMONICS OPCODE COMMENT


ORG 1000H
EXP.NO :
DATE :

1000 MOV AL,55h .

1002 NOT AL

1004 MOV SI,1100h

1007 MOV [SI],AL

1009 HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 AA

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the NOT operation of two byte
numbers is performed and result is stored.
VIVA-VOCE QUESTION AND ANSWERS

1.What is meant by Polling?


Polling or device Polling is a process which idenfies the device that has interrupted the microprocessor.
EXP.NO :
DATE :

2.What is meant by Interrupt?


Interrupt is an external signal that causes a microprocessor to jump to a specific subroutine.

3.What is an Instruction?
An instruction is a binary pattern entered through an input device to command the microprocessor to
perform that specific function.

4.What is Microcontroller and Microcomputer?


Microcontroller is a device that includes microprocessor: memory and I/O signal lines on a single chip,
fabricated using VLSI technology.
Microcomputer is a computer that is designed using microprocessor as its CPU. It includes
microprocessor, memory and I/O.

5.What is Assembler?
The assembler translates the assembly language program text which is given as input to the assembler to
their binary equivalents known as object code.
The time required to translate the assembly code to object code is called access time. The assembler checks for
syntax errors & displays them before giving the object code.

6. Define Variable?
A Variable is an identifier that is associated with the first byte of data item.

7. Explain Dup?
The DUP directive can be used to initialize several location & to assign values to these locations.

8. Define Pipelining?
In 8086,to speedup the execution program ,the instructions fetching and execution of instructions are
overlapped each other this is known as Pipelining.

9.What is the use of HLDA?


HLDA is the acknowledgment signal for HOLD. It indicates whether the HOLD signal is received or
not.
HOLD and HLDA are used as the control signals for DMA operations.

10. Explain about "LEA"?


LEA(Load Effective Address) is used for initializing a register with an offset address.
A common use for LEA is to intialize an offset in BX, DI or SI for indexing an address in memory.An
equivalent operation to LEA is MOV with the OFFSET operator, which generates slightly shorter machine
code.

AIM:
To convert a given Move a data block without overlap
.
ALGORITHM:
EXP.NO :
DATE :

1. Initialize the memory location to the data pointer.


2. Increment B register.
3. Increment accumulator by 1 and adjust it to decimal every time.
4. Compare the given decimal number with accumulator value.
5. When both matches, the equivalent hexadecimal value is in Bregister.
6. Store the resultant in memory location.

FLOWCHART

PROGRAM FOR TO MOVE BLOCK OF DATA FROM ONE LOCATION INTO ANOTHER
LOCATION WITHOUT OVERLAP USING 8086

ADDRESS LABEL MNEMONICS OPCODE COMMENT


EXP.NO :
DATE :

1000 START CLD FC Start the program.

1001 MOV B8,00,00 Move the content of


AX,0000H 0000H into Ax
register.
1004 8E,D8
MOV AX,DS Move Ax into DS
register.
1006 8E,C0
MOV AX,ES Move Ax into ES
register.
1008 BE,00,20
MOV SI,2000H Move the value of
200H into SI
100D BF,00,24
MOV Move the content of
DI ,2400H 2400H into DI
1011 B9,00,04 register.

1015 MOV CX,04H F3,A4 Move 04 H into CX.

1017 REP MOVSB F4 Move SB register.

HLT Stop the program.

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2000 10 2400 10

2001 20 2401 20

2002 30 2402 30

2003 40 2403 40

RESULT
Thus To write an Assembly Language Program (ALP) for performing the convert a given Move a data
block without overlap is performed and result is stored.

VIVA-VOCE QUESTION AND ANSWERS

1.What is meant by LATCH?


EXP.NO :
DATE :

Latch is a D- type flip-flop used as a temporary storage device controlled by a timing signal, which can
store 0 or 1. The primary function of a Latch is data storage. It is used in output devices such as LED, to hold
the data for display.

2.Why does microprocessor contain ROM chips?


Microprocessor contain ROM chip because it contain instructions to execute data.

3.What is the difference between primary & secondary storage device?


In primary storage device the storage capacity is limited. It has a volatile memory. In secondary storage
device the storage capacity is larger. It is a nonvolatile memory. Primary devices are: RAM / ROM. Secondary
devices are: Floppy disc / Hard disk.

4.Difference between static and dynamic RAM?


Static RAM: No refreshing, 6 to 8 MOS transistors are required to form one memory cell, Information stored
as voltage level in a flip flop.
Dynamic RAM: Refreshed periodically, 3 to 4 transistors are required to form one memory cell, Information is
stored as a charge in the gate to substrate capacitance.

5.What is interrupt?
Interrupt is a signal send by external device to the processor so as to request the processor to perform a
particular work.

6.What is cache memory?


Cache memory is a small high-speed memory. It is used for temporary storage of data & information
between the main memory and the CPU (center processing unit). The cache memory is only in RAM.

7.What is called Scratch pad of computer.?


Cache Memory is scratch pad of computer.

8.What is an Opcode?
The part of the instruction that specifies the operation to be performed is called the Operation code or
Op code.

9.What is an Operand?
The data on which the operation is to be performed is called as an Operand.

10.Explain the difference between a JMP and CALL instruction?


A JMP instruction permantely changes the program counter.
A CALL instruction leaves information on the stack so that the original program execution sequence can be
resumed.

AIM:
To convert a given decimal number to hexadecimal.

ALGORITHM:
EXP.NO :
DATE :

1. Initialize the memory location to the data pointer.


2. Increment B register.
3. Increment accumulator by 1 and adjust it to decimal every time.
4. Compare the given decimal number with accumulator value.
5. When both matches, the equivalent hexadecimal value is in Bregister.
6. Store the resultant in memory location.

FLOWCHART :

PROGRAM FOR TO CONVERT THE HEX (FFFF) NUMBER INTO ITS EQUIVALENT DECIMAL
VALUE USING 8086
ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV AX,0FFFFh FC Start the program.


EXP.NO :
DATE :

1003 MOV DX,0h B8,00,00 Move the content of


0000H into Ax
1006 MOV CX,2710H register.
8E,D8
1009 DIV CX Move Ax into DS
register.
100B AND AX,00FFh 8E,C0
Move Ax into ES
100E MOV SI,1200h register.
BE,00,20
1011 MOV [SI],AL Move the value of
200H into SI
1013 MOV AX,DX BF,00,24
Move the content of
1015 MOV DX,0h 2400H into DI
B9,00,04 register.
1018 MOV CX,03E8H
F3,A4 Move 04 H into CX.
101B DIV CX
F4 Move SB register.
101D AND AX,00FFh
Stop the program.
1020 INC SI

1021 MOV [SI],AL

1023 MOV AX,DX

1025 MOV BL,64H

1027 DIV BL

1029 INC SI

102A MOV [SI],AL

102C AND AX,0FF00h

102F MOV AL,AH

1031 MOV AH,0h

1033 MOV BL,0AH

1035 DIV BL

1037 INC SI

1038 MOV [SI],AL

103A INC SI
EXP.NO :
DATE :

103B MOV [SI],AH

103D HLT

103E

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 06

1201 05

1202 05

1203 03

1204 05

RESULT
Thus To convert a given decimal number to hexadecimal is performed and result is stored.

VIVA-VOCE QUESTION AND ANSWERS

1. What are Hardware interrupts?


TRAP, RST7.5, RST6.5, RST5.5, INTR.
EXP.NO :
DATE :

2. What are Software interrupts?


RST0, RST1, RST2, RST3, RST4, RST5, RST6, RST7.

3. Which interrupt has the highest priority?


TRAP has the highest priority.

4. Name 5 different addressing modes?


Immediate, Direct, Register, Register indirect, Implied addressing modes.

5. How many interrupts are there in 8085?


There are 12 interrupts in 8085.

6.What does microprocessor speed depend on?


The processing speed depends on DATA BUS WIDTH.

7.Is the address bus unidirectional?


The address bus is unidirectional because the address information is always given by the Micro
Processor to address a memory location of an input / output devices.

8.Is the data bus is Bi-directional?


The data bus is Bi-directional because the same bus is used for transfer of data between Micro Processor
and memory or input / output devices in both the direction.

9.What is the disadvantage of microprocessor?


It has limitations on the size of data. Most Microprocessor does not support floating-point operations.

10.What is the difference between microprocessor and microcontroller?


In Microprocessor more op-codes, few bit handling instructions. But in microcontroller fewer op-codes,
more bit handling Instructions, and also it is defined as a device that includes micro processor, memory, &
input / output signal lines on a single chip.

AIM:
To write a program for addition operations between two decimal numbers.

ALGORITH:
1. Initialize the pointer only for data and result
EXP.NO :
DATE :

2. Load AL with count


3. Add two matrix by each element
4. Process continues until CL is zero
5. Store result.

FLOWCHART

PROGRAM FOR TO PERFORM A ADDITION OPERATIONS BETWEEN TWO DECIMAL


NUMBERS.
ADDRESS LABEL MNEMONICS OPCODE COMMENT
1000 MOV SI,1100h
EXP.NO :
DATE :

1003 MOV AL,[SI]

1005 INC SI

1006 MOV BL,[SI]

1008 ADD AL,BL

100A DAA

100B INC SI

100C MOV [SI],AL

100E HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 05
1102 11
1101 06

RESULT:
Thus to to write a program for addition operations between two decimal numbers.

VIVA-VOCE QUESTION AND ANSWERS

1.What is SIM and RIM instructions?


SIM is Set Interrupt Mask. Used to mask the hardware interrupts. RIM is Read Interrupt Mask. Used to
check whether the interrupt is Masked or not.
EXP.NO :
DATE :

2.What is the position of the Stack Pointer after the PUSH instruction?
The address line is 02 less than the earlier value.

3.What is the position of the Stack Pointer after the POP instruction?
The address line is 02 greater than the earlier value.

4. What are the various registers in 8085?


Accumulator register, Temporary register, Instruction register, Stack Pointer, Program Counter are the
various registers in 8085 .

5. In 8085 name the 16 bit registers?


Stack pointer and Program counter all have 16 bits.

6. What are the various flags used in 8085?


Sign flag, Zero flag, Auxillary flag, Parity flag, Carry flag.

7. What is Stack Pointer?


Stack pointer is a special purpose 16-bit register in the Microprocessor, which holds the address of the
top of the stack.

8. What is Program counter?


Program counter holds the address of either the first byte of the next instruction to be fetched for
execution or the address of the next byte of a multi byte instruction, which has not been completely fetched. In
both the cases it gets incremented automatically one by one as the instruction bytes get fetched. Also Program
register keeps the address of the next instruction.

9. Which Stack is used in 8085?


LIFO (Last In First Out) stack is used in 8085.In this type of Stack the last stored information can be
retrieved first.

10. What is meant by a bus?


A bus is a group of conducting lines that carriers data, address, & control signals.

AIM:
To write an Assembly Language Program (ALP) To perform a subtraction operations between two
decimal numbers.

ALGORITHM
EXP.NO :
DATE :

 Initialize the MSBs of difference to 0


 Get the first numbers
 Subtract the second number from the first number.
 If there is any borrow, increment MSBs of difference by 1.
 Store LSBs of difference
 Store MSBs of difference.

FLOWCHART

PROGRAM FOR TO PERFORM A SUBTRACTION OPERATIONS BETWEEN TWO DECIMAL


NUMBERS.
ADDRESS LABEL MNEMONICS OPCODE COMMENT
1000 MOV SI,1100h
EXP.NO :
DATE :

1003 MOV AL,[SI]

1005 INC SI

1006 MOV BL,[SI]

1008 SUB AL,BL

100A DAS

100B INC SI

100C MOV [SI],AL

100E HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 15
1102 08
1101 07

RESULT:
Thus to perform a subtraction operations between two decimal numbers is performed and result is stored.

VIVA-VOCE QUESTION & ANSWERS


1. What are the different group of instructions supported by 8051?
 Data Transfer Group
 Arithmetic Group
 Logical Group
 Branching Group
 Bit manipulation Group
EXP.NO :
DATE :

2. Write a program to mask the 0th and 7th bit using 8051?
MOV A,#data
ANL A,#81
MOV DPTR,#4500
MOVX @DPTR,A LOOP: SJMP LOOP

3. What are the types of rotate instructions?


 RLC – Rotate Accumulator Left
 RRC- Rotate Accumulator Right
 RAL – Rotate Accumulator Left through Carry
 RAR - Rotate Accumulator Right through Carry

4. Write about CALL statement in 8051?


There are two CALL instructions. They are
 LCALL(Long call)
 ACALL(Absolute call)

5. Write about the jump statement?


There are three forms of jump. They are
LJMP (Long jump) – 16 bit address
AJMP(Absolute jump) – 11 bit address
SJMP (Short jump) – relative address

6. How we calculate the Baud rate for serial port in mode 0?


Baud Rate = Oscillator frequency/12

7. What is the significance of TXD and RXD pins in 8051?


TXD – Transmit data pin for serial port in UART mode. Clock output in shift register mode.
RXD – Receive data pin for serial port in UART mode. Data I/O pin in shift register mode.

8. Write two examples of Register indirect Addressing modes in 8051?


MOV A,@R0 ; Load the contents pointed by R0 in A.
ADD A,@R1 ; Add the contents of A and the contents pointed by R1.

9. What are the types of branching instructions?


 Jump instructions
 Call and Return instructions
 Restart instructions

10. What is the use of SWAP function in 8051?


SWAP A : Swap nibbles with in the Accumulator bytes. It interchanges the low and high order nibbles
of the Accumulator (bits 0-3 and bits 4-7) .

AIM:
To write a perform addition of two 3*3 matrix

ALGORITH:
1. Initialize the pointer only for data and result
2. Load AL with count
3. Add two matrix by each element
EXP.NO :
DATE :

4. Process continues until CL is zero


5. Store result.

FLOWCHART

PROGRAM FOR TO PERFORM ADDITION OF TWO 3*3 MATRIX

ADDRESS LABEL MNEMONICS OPCODE COMMENT


1000 MOV CL,09

1002 MOV SI,1100h


EXP.NO :
DATE :

1005 MOV DI,1150h

1008 LOOP: MOV AL,[SI]

100A MOV BL,[DI]

100C ADD AL,BL

100E MOV [DI],AL

1010 INC DI

1011 INC SI

1012 DEC CL

1014 JNZ LOOP

1016 HLT

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 1150 02 02 1150 04
1101 1151 02 02 1151 04
1102 1152 02 02 1152 04
1103 1153 02 02 1153 04
1104 1154 02 02 1154 04
1105 1155 02 02 1155 04
1106 1156 02 02 1156 04
1107 1157 02 02 1157 04
1108 1158 02 02 1158 04

RESULT:
Thus to write a perform addition of two 3*3 matrix is performed and result is stored

VIVA-VOCE QUESTIONS & ANSWERS

1. What is the function of DMA address register?


Each DMA channel has one DMA address register. The function of this register is to store the address
of the starting memory location, which will be accessed by the DMA channel.

2. What is the use of terminal count register?


EXP.NO :
DATE :

Each of the four DMA channels of 8257 has one terminal count register. This 16-bit register is used for
ascertaining that the data transfer through a DMA channel ceases or stops after the required number of DMA
cycles.

3. What is Key bouncing?


Mechanical switches are used as keys in most of the keyboards. When a key is pressed the contact
bounce back and forth and settle down only after a small time delay (about 20ms). Even though a key is
actuated once, it will appear to have been actuated several times. This problem is called Key Bouncing.

4. What is the use of stepper motor?


A stepper motor is a device used to obtain an accurate position control of rotating shafts. A stepper
motor employs rotation of its shaft in terms of steps, rather than continuous rotation as in case of AC or DC
motor.

5. Define ROM?
A memory that stores binary information permanently. The information can be read from this memory
but cannot be altered.

6. What is an Assembler?
A computer program that translate an assembly language program from mnemonics to the binary
machine code of a computer.

7. What are the four primary operations of a MPU?


1.Memory read
2.Memory write
3.I/O read
4.I/O write

8.What do you mean by address bus?


A group of lines that are used to send a memory address or a device address from the MPU to the
memory location or a peripheral.

9. Why is the data bus bi-directional?


The data bus is bi-directional because the data flow in both directions between the MPU and memory
and peripheral devices.

10. Define instruction cycle?


Instruction cycle is defined, as the time required completing the execution of the instruction.

AIM:
To write a perform subtraction of two 3*3 matrix

ALGORITHM:
1. Initialize the pointer only for data and result
2. Load AL with count
3. sub two matrix by each element
EXP.NO :
DATE :

4. Process continues until CL is zero


5. Store result.

FLOWCHART

PROGRAM FOR TO PERFORM SUBTRACTION OF TWO 3*3 MATRIX

ADDRESS LABEL MNEMONICS OPCODE COMMENT


1000 MOV CL,09

1002 MOV SI,1100h


EXP.NO :
DATE :

1005 MOV DI,1150h

1008 LOOP: MOV AL,[SI]

100A MOV BL,[DI]

100C SUB AL,BL

100E MOV [DI],AL

1010 INC DI

1011 INC SI

1012 DEC CL

1014 JNZ LOOP

1016 HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 1150 02 02 1150 00
1101 1151 02 02 1151 00
1102 1152 02 02 1152 00
1103 1153 02 02 1153 00
1104 1154 02 02 1154 00
1105 1155 02 02 1155 00
1106 1156 02 02 1156 00
1107 1157 02 02 1157 00
1108 1158 02 02 1158 00

RESULT:
Thus To Perform Subtraction Of Two 3*3 Matrix Is Performed And Result Is Stored.

VIVA-VOCE QUESTIONS & ANSWERS

1. How many bytes of internal RAM and ROM supported by 8051 micro controller?
128 bytes of internal RAM and 4 bytes of ROM.
EXP.NO :
DATE :

2.What is Stack Pointer?


Stack pointer is a special purpose 16-bit register in the Microprocessor, which holds the address of the
top of the stack.

3.What happens when HLT instruction is executed in processor?


The Micro Processor enters into Halt-State and the buses are tri-stated.

4.What does Quality factor mean?


The Quality factor is also defined, as Q. So it is a number, which reflects the lossless of a circuit. Higher
the Q, the lower are the losses.

5.How many interrupts are there in 8085?


There are 12 interrupts in 8085.

6.What is Tri-state logic?


Three Logic Levels are used and they are
 High state,
 Low state,
 High impedance state.
The high and low are normal logic levels & high impedance state is electrical open circuit conditions. Tri-state
logic has a third line called enable line.

7.Which interrupt has the highest priority?


TRAP has the highest priority

8.What are level-triggering interrupt?


RST 6.5 & RST 5.5 are level-triggering interrupts.

9.Which interrupt is not level-sensitive in 8085?


RST 7.5 is a raising edge-triggering interrupt.

10.Can an RC circuit be used as clock source for 8085?


Yes, it can be used, if an accurate clock frequency is not required. Also, the component cost is low
compared to LC or Crystal.

11. Define machine cycle of 8051?


8051 machine cycle consists of 6 states, S1 through S7. One state is made up of 2 clock pulses. Thus 12
clock period constitute one machine cycle. Two clock periods in a state is termed as phase 1 and phase 2.

AIM:
To write an Assembly Language Program (ALP) for performing the Addition operation of floating
point.

ALGORITHM:
EXP.NO :
DATE :

 Initialize the MSBs of sum to 0


 Get the first number
 Add the second number to the first number.
 If there is any carry, increment MSBs of sum by 1.
 Store LSBs of sum.
 Store MSBs of sum.

FLOWCHART

PROGRAM FOR TO PERFORM ADDITION BETWEEN TWO FLOATING POINT NUMBERS

ADDRESS LABEL MNEMONICS OPCODE COMMENT


1000 MOV AL,66h

1002 MOV BL,33h


EXP.NO :
DATE :

1004 ADD AL,BL

1006 MOV SI,1100h

1009 MOV [SI],AL

100B INC SI

100C MOV [SI],AH

100E HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 99

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the Addition operation of floating
point is performed and result is stored.
VIVA-VOCE QUESTIONS & ANSWERS

1. What are the basic modes of operation of 8255?


There are two basic modes of operation of 8255, viz.
1.I/O mode.
2.BSR mode.
In I/O mode, the 8255 ports work as programmable I/O ports, while In BSR mode only port C (PC0-PC7) can
be used to set or reset its individual port bits
EXP.NO :
DATE :

2.Write the features of mode 0 in 8255?


1.Any port can be used as an input or output port.
2.Output ports are latched. Input ports are not latched.

3.What are the signals used in input control signal & output control signal?
Input control signal :STB (Strobe input) IBF (Input buffer full)
Output control signal :OBF (Output buffer full),ACK,) INTR (Interrupt request).

4.What are the modes of operations used in 8253?


1.Mode 0 (Interrupt on terminal count) 2.Mode 1 (Programmable monoshot)
3.Mode 2 (Rate generator) 4.Mode 3 (Square wave generator)
5.Mode 4 (Software triggered strobe)6.Mode 5 (Hardware triggered strobe)

5.What are the different types of write operations used in 8253?


(1) Writing a control word register
(2) Writing a count value into a count register

6.Give the different types of command words used in 8259A?


1.Initialization command words (ICWs)
2.Operation command words (OCWs)

7.Give the operating modes of 8259A?


(a)Fully Nested Mode (b)End of Interrupt (EOI)
(c)Automatic Rotation (d)Automatic EOI Mode
(e)Specific Rotation (f)Special Mask Mode
(g)Edge and level Triggered Mode (h)Reading 8259 Status
(i)Poll command (j)Special Fully Nested Mode
(k)Buffered mode (l)Cascade mode

8. Define scan counter?


The scan counter has two modes to scan the key matrix and refresh the display.
1.Encoded mode
2.Decoded mode

9. What is the output modes used in 8279?


8279 provides two output modes for selecting the display options.
1. Display Scan: In this mode, 8279 provides 8 or 16 character-multiplexed displays those can be organized as
dual 4-bit or single 8-bit display units.
2. Display Entry:8279 allows options for data entry on the displays. The display data is entered for display from
the right side or from the left side.

10.What are the modes used in keyboard modes?


1.Scanned Keyboard mode with 2 Key Lockout ,2.Scanned Keyboard with N-key Rollover, 3.Scanned
Keyboard special Error Mode, 4.Sensor Matrix Mode.
AIM:
To write an Assembly Language Program (ALP) for performing the subtraction operation of two byte
numbers.

ALGORITHM
 Initialize the MSBs of difference to 0
 Get the first numbers
 Subtract the second number from the first number.
EXP.NO :
DATE :

 If there is any borrow, increment MSBs of difference by 1.


 Store LSBs of difference
 Store MSBs of difference.

FLOWCHART

PROGRAM FOR TO PERFORM SUBTRACTION BETWEEN TWO FLOATING POINT NUMBERS

ADDRESS LABEL MNEMONICS OPCODE COMMENT


1000 MOV AL,66h

1002 MOV BL,33h

1004 SUB AL,BL


EXP.NO :
DATE :

1006 MOV SI,1100h

1009 MOV [SI],AL

100B INC SI

100C MOV [SI],AH

100E MOV [SI],AL

HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 33

1101 00

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the subtraction operation of two
byte numbers is performed and result is stored.
VIVA-VOCE QUESTIONS & ANSWERS

1.Name the processor lines of two major manufacturers?


High-end: Intel - Pentium (II, III, 4), AMD - Athlon. Low-end: Intel - Celeron, AMD - Duron. 64-bit:
Intel - Itanium 2, AMD - Opteron.

2.How many bit combinations are there in a byte?


Byte contains 8 combinations of bits.
EXP.NO :
DATE :

3.Have you studied buses? What types?


There are three types of buses.
1.Address bus: This is used to carry the Address to the memory to fetch either Instruction or
Data.
2.Data bus : This is used to carry the Data from the memory.
3.Control bus : This is used to carry the Control signals like RD/WR, Select etc.

4.What is the Maximum clock frequency in 8086?


5 MHZ is the Maximum clock frequency in 8086.

5.What is meant by Maskable interrupts?


An interrupt that can be turned off by the programmer is known as Maskable interrupt.

6.What is Non-Maskable interrupts?


An interrupt which can be never be turned off (ie. disabled) is known as Non-Maskable interrupt.

7.What are the different functional units in 8086?


Bus Interface Unit and Execution unit, are the two different functional units in 8086.

8.What are the various segment registers in 8086?


Code, Data, Stack, Extra Segment registers in 8086.

9.What does EU do?


Execution Unit receives program instruction codes and data from BIU, executes these instructions and
store the result in general registers.

10.Which Stack is used in 8086? k is used in 8086?


FIFO (First In First Out) stack is used in 8086.In this type of Stack the first stored information is
retrieved first.

11.What are the flags in 8086?


In 8086 Carry flag, Parity flag, Auxiliary carry flag, Zero flag, Overflow flag, Trace flag, Interrupt flag,
Direction flag, and Sign flag.

AIM:
To write an Assembly Language Program (ALP) for performing the multiplication operation of floating
point

ALGORITHM
 Get the multiplier.
 Get the multiplicand
 Initialize the product to 0.
 Product = product + multiplicand
EXP.NO :
DATE :

 Decrement the multiplier by 1


 If multiplicand is not equal to 0,repeat from step (d) otherwise store the product.

FLOWCHART

PROGRAM FOR TO PERFORM MULTIPLICATION BETWEEN TWO FLOATING POINT


NUMBERS

ADDRESS LABEL MNEMONICS OPCODE COMMENT


1000 MOV AX,33h

1003 MOV BX,66h

1006 MUL BX
EXP.NO :
DATE :

1008 MOV SI,1100h

100B MOV [SI],AH

100D HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 14

RESULT:
Thus To write an Assembly Language Program (ALP) for performing the multiplication operation
floating point is performed and result is stored.

VIVA-VOCE QUESTION & ANSWERS


1.What is opcode fetch cycle?
The opcode fetch cycle is a machine cycle executed to fetch the opcode of an instruction stored in
memory. Every instruction starts with opcode fetch machine cycle.

2. What are the operating modes of 8279?


1. Input modes
 Scanned keyboard
 Scanned sensor matrix
EXP.NO :
DATE :

 Strobed input
2.Display modes
 Left entry (Type writer mode)
 Right entry (Calculator mode)

3.What are the different functional units in 8279?


 CPU interface section
 Keyboard section
 Display section
 Scan section

4.What operation is performed during first T -state of every machine cycle in 8085 ?
In 8085, during the first T -state of every machine cycle the low byte address is latched into an external
latch using ALE signal.

5.Why status signals are provided in microprocessor?


The status signals can be used by the system designer to track the internal operations of the processor.

6.What is the need for timing diagram?


The timing diagram provides information regarding the status of various signals, when a machine cycle
is executed. The knowledge of timing diagram is essential for system designer to select matched peripheral
devices like memories, latches, ports, etc., to form a microprocessor system.

7. How many machine cycles constitute one instruction cycle in 8085?


Each instruction of the 8085 processor consists of one to five machine cycles.

8. List the addressing modes of 8051?


 Direct addressing
 Register addressing
 Register indirect addressing
 Implicit addressing
 Immediate addressing
 Index addressing
 Bit addressing

9. What is Accumulator Register?


It is an 8 – bit register. It holds a source operand and receives the result of the arithmetic instructions
(Addition, Subtraction, Multiplication and Division)

10.What is USART?
Universal Synchronous Asynchronous Receiver.

AIM:
To write an Assembly Language Program (ALP) to sort a given array in ascending order.

ALGORITHM:
a. Load the array count in two registers C1 and C2.
b. Get the first two numbers.
c. Compare the numbers and exchange if necessary so that the two numbers are
in ascending order.
d. Decrement C2.
e. Get the third number from the array and repeat the process until C2 is 0.
EXP.NO :
DATE :

f. Decrement C1 and repeat the process until C1 is 0.

FLOWCHART

PROGRAM FOR SORTING THE ARRAY IN ASCENDING ORDER

ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV AX,0000H BE,11,00 Move 000 to Ax register.

1004 START MOV CX,0005H BA,0C Move the 0005 value to Cx


register
1008 MOV DX,0005H FE,C9
Move the 0005 value to Dx
EXP.NO :
DATE :

100C MOV SI,2000H BE,11,00 register

1010 LABEL MOV AX,[SI] FE,CD Move 2000H to SI.

1012 CMP AX,[SI+2] A6 Move the SI in the AX register.

1015 JC LOOP 8A,0A Compare AX, SI+2.

1017 XCHG AX, 3A,44,01 If there is any carry loop.


[SI+2]
101A 72,03 Exchange the value of SI+2,
XCHG AX,[SI] AX.
101C LOOP 86,44,01
ADD SI ,0002 Exchange the value of SI, AX.
1020
LOOP LABEL ADD SI, 0002.
1022
DEC DX Loop the label.
1023
JNZ START Decrement DX.
1025
HLT JNC start.

Stop the program.

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2000 44 44 2000 11 11

2002 11 11 2002 22 22

2004 33 33 2004 33 33

2006 55 55 2006 44 44

2008 22 22 2008 55 55

RESULT:
To write an Assembly Language Program (ALP) to sort a given array in Ascending order is performed and
result is stored.
VIVA-VOCE QUESTIONS & ANSWERS

1. What is a microcontroller?
A device which contains the microprocessor with integrated peripherals like memory, serial ports,
parallel ports, timer/counter, interrupt controller, data acquisition interfaces like ADC, DAC is called
microcontroller.

2. List the features of 8051 microcontroller?


 single_supply +5 volt operation using HMOS technology.
 4096 bytes program memory on chip(not on 8031)
 128 data memory on chip.
EXP.NO :
DATE :

 Four register banks.


 32 bi-directional individually addressable I/O lines.
 8 bit CPU optimized for control applications.

3.What are the addressing modes supported by 8051?


•Register addressing •Direct byte addressing
•Register indirect •Immediate
•Register specific •index

4.What is the function of the accumulator?


The accumulator is the register used to store the 8-bit data to perform the arithmetic and logical
operations.

5. Define control bus?


This is single line that is generated by the MPU to provide timing of various operations.

6. What is a flag?
The data conditions, after arithmetic or logical operations, are indicated by setting or resetting the flip-
flops called flags.

7. Why are the program counter and the stack pointer 16-bit registers?
Memory locations for the program counter and stack pointer have 16-dit address. So the PC and SP have
16-bit registers.

8. Define memory word?


The number of bits stored in a register is called a memory word.

9. Specify the number of registers and memory cells required in a 128 x 4 memory chip?
Number of registers=128
Memory cells required is 128 x 4=512

10. Explain the function of the PSEN pin of 8051.


PSEN: PSEN stands for program store enable.
In 8051 based system in which an external ROM holds the program code, this pin is connected to the
OE pin of the ROM.

AIM:
To write an Assembly Language Program (ALP) to sort a given array in descending order.

ALGORITHM:
a. Load the array count in two registers C1 and C2.
b. Get the first two numbers.
c. Compare the numbers and exchange if necessary so that the two numbers are
in descending order.
d. Decrement C2.
e. Get the third number from the array and repeat the process until C2 is 0.
f. Decrement C1 and repeat the process until C1 is 0.
EXP.NO :
DATE :

FLOWCHART

PROGRAM FOR SORTING THE ARRAY IN DESCENDING ORDER


ADDRESS LABEL MNEMONICS OPCODE COMMENT
1000 MOV AX,0000 H Move 000 to Ax register.

1004 START MOV CX,0005 H Move the 0005 value to CX register

1008 MOV DX,0005 H Move the 0005 value to DX


Register.

100C MOV SI,2000H Move 2000H to SI.


EXP.NO :
DATE :

1010 LABEL MOV AX,[SI] Move the SI in the AX register.

1012 CMP AX,[SI+2] Compare Ax, Si+2.

1015 JNC LOOP If there is any carry loop.

1017 XCHG AX, Exchange the value of SI+2, AX.


[SI+2]
101A Exchange the value of SI, AX.
XCHG AX,[SI]
101C LOOP ADD SI, 0002.
ADD SI ,0002
1020 Loop the label.
LOOP LABEL
1022 Decrement DX.
DEC DX
1023 Jump no zero.
JNZ START
1025 Stop the program.
HLT

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
2000 44 2000 44
2001 44 2001 44
2002 11 2002 55
2003 11 2003 55
2004 33 2004 33
2005 33 2005 33
2006 55 2006 22
2007 55 2007 22
2008 22 2008 11
2009 22 2009 11

RESULT:
To write an Assembly Language Program (ALP) to sort a given array in Ascending order is performed and
result is stored.

VIVA-VOCE QUESTIONS & ANSWERS

1.Why a latch is used for the output port and a tri-state buffer is used for the input port?
A latch is necessary to hold the output data for display. The input data byte is obtained by enabling a tri-
state buffer and placed in the accumulator.

2. What happens when the 8085 execute the out instruction?


When the 8085 executes the out instruction, in the third machine cycle, it places the output port address
on the low-order address bus, duplicates the same port address on the higher order address bus, places the
contents of the accumulator on the data bus and asserts the control signal WR.
EXP.NO :
DATE :

3. How will the port number be affected if we decode the high-order address lines A15 –A8 rather than A7 –
A0?
The port address will remain the same because the I/O port address is duplicated on both segments of
the address bus.

4. Define Memory mapped I/O?


Instead of a memory register, if an output device is connected at the address, the accumulator contents
will be transferred to the output device. This is called memory mapped I/O.

5. What is an interrupt I/O?


The interrupt I/O is a process of data transfer whereby an external device or a peripheral can inform the
processor that it is ready for communication and it requests attention

6. What is Partial Decoding?


The output port can be selected by decoding some of the address lines is called partial decoding .

7. Define absolute decoding?


All the eight lines are decoded to generate one unique output pulse. This is called absolute decoding.

8. Give the characteristics of Memory mapped I/O?


 Execution speed
 Data transfer
 Device address

9. Define the types of branching operations?


Jump: to test the conditions Call, Return, And Restart: Change the sequence of the program.

10. Define two-byte instruction with one example?


In a 2-byte instruction, the first byte specifies the Opcode; the second byte specifies the operand.
Example: Opcode operand MVI A, Data

AIM:
To search a specific byte in an array of numbers.

ALGORITHM:
a. Load the array count in a register C1.
b. Get the first two numbers.
c. Compare the numbers and exchange if the number is small.
d. Get the third number from the array and repeat the process until C1 is 0.

FLOWCHART
EXP.NO :
DATE :

PROGRAM FOR TO SEARCH A SPECIFIC BYTE IN AN ARRAY OF NUMBERS


ADDRESS LABEL MNEMONICS OPCODE COMMENT
1000 MOV DI,1100h

1003 MOV SI,1050h

1006 MOV AL,[SI]


EXP.NO :
DATE :

1008 INC SI

1009 MOV CL,[SI]

100B MOV SI,1200h

100E MOV CH,00H

1010 ADD CL,01H

1013 REPNZ SCASB

1015 MOV AL,CL

1017 OR AL,00H

1019 JZ LOOP

101B MOV AL,01H

101D MOV [SI],AL

101F HLT

1020 MOV AL,00H

1022 MOV [SI],AL

1024 HLT

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
EXP.NO :
DATE :

1050 30 1200 01
1051 08

1100 06
1101 07
1102 09
1103 90
1104 80
1105 30
1106 40
1107 34

RESULT:
Thus To search a specific byte in an array of numbers is performed and result is stored.

VIVA-VOCE QUESTIONS & ANSWERS

1.What operation can be performed by using the instruction ADD A?


EXP.NO :
DATE :

The instruction ADD a will add the content of the accumulator to itself; this is equivalent to multiplying
by 2.

2.What operation can be performed by using the instruction SUB A? Specify the status of Z and CY?
The instruction SUB a will clear the accumulator. The flag status will be CY = 0 and
Z = 1.

3. What is the machine control operations used in 8085 microprocessor?


 HLT: Halt
 NOP: No Operation

4. What are the notations used in the 8085 instructions?


 R = 8085 8-bit register
 M=memory register
 Rs = Register source
 Rd = register destination
 Rp = register pair

5. What is JNC 16-bit address?


It change the program sequence to the location specified by the 16-bit Address if the carry flag is reset .

6. Why the number of out ports in the peripheral-mapped I/O is restricted to 256 ports?
The number of output ports in the peripheral I/O is restricted to 256 ports because the operand of the
OUT instruction is 8-bits; it can have only 256 combinations.

7. If an input and output port can have the same 8-bit address how does the 8085 differentiate between the
ports?
In The 8085 differentiates between the input and output ports of the same address by the control signal.
The input port requires the RD and the output port requires the WR signal.

8.What are the control signals necessary in the memory mapped I/O?
RD, WR, I/O (low)

9. What is SIM?
SIM: Set interrupt Mask. It is a 1-byte instruction. Used for three functions
a.To set the Mask
b.To reset the flip flop
c.Implement the I/O

10.What is RIM?
RIM: Read Interrupt Mask Used for three functions
a.To read interrupt mask
b.To identify the pending interrupt
c.To receive serial data

AIM:
To write an Assembly Language Program (ALP) for To check whether the password is correct or not
EXP.NO :
DATE :

PROGRAM FOR TO CHECK WHETHER THE PASSWORD IS CORRECT OR NOT.


ADDRESS LABEL MNEMONICS OPCODE COMMENT
EXP.NO :
DATE :
EXP.NO :
DATE :

OUTPUT
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

RESULT:
Thus To Check Whether The Password Is Correct Or Not Is Performed Successfully.

AIM:
To display the date using VBMB -15 kit.

ALGORITHM
Interfacing VBMB-15 to 8086
EXP.NO :
DATE :

Steps to be followed in program


i) set 24 hours format
ii) set time(23:55:55)
iii) set date(dd:mm:yy)
iv) read time &date

PROGRAM FOR TO DISPLAY THE DATE USING VBMB -15 KIT.

ADDRESS LABEL MNEMONICS OPCODE COMMENT


EXP.NO :
DATE :

INPUT:

SET TIME 1200: 05 (LSB OF SECONDS)


1201: 05 (MSB OF SECONDS)
EXP.NO :
DATE :

1202: 09 (LSB OF MINUTES)


1203: 05 (MSB OF MINUTES)
1204: 03 (LSB OF HOURS)
1205: 02 (MSB OF HOURS)

SET DATE 1206:05 (LSB OF DATE)


1207: 02 (MSB OF DATE)
1208: 01 (LSB OF MONTH)
1209: 00 (MSB OF MONTH)
120A: 05(LSB OF YEAR)
120B:01 (MSB OF YEAR)

OUTPUT:
AFTER EXECUTION THE TIME IS 23:59:55 AND DATE IS 25:01:15
AFTER 5 SECONDS THE DATE WILL BE DISPLAYED 26:01:15 IN VBMB-15

RESULT:
Thus to display the date using vbmb -15 kit is performed successfully.

VIVA-VOCE QUESTIONS & ANSWERS

1.What are the modes used in display modes?


1.Left Entry mode : In the left entry mode, the data is entered from the left side
of the display unit.
EXP.NO :
DATE :

2. Right Entry Mode :In the right entry mode, the first entry to be displayed is
entered on the rightmost display.

2. What is the use of modem control unit in 8251?


The modem control unit handles the modem handshake signals to coordinate the communication
between the modem and the USART.

3. What is the use of 8251 chip?


Intel’s 8251A is a universal synchronous asynchronous receiver and transmitter compatible with Intel’s
Processors. This may be programmed to operate in any of the serial communication modes built into it. This
chip converts the parallel data into a serial stream of bits suitable for serial transmission. It is also able to
receive a serial stream of bits and converts it into parallel data bytes to be read by a microprocessor.

4. What are the different types of methods used for data transmission?
The data transmission between two points involves unidirectional or bi-directional transmission of
meaningful digital data through a medium.
(a)Simplex (b)Duplex (c)Half Duplex

5.What are the various programmed data transfer methods?


)Synchronous data transfer
ii)Asynchronous data transfer
iii)Interrupt driven data transfer

6.What is synchronous data transfer?


It is a data method which is used when the I/O device and the microprocessor match in speed. To
transfer a data to or from the device, the user program issues a suitable instruction addressing the device. The
data transfer is completed at the end of the execution of this instruction.

7. What is asynchronous data transfer?


It is a data transfer method which is used when the speed of an I/O device does not match with the speed
of the microprocessor. Asynchronous data transfer is also called as Handshaking.

8. Give the register organization of 8257?


The 8257 perform the DMA operation over four independent DMA channels. Each of the four channels
of 8257 has a pair of two 16-bit registers. DMA address register and terminal count register.

9. What is memory mapping?


The assignment of memory addresses to various registers in a memory chip is called as memory
mapping.

10. What is I/O mapping?


The assignment of addresses to various I/O devices in the memory chip is called as I/O mapping.

AIM:
To find display the RAM SIZE of the system.

ALGORITHM
Steps to be followed in program
EXP.NO :
DATE :

i) fill the memory with data in RAM


ii) check how much memory correctly filled with data
iii) initialization of lcd
iv) display “RAM SIZE”
v) Read the count value and display the count value as RAM size.

PROGRAM FOR DISPLAY RAM SIZE

ADDRE LABEL MNEMONICS OPCODE COMMENT


SS
EXP.NO :
DATE :
EXP.NO :
DATE :

OUTPUT

RAM SIZE DISPLAYED IN LCD(16kB)

RESULT:
Thus to find display the ram size of the system is performed successfully.

VIVA-VOCE QUESTIONS & ANSWERS

1. List all the registers used in 8051 microcontroller in brief.


Accumulator, B-registers and four register banks may be used as general purpose registers.
EXP.NO :
DATE :

2. What are the flags in 8086?


In 8086 Carry flag, Parity flag, Auxiliary carry flag, Zero flag, Overflow flag, Trace flag, Interrupt flag,
Direction flag, and Sign flag.

3.Why crystal is a preferred clock source?


Because of high stability, large Q (Quality Factor) & the frequency that doesn’t drift with aging. Crystal
is used as a clock source most of the times.

4.In 8085 which is called as High order / Low order Register?


Flag is called as Low order register & Accumulator is called as High order Register.

5.What is Tri-state logic?


Three Logic Levels are used and they are High, Low, High impedance state. The high and low are
normal logic levels & high impedance state is electrical open circuit conditions. Tri-state logic has a third line
called enable line.

6.What happens when HLT instruction is executed in processor?


The Micro Processor enters into Halt-State and the buses are tri-stated.

7.Which Stack is used in 8085?


LIFO (Last In First Out) stack is used in 8085.In this type of Stack the last stored information can be
retrieved first

8.What is Program counter?


Program counter holds the address of either the first byte of the next instruction to be fetched for
execution or the address of the next byte of a multi byte instruction, which has not been completely fetched. In
both the cases it gets incremented automatically one by one as the instruction bytes get fetched. Also Program
register keeps the address of the next instruction.

9.What are the various registers in 8085?


Accumulator register, Temporary register, Instruction register, Stack Pointer, Program Counter are the
various registers in 8085

10.What is 1st / 2nd / 3rd / 4th generation processor?


The processor made of PMOS / NMOS / HMOS / HCMOS technology is called 1st / 2nd / 3rd / 4th
generation processor, and it is made up of 4 / 8 / 16 / 32 bits.

AIM:
To provide the time delay using counters.

ALGORITHM
EXP.NO :
DATE :

Here the time delay is generated using CX register


Steps to be followed in program
i) lcd initialization
ii) display one character
iii) get the time delay value and display character with time delay

PROGRAM FOR TO PROVIDE THE TIME DELAY USING COUNTERS.

ADDRE LABEL MNEMONICS OPCODE COMMENT


SS

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

RESULT:
Thus to provide the time delay using counters is performed successfuly.

VIVA-VOCE QUESTIONS & ANSWERS

1. Give the additional features of 8259A controller?


 Input triggering
 Interrupt Status
EXP.NO :
DATE :

 Poll Method

2. How the signals of the 8237 are classified?


The signals are classified in to two groups.
i. One group of signals are used for interfacing with the MPU
ii. Second group for communicating with the peripherals.

3. How long the INTR pulse stays high?


The INTR pulse can remain high until the interrupt flip-flop is set by the EI instruction in the service
routine.

4. What is the purpose of 8255 PPI?


The 8255A is widely used, programmable, parallel I/O device .It can be programmed to transfer data
under various conditions, from simple I/O to interrupt I/O.

5.List the operating modes of 8255A PPI?


Two 8-bit ports (A and B)
Two 4-bit ports(Cu and CL )
Data bus buffer
Control logic

6.Specify the bit of a control word for the 8255, which differentiates between the I/O mode and the BSR mode?
 BSR mode D7=0,
 I/O mode D5=1

7.Write the input /output feature in Mode 9 for the 8255A PPI?
Outputs are latched
Inputs are not latched

8. Give the difference between JZ and JNZ?


 JZ change the program sequence to the location specified by the 16-bit address if the zero flag is
set
 JNZ change the program sequence to the location specified by the 16-bit address if the zero flag
is reset.
9. What is CMA?
Complements the data in the accumulator.

10. What is CALL instruction?


CALL instruction change the sequence to the location of a subroutine.

AIM:
To write an assembly language program in 8086 to Traffic light control

ALGORITHM:
 Turn on Go signal in Road 1.
 Call the delay sub routine 2
EXP.NO :
DATE :

 Turn on Ready signal in Road 2 .


 Call the delay subroutine 4
 Turn on the Go signal n road 2.
 Call the delay (2) outine.
Turn on Ready signal in Road 3
Call the delay (1) routine.
Turn on Go signal in Road 3.
Call the delay (2) routine
Turn on READY signal in Road 4
Call the delay (1) routine.
Turn on Go signal in Road 4.
Call the delay (2) routine.
Turn on Stop signals in all the roads.
Turn on walk signals in all the roads.
Call the delay (2) routine.
Go to Step —1.

FLOWCHART

PROGRAM FOR TRAFFIC LIGHT CONTROL

ADDRESS LABEL MNEMONICS OPCODE COMMENT


EXP.NO :
DATE :

RESULT:
Thus the program of traffic light program performed successfully.

VIVA-VOCE QUESTIONS & ANSWERS

1. What do you mean by the term embedded controllers ?


The devices that has all the functional blocks on chip, including the program and data memory and
there is no external data/address bus provided.
For example, ATMEL89C2051.
EXP.NO :
DATE :

2. Discuss the advantages of microcontrollers over microprocessors in control applications?


The first main advantage is that the ALUs can be assembled together horizontally to form computers
that can handle very large data at a time. Another advantage is bit slice design that makes use of possible
bipolar chip technology that is very fast.

3. What are RISC and CISC processors?


RISC chips requires lesser hardware implementations, which makes them simpler to design and hence
lesser costs of production.

4. Discuss the criteria for selecting a microcontroller device.


It must have RAM and ROM to support its inbuilt functions. It must have +5v supply, must be fast and
should have programmable and data memory.

5. List few features of 8051 microcontroller?


Operating frequency is 12MHZ, separate 64k program and 64k data memory, multiply and divide
instructions has a boolean processor.

6. Discuss the advantages and disadvantages of Harvard and Von Neuman architectures.
Harvard architecture uses separate memories for program and data memory whereas
Von Neuman uses same program and data memory. Therefore Harvard is faster compared to other one.

7. What is the purpose of ALU ?


ALU performs arithmetic and logical operation on 8- bit operands. Accumulator is the register which
gets the output of the ALU in most of the arithmetic and logical operations.

8. Name 2 register that consists of 16 bit.


Program counter and Data pointer

9. Name few general purpose registers


Accumulator, B-register, R0- R7

10. What are SFR?


The 128 bytes of on-chip additional RAM locations from 80H to 0FFH are reserved for the special
functions and therefore these are called as special function register.

AIM:
To write an assembly program to make the stepper motor run in forward and reverse direction.

ALGORITHM:
Step 1 : Load the ‘HL’ pair wit value from table
Step 2 : Move it to ‘B’ register for setting the counter
Step 3 : Move the memory value to accumulator and display it by control word
EXP.NO :
DATE :

Step 4 : Load ‘DE’ register pair with FFFF for starting delay subroutine
Step 5 : Run the delay loop control D-register becomes zero.
Step 6 : Increment ‘H’ address for next value from table
Step 7 : Jump on no zero
Step 8 : When B = 0, go to start and restart the program

FLOWCHART

PROGRAM FOR STEPPER MOTOR

ADDRE LABEL MNEMONICS OPCODE COMMENT


SS
1000 START MOV AX,DATA

MOV DS,AX
EXP.NO :
DATE :

MOV AL,80H

MOV DX,CWRD

OUT DX,AL

MOV DX,PORTA

MOV AL,88H

UP CALL DELAY

ROL AL,01H

OUT DX,AL

JMP UP

DELAY MOV CX,0FFFFH

UP2 MOV BX,0FFH

UP1 DEC BX

JNZ UP1

DEC CX
JNZ UP2
RET
MOV AH,4CH

INT 21H

Input:
Input address Value Direction Input address Value Direction
0A Forward 09 Reverse
06 direction 05 direction
05 06
09 0A

RESULT:
Thus To write an assembly program to make the stepper motor run in forward and reverse direction is
performed successfully.

VIVA-VOCE QUESTIONS & ANSWERS

1.What is the purpose for scan section in keyboard interface?


The scan section has a scan counter and four scan lines. These scan lines can be decoded using a 4-to-16
decoder to generate 16 lines for scanning.
EXP.NO :
DATE :

2. What is USART?
USART is an integrated circuit. It is a programmable device its function and specifications for serial I/O
can be determined by writing instructions in its internal registers.

3. Define parallel to serial conversion?


In serial transmission an 8-bit parallel word should be converted in to a stream of eight serial bits. This
is known as parallel to serial conversion.

4. Define simplex transmission?


In simplex transmission, data are transmitted in only one direction.
Example: transmission from a microcomputer to a printer.

5. Define Baud?
The rate at which the bits are transmitted is called Baud.

6.List the major components of 8251A programmable communication interface?


Read/Write control logic
Three buffer registers
Data registers
Control register transmission receiver
Data bus buffer
Modem control

7.Write the steps necessary to initialize a counter in write operation?


Write a control word into the control register
Load the low-order address byte
Load the high order byte

8.Give the various modes of 8254 timer?


Mode 0:interrupt or terminal count
Mode 1:Rate generator
Mode 3:square wave generator
Mode 4:software triggered strobe
Mode 5:hardware triggered strobe

9.What is read back command in 8254 timer?


The Read Back command in 8254 allows the user to read the count and the status of the counter.

10. What is transmitter section in USART?


The transmitter section accepts parallel data from the MPU and converts them into serial data. It has two
registers. A buffer register and an output register

AIM:
To write an Assembly Language Program (ALP) to interface of keyboard and display.

ALGORITHM :
1. Initialize the counter
2. Set 8279 for 8 digit character display, right entry
3. Set 8279 for clearing the display
4. Write the command to display
EXP.NO :
DATE :

5. Load the character into accumulator and display it


6. Introduce the delay
7. Repeat from step 1.

FLOWCHART:

SET UP POINTER

INITIALIZE THE COUNTER

SET 8279 FOR 8-DIGIT CHARACTER DISPLAY

SET 8279 FOR CLEARING THE DISPLAY

WRITE THE COMMAND TO DISPLAY

LOAD THE CHARACTER INTO ACCUMULATOR AND DISPLAY

DELAY

PROGRAM FOR INTERFACING OF KEYBOARD AND DISPLAY


ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 START MOV SI,1200 C7,C6,00,1 Assign 1200 to SI.


2
1004 MOV CX,000F Initialize the count.
C7,C1,0F,0
1008 MOV AL,10 0 Move mode & display.
EXP.NO :
DATE :

100B OUT C2,AL C6,C0,10 Set command word & out it.

100D MOV AL,000C E6,C2 Move clear the word cw.

1010 OUT C2,AL C6,C0,CC To display RAM & out it.

1012 MOV AL,90 E6,C2 Move the write display.

1015 OUT C2,AL C6,C0,90 CW to data to read D/R.

1017 NEXT MOV AL,[SI] E6,C2 Move the content SI.

1019 OUT C0,AL 8A,04 Content of AL & out it.

101B CALL DELAY E6,C0 Call delay.

101E INC SI E8,E2,04 Increment SI value.

101F LOOP NEXT 46 Loop to next label.

1021 JMP START E2,F6 Jump to start condition.

1024 DELAY MOV DX,9FFF E9,DC,FF Call the delay.

1028 LOOP 1 DEC DX C7,C2,FF, Decrement DX register.


A0
1029 JNZ LOOP1 Jump no zero to loop1.
4A
102B RET Return.
75,FD

C3

DELAY PROGRAM:
ADDRESS LABEL MNEMONICS OPCODE COMMENT

DELAY MOV C7,C2,FF, Move the value to DX register.


DX,0A0FF A0
LOOP Decrement DX value.
DEC DX 4A
Jump no zero to loop.
JNZ LOOP 75,FD
Return.
RET C3

OUTPUT:
EXP.NO :
DATE :

ADDRESS DATA
1200 FF FF FF FF
1204 98 68 C8 7C
1208 FF FF 1C 29
120C FF FF FF FF

RESULT:
Thus To write an Assembly Language Program (ALP) to interface of keyboard and display is performed
successfully.

VIVA-VOCE QUESTIONS & ANSWERS

1. What are the three basic multiprocessor configurations that the 8086 can support?
(May/June 2009, Nov/Dec 2003)
Coprocessor Configuration, Closely Coupled Configuration, Loosely Coupled Configuration

2. What do you mean by numeric processor? (May/June 2009, Nov/Dec 2007)


8087 is the numeric processor or numeric co-processor. It adds arithmetic, trigonometric, exponential
and logarithmic instructions to 8086 / 8088 instruction set for all data types
EXP.NO :
DATE :

3.Define Multiprocessing system. (May-11)


If a microprocessor system contains two or more components that can execute instructions (independently)
simultaneously, then the system is called multiprocessing system.

4.State the advantages of multiprocessor system. (May-07)


1) Improves cost/ performance ratio of the system
2) Several processor may be combined to fit the needs of an application while avoiding the expense of the
unneeded capabilities of a centralized system. Yet this system provides room for expansion.

5.What are the necessary steps to be followed to form a complex, loosely coupled multiprocessor system?
1) A single 8086 or 8088 or an independent processor such as an 8089.
2) A cluster of processors consisting of an 8086 or 8088 and a coprocessor (such as an 8087) and/or
independent processors.
3) A cluster of independent processors (such as two 8089s).
6.What is computer network?
By using serial links, many microcomputer systems can communicate with each other and share some of the
same hardware and software resources. Large systems of this type are called computer networks
7.Define communication protocol.
Commands and data are transmitted as message packets. Each packets normally includes several fields
containing such things as synchronization characters, the sender’s address, the receiver’s address, the text, error
detection characters, and termination characters.
8. What is need for 8087 coprocessor with 8086/8088 single chip microprocessor?
Although the 8086 and 8088 are powerful single chip microprocessors, their instruction set is not sufficient to
effectively satisfy some complex applications.
9. Write short notes on CBRQ and BCLK signals.
CBRQ (COMMON BUS REQUEST): instructs the arbiter if there are any other arbiters of lower priority
requesting the use of the multi-master system bus.
BCLK ( BUS CLOCK): The multi-master system bus clock to which all multi-master system bus interface
signals are synchronized.
10. Define a Instruction Cycle
Instruction cycle : Time required to complete the execution of an instruction. One instruction cycle consists of 3
to 6 machine cycles.

AIM:
To display the Printer Status in the display

ALGORITHM
 To divides my 3digit number by 100 giving me my, hundredth digit
 To prints the hundredth digit
 To save AX on the stack
 To restore AX on stack
 To divides the remainder by 10 giving me my tens digit
 To prints my tens digit
EXP.NO :
DATE :

 To save AX on the stack


 To restore AX on stack
 To print my last remainder which is my ones

PROGRAM FOR PRINTER STATUS


ADDRESS LABEL MNEMONICS OPCODE COMMENT
EXP.NO :
DATE :

RESULT:
Thus to perform the program for the printer is performed successfuly.

VIVA-VOCE QUESTIONS & ANSWERS


1. Name the signals used by 8086 to demultiplex the address/data bus and to control the data bus buffers.
8086 uses
i) ALE signal to demultiplex the address / data bus
ii) (Data Enable) and DT / (Data Transmit / Receive) signals to control
the data bus buffers.
2. What are the signals involved in memory bank selection in 8086 microprocessor?
The signals and A0 are involved in memory bank selection in 8086 microprocessor.
i)When = 0 odd bank (Bank 1) is selected
EXP.NO :
DATE :

ii)When A0 = 0 even bank (Bank 0) is selected.


3. How clock signal is generated in 8086? What is maximum internal clock frequency of 8086? (May-07)
The clock signal of 8086 is generated using 8284 clock generator. The crystal is connected to the crystal
oscillator input of 8284 to generate the clock signal. The maximum internal clock frequency of 8086 is 5MHz.
4. Write about the signals of 8086. (May-08)
(bus high enable) : low on this pin during the part of the machine cycle, indicates that at least one byte of
the current transfer is to be made on higher order byte AD 15 – AD8; otherwise the transfer is made on lower
order byte AD7 – AD0.
5. write about signals of 8086
: this signal indicates that an instruction with a LOCK prefix is being executed and the bus is not to be
used by another processor.
6. What happen in 8086 when = 0 and DT / = 1? What is the advance signal name of write
command of MAX mode 8086? (May-08)
When = 0, the transceiver are enable to send or receive data. Since DT / = 1, the transceiver are used
to send data.
The signal name of write command of max mode 8086 is for memory write and for I/O
write.
7. Write the functions of ICW3 and ICW4 in 8259A PIC.
ICW3 is significant only in systems including more than one 8259A and is output to only if SNGL=0.
ICW4 is output to only if IC4 (ICW1) is set to 1, otherwise, the contents of ICW4 is cleared.
8. What are the uses of different OCWs?
The command word OCW1 is used for masking interrupt requests; when the mask bit corresponding to an
interrupt request is set to 1, then the request is blocked.
OCW2 and OCW3 are for controlling the mode of the 8259A and receiving EOI commands.
9. Write short notes on NMI (I)
NMI (I): Non-Maskable Interrupt
An edge triggered input, causes a type-2 interrupt. A subroutine is vectored to via the interrupt vector look up
table located in system memory. NMI is not maskable internally by software. A transition from a LOW to
HIGH on this pin initiates the interrupt at the end of the current instruction. This input is internally
synchronized.
10. write short notes on RD(0) signals
RD (O): READ The Read strobe indicates that the processor is performing a memory or I/O read cycle.

AIM:
To write an assembly language program for serial communication between microprocessor.

ALGORITHM:
1. Start the program
2. Move 36H al reg & output value from AL to CE
3. Move the data 10 to AL reg
4. Output value from AL to CB register
5. Move the data 00 to AL reg & output value from AL to c8
EXP.NO :
DATE :

6. Move the data 37 to AL reg & output value from AL to c2


7. Input value from C2 to AL reg
8. Perform AND operation AL with 0H
9. If jump zero means go to add 1014
10. Move AL into 41 & Output value from AL to C0
11. Stop the program.

FLOWCHART:
START

Move 36 into AL and output from AL to CE

Move the data of 10 into AL register

Output data from AL to C2 port

Move the data of AL to C2

Output data from 3F to AL port

Input value from C2 to AL

Perform AND operation

Output value from AL to C0

STOP

PROGRAM FOR SERIAL COMMUNICATION

TRANSMITTER
ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV AL,36 Move code word 36 to the


accumulator
1003 OUT CE,AL Send code word CE from
EXP.NO :
DATE :

accumulator
1005 MOV AL,10 Move code word 10 to the
accumulator
1008 OUT C8,AL Send code word C8 from
accumulator
100A MOV AL,00 Move code word 00 to the
accumulator
100D OUT C8,AL Send code word C8 from
accumulator
100F MOV AL,AE Move code word AE to the
accumulator
1012 OUT C2,AL Send code word C2 from
accumulator
1014 MOV AL,87 Move code word 87 to the
accumulator
1017 OUT C2,AL Send code word C2 from
accumulator
1019 LOOP IN AL,C2 Move the value of C2 to AL

101B AND AL,04 Perform the AND operation.

101E JZ LOOP Jump zero to loop

1020 MOV AL,41 Move code word 41 to the


accumulator
1023 OUT C0,C6 Send code word C0 from C6

1025 INT 02 Interrupt 02 is delated

RECEIVER
ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV AL,36 Move code word 36 to the


accumulator
1003 OUT CE,AL Send code word CE from
accumulator
1005 MOV AL,10 Move code word 10 to the
accumulator
EXP.NO :
DATE :

1008 OUT C8,AL Send code word C8 from


accumulator
100A MOV AL,00 Move code word 00 to the
accumulator
100D OUT C8,AL Send code word C8 from
accumulator
100F MOV AL,AE Move code word AE to the
accumulator
1012 OUT C2,AL Send code word C2 from
accumulator
1014 MOV AL,37 Move code word 37 to the
accumulator
1017 OUT C2,AL Send code word C2 from
accumulator
1019 LOOP IN AL,C2 Move the value of C2 to AL

101B AND AL,02 Perform the AND operation.

101E JNZ LOOP Jump no zero to loop

1020 IN AL,C0 Move code word 41 to the


accumulator
1023 MOV BX,1500 Send 1500 to BX register

1025 MOV [BX],AL Move the value AL to BX


register
1028 INT 02
Interrupt 02 is delated

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1022 41 1500 41

RESULT:
Thus the assembly language program for serial communication between microprocessor.
VIVA-VOCE QUESTION AND ANSWERS

1.What is a Microprocessor?
Microprocessor is a program-controlled device, which fetches the instructions from memory, decodes
and executes the instructions. Most of the Micro Processors are single- chip devices.

2.What are the various interrupts in 8086?


Maskable interrupts, Non-Maskable interrupts.

3.What is meant by Maskable interrupts?


An interrupt that can be turned off by the programmer is known as Maskable interrupt.
EXP.NO :
DATE :

4.What is Non-Maskable interrupts?


An interrupt which can be never be turned off (ie.disabled) is known as Non-Maskable interrupt.

5.Which interrupts are generally used for critical events?


Non-Maskable interrupts are used in critical events. Such as Power failure, Emergency, Shut off etc.,

6.Give examples for Maskable interrupts?


RST 7.5, RST6.5, RST5.5 are Maskable interrupts

7.Give example for Non-Maskable interrupts?


Trap is known as Non-Maskable interrupts, which is used in emergency condition.

8.What is the Maximum clock frequency in 8086?


5 MHZ is the Maximum clock frequency in 8086.

9.What are the various segment registers in 8086?


Code, Data, Stack, Extra Segment registers in 8086.

10.Which Stack is used in 8086?


FIFO (First In First Out) stack is used in 8086.In this type of Stack the first stored information is
retrieved first.

AIM:
To write an assembly language program for parallel communication between microprocessor.

ALGORITHM
1. Start the program
2. Move the data of 82H into AL
3. Output data from AL to 26H
4. Move the data of 3FH into AL
5. Output data from AL to 20H
6. Move the data of 22H into AL
7. Output data from AL to 3FH
EXP.NO :
DATE :

8. If jump no carry means follows 100A address


9. Output data from AL to 3FH
10. Move the data of 24H into AL
11. Output data from AL to 20H
12. Call the address
13. Interrupt the data of 20
14. Move the content of 05H into BL
15. Move the data of 0FFH into DL reg
16. Decrement DL reg
17. If jump no carry follows address 1029
18. Decrement BL reg & relation between the value
19. Stop the program

FLOWCHART: START

Move 82 into AL and output from AL to 26

Move the data of 36 into AL register

Output data from AL to 20

Input data between 22h to AL

Subtract AL with 3FH

Move the data of 24 into AL register

Output data from AL to 26

Return the value

STOP
PROGRAM FOR PARALLEL COMMUNICATION

TRANSMITTER:
ADDRESS LABEL MNEMONICS OPCODE COMMENT
1000 MOV AL,82H Move code word 82 to the
accumulator
1003 OUT 26,AL Send code word 26H from
accumulator
1005 MOV AL,3F Move code word 3F to the
accumulator
1008 OUT 20,AL Send code word 20H from
EXP.NO :
DATE :

accumulator
100A LOOP IN AL,22H Move the value of 22 to AL

100C SUB AL,3F Subtract 3F if no zero

100F JNC LOOP Jump no carry to loop

1011 MOV AL,24 Move code word 24 to the


accumulator
1014 OUT 20H,AL Send code word 20H from
accumulator
1010 CALL DELAY Call the delay program

1019 INT 02 Interrupt 02 is delated

RECEIVER
ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV AL,90 Move code word 90 to the


accumulator
1003 OUT 26,AC Send code word 26H from
accumulator
1005 CHECK IN AL,20 Get the data 20H from to
accumulator
1007 SUB AL,3F Subtract 1005 if no zero
EXP.NO :
DATE :

100A JNZ CHECK Check in no zero is generator

100C MOV AL,3F Move the value to 3F to


accumulator
100F OUT 22,AL Send the value to point B from
AL
1011 MOV CL,08 Move the value 08H to CL
register
1014 CALL DELAY Call the sub program to 1029

1017 MOV SI,1200 Send 1200 to SI

101B L1 IN AC,20 Move the value of 20 to AC

101D MOV[SI],AL Move the value of SI address of


AL
101F CALL DELAY Call the delay program

1022 INC SI Increment stack index

1023 DEC CL Decrement CL register

1025 JNC 4 Jump to 4 if no zero in generated

1027 INT 02 Interrupt 02 is delated

102A DELAY MOV BL,05 Move 05 to BL

102C LION MOV DC,FF Move FF to DL

102F L2 DEC DL Decrement DL

1031 JNC L2 Jump to L2 if no zero

1033 DEC BL Decrement BL

1035 JNC LION Loop to lion if no zero is


generated
1037 RET Return to main program

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1013 EF 1200 EF
1201 EF
1202 EF
1203 EF
1204 EF
1205 EF
1206 EF
1207 EF
EXP.NO :
DATE :

RESULT:
Thus the assembly language program for parallel communication between microprocessor was verified.

VIVA-VOCE QUESTIONS & ANSWERS


1. Give the additional features of 8259A controller?
1) Input triggering
2) Interrupt Status
3) Poll Method
2.What are the signals used by the DMA controller?
1) HLDA-HOLD acknowledge
2) DMA request
3) DMA acknowledge
EXP.NO :
DATE :

4) AEN–address enable
5) ADSTB - address strobe
3.Write short notes on RQ/GT0 and RQ/GT1 (I/O) signals. (Dec-06)
These pins are used by other processors in a multi-processor organization. Local bus masters of other
processors force the processor to release the local bus at the end of the processors current bus cycle.
Each pin is bi-directional and has an internal pull up resistors. Hence they may be left un-connected.
4. Give a short notes on QS0, QS1 (O) signals. (May-08)
Queue Status is valid during the clock cycle after which the queue operation is performed. QS0, QS1
provide status to allow external tracking of the internal 8086 instruction queue.
5.What are the principle types of I/O.
 Programmed I/O
 Interrupt I/O
 Block transfers and DMA.
6.Write the working procedure of programmed I/O?
CPU requests I/O operation, I/O module performs operation, I/O module sets status bits, CPU checks
status bits periodically, I/O module does not inform CPU directly
7.Write the basic operations of interrupt I/O?
i) CPU issues read command
ii) I/O module gets data from peripheral whilst CPU does other work
iii) I/O module interrupts CPU
iv) CPU requests data
v) I/O module transfers data
8.Define DMA.
To execute an instruction that causes a single byte or word to be transferred and the other is to execute
a sequence of instruction that causes a special system component associated with the interface to
transfer a sequence of bytes or word to or from a predesignated block of memory locations.
9.What is memory buffer?
If several bytes or word are required, then it is necessary to transfer them to a set of consecutive
locations in memory before they are used.
10.What do you meant by double buffering?
Some operations may employ more than one memory buffer so that one buffer can be input to while
other buffer is being operated on; then, when the buffer being filled is full, it can be operated on and
the input can be directed to the other buffer.
AIM:
To write an Assembly Language Program (ALP) to interface ADC with 8086 microprocessor.

ALGORITHM
1. Initialaize the ADC
2. Start the conversion.
3. Wait for end of conversion.
4. Store the converted digital output.

FLOWCHART:

START
EXP.NO :
DATE :
EXP.NO :
DATE :

PROGRAM FOR ADC USING 8086

ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 MOV AL,10 C6,C0,10 Move 10 into AC.

1003 OUT C8,AL E6,C8 Move the value of AL & display


it.
1005 MOV AL,18 C6,C0,18
Move 18 into AL.
1008 OUT C8,AL E6,C8
Move the AL value into C8 &
display out it.
100A HLT F4
Stop the program.

OUTPUT:

VOLTAGE BINARY OUTPUT


1V 0011 1000 38
2V 0110 1111 6F
3V 1010 1001 AF
4V 1101 1110 DE

RESULT:
Thus the Assembly Language Program (ALP) to interface ADC with 8086 microprocessor was verified.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS


1.Define uniprogramming system.
A process is a programming unit which performs an independent task. When process are executed in
serial fashion, the system is called uniprogramming system.

2.What is multiprogramming system.


In contrast, for a multiprogramming environment, the code for two or more processes is in memory at
the same time and is executed in a multiplexed fashion

3.Define system throughput.


The performance of a system is often measured by the number of jobs finished in a period of time, a
quantity that is referred to as the system throughput.

4.What is fqp?
Fqp-forward queue pointer, which indicates the next element in the list, and a process control pointer
for locating a block of memory that is used to store important information related to the process.

5.What is “serially reusable resource” in multiprogramming system?


In multiprogramming system, processes are allowed to share common software and data resources as
well as hardware resources

6.Define mutual exclusion in multiprogramming system.


Preventing two or more processes from simultaneously entering their critical sections for accessing a
shared resource is called mutual exclusion.

7.What is mutual blocking in semaphore?


If a switch from, say, process 1 to process 2 occurs between the MOV and TEST instruction, the
process 2 might clear FLAG2, causing both flag to be 0.

8.What is semaphore?
A flag used to reverse a shared resource is called semaphore and the operation of requesting and
releasing the resource are commonly known as the P and V semaphore operators.

9.What are the operating modes of 80286?


Two mode of operations
Real mode-Which operates as fast 8086/8088
Protected mode – Which enhances memory management, multitasking and protection multitasking
and protection.

10.How to access segments in 80286?


The 80286 microprocessor keeps the base address and limits for the descriptor tables currently in use in
internal registers
EXP.NO :
DATE :

AIM:
To write an Assembly Language Program (ALP) to interface DAC with 8086 microprocessor.

ALGORITHM
1. Send 00h to DAC to generate lower amplitude.
2. Call delay based on required frequency.
3. Send FFh to DAC to generate higher amplitude.
4. Call delay based on required frequency.
5. Repeat the above steps continuously.

FLOWCHART:

START

SEND THE DIGITALVALUE TO ACCUMULATOR

TRANSFER THE ACCUMULATOR CONTENTS TO DAC

READ THE CORRESPONDING ANALOG VALUE

STOP
EXP.NO :
DATE :

PROGRAM FOR DAC USING 8086


ADDRESS LABEL MNEMONICS OPCODE COMMENT

1000 START MOV AL,00 Move 00 value to AL register.

1003 OUT C8,AL Move AL & out it.

1005 CALL NEXT Call next.

1008 MOV AL,OFF Move OFF to AL register.

100B OUT C8,AL Move value AL into c8 & out it.

100D CALL NEXT Call next.

1010 JMP START Jump start.

1013 NEXT MOV CX,05FF Move 05FF value into CX


register.
1017 NEXT1 LOOP NEXT1
Loop next1.
1019 RET
Return.

OUTPUT:

Signal AMPLITUDE TIME PERIOD FREQUENCYSQUARE


WAVE
SQUARE WAVE 2.4*5=7 2.4*5=12ms 100HZ

RESULT
Thus, the programs for Interfacing DAC operations have been executed using 8086 Microprocessor.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS

1.Give the different types of command words used in 8259a?


The command words of 8259A are classified in two groups
i) Initialization command words (ICWs)
ii) Operation command words (OCWs)

2.Define scan counter? APRIL/MAY 2011


The scan counter has two modes to scan the key matrix and refresh the display. In the encoded mode,
the counter provides binary count that is to be externally decoded to provide the scan lines for keyboard and
display.

3.What is the use of modem control unit in 8251?


The modem control unit handles the modem handshake signals to coordinate the communication
between the modem and the USART

4.What is interfacing?
An interface is a shared boundary between the devices which involves sharing information. Interfacing
is the process of making two different systems communicate with each other.

5.What is control word? What is the purpose of control word written to control register in 8255?
Control word: It is a word stored in a register (control register) used to control the operation of a program
digital device.

6.What is the size of ports in 8255?


 Port-A : 8-bits
 Port-B : 8-bits
 Port-CU : 4-bits
 Port-CL : 4-bits

7.What is an USART? List the uses of USART.
USART stands for Universal Synchronous/Asynchronous Receiver/Transmitter. It is a programmable
communication interface that can communicate by using either synchronous or asynchronous serial data.

8.What is memory mapping?


The assignment of memory addresses to various registers in a memory chip is called as memory
mapping.

9.List the major components of 8279 keyboard/Display interface.


a. Keyboard section b. Scan section
c. Display section d. CPU interface section

10. Define HRQ?


The hold request output requests the access of the system bus. In non- cascaded 8257 systems, this is
connected with HOLD pin of CPU.
EXP.NO :
DATE :

AIM:
To write an assembly language program to add the two 8-bit numbers using 8051 Microcontroller
instruction set.

ALGORITHM
1. Clear C-register for carry.
2. Move the first data to Accumulator.
3. Add the second data with Accumulator.
4. Store the sum in memory pointed by DPTR.

FLOWCHART:

START

Clear PSW

Select Register
Bank

Load A and R 0
with 8- bit datas

Add A & R 0

Store the sum

STOP
EXP.NO :
DATE :

PROGRAM FOR ADDITION OF TWO 8-BIT NUMBER USING 8051

ADDRESS LABEL MNEMONICS OPCODE COMMENT

4100 CLR C C3 Clear the carry flag.

4101 MOV A,# 11 74,11 Move the first data to A register.

4103 ADD A,# 22 24,22 Add the second data with the data
in A register.

4105 MOV DPTR,#4500 90,41,50 Move the output address to data


pointer.

4108 MOVX @DPTR,A F0 Move the output data to the data


pointer.

4109 INC DPTR A3 Increment the data pointer.

410A MOV A,# 33 74,33 Move the first data to the


accumulator.
410C ADD A,# 44 34,44 Add the second data with the
accumulator.

410E MOVX @DPTR,A F0,80 Move the output data to the data
pointer.

410F HERE SJMP HERE FE End of the program.

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

4101 11
4500 33
4103 22

410A 33 4501 77

410C 44

RESULT
Thus, the assembly language program to add the two 8-bit numbers using 8051 instruction set was
written and executed successfully.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS


1.What is the use of stepper motor?
A stepper motor is a device used to obtain an accurate position control of rotating shafts. A stepper
motor employs rotation of its shaft in terms of steps, rather than continuous rotation as in case of AC or DC
motor.

2.What is TXD & RXD?


TXD- Transmitter Data Output This output pin carries serial stream of the transmitted data bits along with other
information like start bit, stop bits and priority bit.
RXD- Receive Data Input This input pin of 8251A receives a composite stream of the data to be received by
8251A

3.What is swapping?
The procedure of fetching the chosen program segments or data from the secondary storage into the
physical memory is called ‘swapping’.

4.Write the function of crossbar switch?


The crossbar switch provides the inter connection paths between the memory module and the processor.

5.What is a data amplifier?


Transceivers are the bi-directional buffers are sometimes they are called as data amplifiers. They are
required to separate the valid data from the time multiplexed address data signal.

6.What is the use of handshaking signals?


It is used to data transfer method which is used when the speed of an I/O device does not match with the speed
of the microprocessor. Asynchronous data transfer is also called as Handshaking.

7.What is the use of modem control unit in 8251?


The modem control unit handles the modem handshake signals to coordinate the communication between the
modem and the USART.

8.What are the different peripheral interfacing used with 8086 microprocessor? May/June 13
8255 PPI, 8259 PIC, 8251 USART, 8279 Key board display controller and 8253 Timer/ Counter – Interfacing with
8085 - A/D and D/A converter interfacing.

9.What are the applications of D/A converter interfacing with 8255? MAY/JUNE 12
1. Microprocessor based process control system
2. Stepper motor interfacing
3. Centronic interfacing

10.State the use of ISR

The Interrupt Service Register (ISR) stores all the levels that are currently being serviced.
EXP.NO :
DATE :

AIM:
To write an assembly language program to subtract the two 8-bit numbers using 8051 Microcontroller
instruction set.

ALGORITHM
1. Clear C-register for carry.
2. Move the first data to Accumulator.
3. Subtract the second data with Accumulator.
4. Store the sum in memory pointed by DPTR.

FLOWCHART:

START

CLEAR CARRY FLAG

GET I’ST OPERAND IN


ACCR

SUBTRACT THE 2’ND


OPERAND FROM ACCR

NO

IS CF=1

INCREMENT THE
BORROW REGISTER

STORE RESULT IN
MEMORY

STOP
EXP.NO :
DATE :

PROGRAM FOR SUBTRACTION OF TWO 8-BIT NUMBER USING 8051

ADDRESS LABEL MNEMONICS OPCODE COMMENT

4100 CLR C C3 Clear the carry

4101 MOV A,#20 74,20 Move the first data to the


accumulator.

4103 SUBB A,#10 94,10 Subtract the second data with the
accumulator.

4105 MOV DPTR,#4500 90,45,00 Move the output address to the


data pointer.

4108 MOVX @DPTR,A F0 Move the output value to the data


pointer.

4109 HERE SJMP HERE 80,FE End of the program.

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

4102 20
4500 10
4104 10

RESULT
Thus, the assembly language program to subract the two 8-bit numbers using 8051 instruction set was
written and executed successfully.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS


1.What are the features of 8259? May/June 14
 It is programmed to work with either 8085 or 8086 processor.
 It manages 8-interrupts according to the instructions written into its control registers.

2.How data is transmitted in asynchronous serial transmission? May/June 14


Data to be transmitted is sent out one character at a time and the receiver end of the communication line
synchronization is performed by examining synchronization bits that are included at the beginning and at the
end of each character

3.Write the Features of 8255A.


1. The 8255A is a widely used, programmable, parallel I/O device.
2. It can be programmed to transfer data under various conditions, from simple I/O to interrupt I/O.
3. It is compatible with all Intel and most other microprocessors.
4. It is completely TTL compatible.

4.What is the function of gate signal in 8254 timer?


The gate signal in 8254 is used as the gate input of counters. CLKO, CLK1 gate signals are given to counter
0, counter 1 and counter 2 respectively.

5.What is meant by DMA operation? State its advantages


DMA stands for Direct Memory Access. In order to transfer bulk amount of data between memory and I/O device
without the involvement of CPU, this technique is used. The advantage of DMA is faster data transfer.

6.Name any four electronic devices which are used to interface high power devices with microprocessor.
1. Power transistor 2. Power MOSFET 3. Solid state relay.
2.
7.What is a load cell?
A load cell consist of strain gauges which are arranged in bridge form and when Excited by DC input, it
produces an output voltage proportional to the weight or load placed on it

8.What are the various programmed data transfer methods?


1. Synchronous serial data transmission
2. Asynchronous serial data transmission.
3. Interrupt driven data transfer
4.
9.Can an input port and an output port have the same port address? [APR / MAY 2010].
No, in peripheral mapped input / output, the peripheral is defined with an 8 bit address input and output devices
are different. So, different ports are assigned as input and output port.

10. Why is each channel in DMA controller restricted to 19Kbytes of data transfer?
Mostly we use 8085 and 8086 microprocessor to interface with DMA controller.
EXP.NO :
DATE :

AIM:
To write an assembly language program to multiply the two 8-bit numbers using 8051 Microcontroller
instruction set.

ALGORITHM
1. Clear C-register for carry.
2. Move the first data to Accumulator.
3. Move the second data to B-register.
4. Multiply the second data with Accumulator.
5. The higher order of the result is in B-register.
6. The lower order of the result is in Accumulator.
7. Store the sum in memory pointed by DPTR.

FLOWCHART:
START

GET MULTIPLIER
IN ACCR

GET MULTIPLICAND
IN B REG

MULTIPLY A WITH B

STORE RESULT IN
MEMORY

STOP
EXP.NO :
DATE :

PROGRAM FOR MULTIPLICATION OF TWO 8-BIT NUMBER USING 8051

ADDRESS LABEL MNEMONICS OPCODE COMMENT

4100 MOV A,#02 74,02 Move the first data to the


accumulator.
4102 MOV B,#40 75,F0,40 Move the second data to the b
register.
4105 MUL AB A4 Multiply the data in accumulator
and B register.

4106 MOV DPTR,#4500 90,45,00 Move to output address to the data


pointer.

4109 MOVX @DPTR,A F0 Move the output value to the data


pointer.

410A INC DPTR A3 Increment the data pointer.

410B MOV A,B E5,F0 Move the data in B register to the


accumulator.

410D MOVX @DPTR,A F0 Move the data of accumulator to


data pointer.

410E HERE SJMP HERE 80,F4 End of the program.

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

4100 02
4500 80
4102 40

RESULT
Thus, the assembly language program to multiply the two 8-bit numbers using 8051 instruction set was
written and executed successfully.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS


1. Define Baud rate.
Baud rate is defined as the number of signal events per second. In the present case, it is same as
bits per second.
2. Write about program/Processor status word. (Or) flags available in 8051?(Apr/May 15)
The Program Status Word (PSW) keeps the current status of the arithmetic and logical operations in
different bits
3. What are the advantages of microcontroller over microprocessor?
Less hardware required.
Less hardware increases reliability.
Supports internal memory which reduces access time.
4. How the RS -232C serial bus is interfaced to TTL logic device?
Hence for interfacing TTL devices to RS 232C serial bus, level converters are used. The popularly used
level converters are MC 1488 and MC1489 or MAX 232.
5. What are the tasks involved in keyboard interfacing?
The task involved in keyboard interfacing are sensing a keyboard interfacing are sensing a key actuation, de
bouncing the key and generatingkey codes

6. How a keyboard matrix is formed in keyboard interface ?


The return lines RL0 to RL7 of 8279 are used to form the columns of keyboard matrix.in decoded scan the
scan lines SLO to SL3 of 8279 are used to form the rows of keyboard matrix
7. What is scanning in keyboard
The process of sending a zero to each row of a keyboard matrix and reading the columns for key actuation
is called scanning
8. what is scan time?
the scan timeis the time taken by the processor to scan all the rows one by one starting from first row and
coming back to the first row
9. . Define watch dog timer.
Watch dog timer is a dedicated timer to take care of system malfunction. It can be used to reset the controller
during software malfunction, which is referred to as "Hanging
10. What is PWM
Pulse width modulation (PWM) is used to control the delivered power to load without losing the efficiency.
The speed of an electric motor is controlled by controlling the power source of motor
EXP.NO :
DATE :

AIM:
To write an assembly language program to divide the two 8-bit numbers using 8051 Microcontroller instruction
set.

ALGORITHM
1. Clear C-register for carry.
2. Move the first data to Accumulator.
3. Move the second data to B-register.
4. Multiply the second data with Accumulator.
5. The remainder of the result is in B-register.
6. The quotient of the result is in Accumulator.
7. Store the sum in memory pointed by DPTR.

FLOWCHART:
START

GET DIVIDEND IN
ACCR

GET DIVISOR IN B
REG

DIVIDE A BY B

STORE
QUOTIENT &
REMAINDER IN
MEMORY

STOP
EXP.NO :
DATE :

PROGRAM FOR DIVISION OF TWO 8-BIT NUMBER USING 8051

ADDRESS LABEL MNEMONICS OPCODE COMMENT

4100 MOV A,#08 74,08 Move the first data to


accumulator.
4102 MOV B,#04 75,F0,04 Move the second data to the B
register.

4105 DIV AB 67,35 Divide the data in accumulator


with B register.

4106 MOV DPTR,#4500 90,45,00 Move the output address to the


data pointer.

4108 MOVX @DPTR,A F0 Move the output data to the


data pointer.

4109 INC DPTR A3 Increment5 the data pointer.

410A MOV A,B E5,F0 Move the data in B register to


the accumulator.

410D MOVX @DPTR,A F0 Move the accumulator value to


the data pointer.

410E HERE SJMP HERE 80 F4 Stop the program.

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

4100 08
4500 02

4102 04

RESULT
Thus, the assembly language program to divide the two 8-bit numbers using 8051 instruction set was written
and executed successfully.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS

1. What is scanning in display


In display devices the process of sending display codes to 7-segment LED’S to display the led’s one
by one is called scanning.
2. Write about Interrupt Vector Table.
For every interrupt, there must be an interrupt service routine (ISR) or interrupt handler. When an
interrupt is invoked, the microcontroller runs the interrupt service routine
3. Explain the use of interrupt enable register in 8051.
a. The interrupt enable register in 8051 microcontroller allows individually enabling and disabling
of all interrupt sources in 8051.
4. What are the modes used in display modes?
a. Left Entry mode
b. Right Entry Mode.
5. What is the use of modem control unit in 8251?
a. The modem control unit handles the modem handshake signals to coordinate the communication
between the modem and the USART.
6. What is interfacing?
a. An interface is a shared boundary between the devices which involves sharing information.
Interfacing is the process of making two different systems communicate with each other.
7. What is PPI?
PPI- programmable peripheral interface.
It interfaces peripheral I/O devices to the microcomputer system bus.
It reduces the external logic normally needed to interface peripheral devices.

8. What is control word?


It is a word stored in a register (control register) used to control the operation of a program digital
device.
9. List the operation modes of 8255
a) I/O Mode
b) Bit Set/Reset Mode

10. What is the purpose of control word written to control register in 8255?
The control words written to control register specify an I/O function for each I/O port. The bit D7 of the
control word determines either the I/O function of the BSR function.
EXP.NO :
DATE :

AIM
To write an assembly language program to perform and operation using microcontroller instruction set.

ALGORITHM
1. Move the data to Accumulator.
2. Perform AND operation with accumulator.
3. Move the accumulator output to the memory 4500H.

FLOWCHART:

START

Get the input

Perform AND operation

Store the data in 4500 address

STOP
EXP.NO :
DATE :

PROGRAM FOR AND GATE 8 BIT NUMBERS USING 8051


ADDRESS LABEL MNEMONICS OPCODE COMMENT

4100 MOV A,#87 Move the value 87 into A


register.
4102 ANL A,#7E 7E into A register by AND
logically.
4104 MOV DPTR,#4500 Move the value 4500 into DPTR
register.

4107 MOVX @DPTR,A Move the register A content to X


register.

4108 HERE SJMP HERE Short jump within the program.

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4100 87 4500 06
4102 7E

RESULT
Thus the assembly language program to perform and operation using microcontroller instruction set was
written and executed successfully.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS


1. What is memory mapping?
The assignment of memory addresses to various registers in a memory chip is called as memory mapping.

2. List the major components of 8279 keyboard/Display interface.


a. Keyboard section b. Scan section
c. Display section d. CPU interface section

3. What is the use of stepper motor?


A stepper motor is a device used to obtain an accurate position control of rotating shafts. A stepper motor
employs rotation of its shaft in terms of steps, rather than continuous rotation as in case of AC or DC
motor.

4. What is TXD & RXD?


TXD- Transmitter Data Output This output pin carries serial stream of the transmitted data bits along with
other information like start bit, stop bits and priority bit.
RXD- Receive Data Input This input pin of 8251A receives a composite stream of the data to be received
by 8251A.

5. What is swapping?
The procedure of fetching the chosen program segments or data from the secondary storage into the
physical memory is called ‘swapping’.

6. Write the function of crossbar switch?


The crossbar switch provides the inter connection paths between the memory module and the processor.
Each node of the crossbar represents a bus switch. All these nodes may be controlled by one of these
processors or by a separate one altogether.

7. What is a data amplifier?


Transceivers are the bi-directional buffers are sometimes they are called as data amplifiers. They are
required to separate the valid data from the time multiplexed address data signal. They are controlled by 2
signals i.e DEN & DT/R.

8. What is the use of handshaking signals?


It is used to data transfer method which is used when the speed of an I/O device does not match with the
speed of the microprocessor. Asynchronous data transfer is also called as Handshaking.

9. What is the use of modem control unit in 8251?


The modem control unit handles the modem handshake signals to coordinate the communication
between the modem and the USART.

10. What are the different types of methods used for data transmission?
Simplex, Duplex, Half Duplex
EXP.NO :
DATE :

Aim:
To perform assembly language program for or operation in 8-bit 8051 microcontroller kit

ALGORITHM
1. Start the program
2. Get the two input value
3. Compare 0=1
4. Store the result
5. Stop the program

FLOWCHART:

START

Get the two input

Compare 0=1

Store the result

STOP
EXP.NO :
DATE :

PROGRAM FOR OR GATE USING 8051

ADDRESS LABEL MNEMONICS OPCODE COMMENT


4100 MOV A,#2F Move the value 2F into A register
4102 OR A,#45 7E into A register by OR logically
4104 MOV DPTR,#4500 Move the value 4500 into DPTR
register
4107 MOVX@DPTR,A Move the register A content to X
4108 HERE SJMP HERE Short jump within the program

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4100 2F 4500 0F
4102 45

RESULT:
Thus To perform assembly language program for or operation in 8-bit 8051 microcontroller kit is executed
successfully.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS


1. What are the different peripheral interfacing used with 8086 microprocessor?
8255 PPI, 8259 PIC, 8251 USART, 8279 Key board display controller and 8253 Timer/ Counter –
Interfacing with 8085 - A/D and D/A converter interfacing.

2. What are the functional types used in control words of 8251a?


Mode Instruction control word
Command Instruction control word

What is the need for 8259 PIC


3. By connecting priority Interrupt controller, it is possible to increase the interrupt handling capacity
of the microprocessor. The 8259A is a commonly used priority interrupt controller, which is
specifically

4. What are the applications of D/A converter interfacing with 8255?


Microprocessor based process control system
Stepper motor interfacing
Centronic interfacing

5. What are the features of 8259?


It is programmed to work with either 8085 or 8086 processor.
It manages 8-interrupts according to the instructions written into its control registers.

6. How data is transmitted in asynchronous serial transmission? May/June 14


Data to be transmitted is sent out one character at a time and the receiver end of the
communication line synchronization is performed by examining synchronization bits that are
included at the beginning and at the end of each character

7. Write the Features of 8255A.


The 8255A is a widely used, programmable, parallel I/O device.
It can be programmed to transfer data under various conditions, from simple I/O to interrupt I/O.

8. Write the Features of 8253A.


The timer has three counters, called channels. Each channel can be programmed to operate in six
modes. Once programmed, the channels can perform their tasks independently.

9. What is the function of gate signal in 8254 timer? (May/June 2014)


The gate signal in 8254 is used as the gate input of counters. CLKO, CLK1 gate signals are
given to counter 0, counter 1 and counter 2 respectively.

10. List the features of 8251


It is an universal synchronous and asynchronous communication Controller.
It supports standard asynchronous protocol with a. 5 to 8 bit Character Format.
It has built-in Baud rate-Generator
EXP.NO :
DATE :

AIM:
To perform assembly language program for square the given number in 8-bit 8051 microcontroller kit

ALGORITHM
1. Start the program
2. Get the input value
3. Square the number
4. Store the result
5. Stop the program

FLOWCHART:

START

Get the input value

Square the value

Store the result

STOP
EXP.NO :
DATE :

PROGRAM FOR SQUARE PROGRAM USING 8051

ADDRESS LABEL MNEMONICS OPCODE COMMENT


MOV DPTR, #8000H

MOVX A,@DPTR

MOV B,A

MUL AB

INC DPTR

MOVX @DPTR,A

MOVX INC DPTR

MOV A,B

MOVX @DPTR,A

END

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8000 02 8001 04

RESULT:
Thus To perform assembly language program square the given number in 8-bit 8051 microcontroller kit is
performed sucessfuly.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS

1. What is meant by DMA operation


DMA stands for Direct Memory Access. In order to transfer bulk amount of data between memory and
I/O device without the involvement of CPU, this technique is used. The advantage of DMA is
faster data transfer.

2. What is meant by time multiplexed LED display?


In time multiplexed LED display, at a time only one LED displays data while other LEDs remain
in OFF condition. But within few milli seconds, next LED is turned on while all others are in OFF
condition. This is repeated continuously so that all LEDs seem to display data simultaneously.

3. What are the requirements to be met while interfacing I/O devices to


microprocessor microcontroller
The microprocessor identifies the I/O devices through a port address and enables the Read or Write
operations.
The microprocessor selects the I/O devices through a chip select and uses the control signals
Read to receive data and Write signal to transmit data.

4. Name any four electronic devices which are used to interface high power devices with
microprocessor
1.Power transistor 2. Power MOSFET 3. Solid state relay.

5. What is a load cell?


A load cell consist of strain gauges which are arranged in bridge form and when Excited by DC input,
it produces an output voltage proportional to the weight or load placed on it

6. What are the various programmed data transfer methods?


Synchronous serial data transmission
Asynchronous serial data transmission.
Interrupt driven data transfer

7. Can an input port and an output port have the same port address?
No, in peripheral mapped input / output, the peripheral is defined with an 8 bit address input and
output devices are different. So, different ports are assigned as input and output port.

8. Why is each channel in DMA controller restricted to 19Kbytes of data transfer


Mostly we use 8085 and 8086 microprocessor to interface with DMA controller.

9. What are the applications of 8254/8253


Square wave generator Event Counter
Programmable Rate Generator
Binary Rate Multiplier

10. What are the enhanced features of 8254 programmable timer compared to 8253
Operating frequency 0 - 10 MHz.
Uses H-MOS technology.
Read-Back command available.
Reads and writes of the same counter can be interleaved.
EXP.NO :
DATE :

Aim:
To perform assembly language program for cube the given number in 8-bit 8051 microcontroller kit

ALGORITHM
1. Start the program
2. Get the input value
3. cube the number
4. Store the result
5. Stop the program

FLOWCHART:

START

Get the input value

cube the value

Store the result

STOP
EXP.NO :
DATE :

PROGRAM FOR CUBE PROGRAM USING 8051

ADDRESS LABEL MNEMONICS OPC COMMENT


ODE
MOV DPTR, #8000H
MOVX A,@DPTR
MOV R0,A
MOV B.A
MUL AB
PUSH B
MOV B,A
MOV A,R0
MUL AB
INC DPTR
MOVX @DPTR,A
MOV A,B
MOV R1,A
POP B
MOV A,R0
MUL AB
ADD A,R1
INC DPTR
MOVX @DPTR,A
MOV A,B
ADDC A,#00
INC DPTR
MOVX @DPTR,A
END

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8000 02 8001 08

RESULT:
Thus to perform assembly language program for cube the given number in 8-bit 8051 microcontroller kit
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS


1. Define Baud rate.
Baud rate is defined as the number of signal events per second. In the present case, it is same
as bits per second.

2. Define segment override prefix.


Segment override prefix can be used in any instructionn with any memory addressing mode to override
the default segment register. Most memory instructions use DS as the default segment register

3. What do you mean by non maskable interrupt


Non-Maskable interrupt (NMI) is the highest priority hardware interrupt that triggers on, the positive
edge.

4. What is the function of bus interface unit


The bus interface unit (BIU) interfaces the 8086 with external devices including memory via the bus. BIU
fetches instructions, reads data from memory and ports, and writes data to memory and I/O ports.

5. What are maximum address space and data bus width of 8086 processor
Maximum address space = 220 = 1 MB
Data bus width - 16 bit

6. What does it imply if the states of 8086 signals - BHE and A o arc at 0 and 1,
respectively
When BHE = 0 and A0=l, 8086 can access even byte address (D o - D7)

7. What information is conveyed when QS 1 – QS0, bits are 01


The queue status lines (QS1 – QS0 ) give information about the status of the code .
QS, - QS0 = 01 indicates the first byte of opcode from queue.

8. What is the storage space required to store the interrupt vectors of 8086
In 8086, 256 interrupt types required (256 x 4) 1024 bytes storage space.

9. What do these 8086 instructions do? STD, IRET


STD - Set the direction flag in flag register (D=l)
IRET- Interrupt on Return. It is used to exist any interrupt procedure, whether activated by software
or hardware.

10. What is Macro


Macro is a short sequence of instructions. It is a small subroutine. A macro can be defined anywhere in
a program using the directives MACRO and ENDM.
EXP.NO :
DATE :

AIM
To write an assembly language program to find the 1’s and 2’s complement of an 8-bit number using
microcontroller instruction set.

ALGORITHM
1. Move the data to Accumulator.
2. Complement the accumulator.
3. Move the one’s complement output to the memory 4500H.
4. Add 01H with accumulator.
5. Move the two’s complement output to the memory 4501H.

FLOWCHART:

START

Get the input value in 4101

Take 1’s complement and store in 4500

Take 2’s complement and store in 4500

STOP
EXP.NO :
DATE :

PROGRAM FOR 1’S AND 2’S COMPLEMENT USING 8051

ADDRESS LABEL MNEMONICS OPCODE COMMENT

4100 MOV A,#BB 74,DA Move the input data to the


accumulator.

4102 CPL A F4,90,42,00 Complement the accumulator.

4103 MOV DPTR,#4500 90,45,00 Move the value 4500 into DPTR
register.

4106 MOVX @DPTR,A F0 Move the accumulator value to the


data pointer.

4107 INC A 04 Add 1 to the accumulator value.

4108 INC DPTR AC Increment the data pointer.

4109 MOVX @DPTR,A F0 Move the accumulator value to the


data pointer.

410A HERE SJMP HERE 80,F4 End of the program.

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4100 BB 4500 44

4501 45

RESULT
Thus the assembly language program to find the 1’s and 2’s complement of an 8-bit number using 8051
instruction set was written and executed successfully.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS

1. List any four unconditional branch instructions


CALL, JMP, RET, LOOP

2. What is the use of HOLD


HOLD - This signal indicates that another master is requesting the host 8086 to handover the
system bus.

3. What is an assembler directive


An assembler directive is a statement to give direction to the assembler to perform the task of assembly
process.

4. State the modes in which 8086 operate


Minimum mode
Maximum mode

5. What is the purpose of CLK signal in an 8086 system


The clock signal provides the basic timing for processor operation and bus control activity.
The clock frequency may be 5 MHz or 8 MHz of 10 MHz for different 8086 versions.

6. Mention the function of SI


It is used to hold the index value of source operand (data) for siring instructions.

7. What is the operation carried out when 8086 executes the instruction MOVSW
MOVSW - Move word string.

8. What is the operation carried out when 8086 executes the instruction MOVSB
MOVSB - Move String Byte

9. What is pipelining
Fetching the next instruction while the current instruction executes is called pipelining.

10. State the functional units available in 8086.


BIU (Bus Interface Unit)
EU (Execution Unit)
EXP.NO :
DATE :

AIM:
To convert BCD number into ASCII by using 8051 micro controller

ALGORITHM:
 Save contents of all registers which are used in the routine
 Get the data in AL register and make AH equal to 00
 Use AAM instruction to convert number in its decimal equivalent in the unpacked format.
 Add 30H in each digit to get its ASCII equivalent
 Display digit one by one using function 2 of INT 21H
 Restore contents of registers.

FLOWCHART:
EXP.NO :
DATE :

PROGRAM FOR UNPACKED BCD TO ASCII USING 8051

ADDRESS LABEL MNEMONICS OPCODE COMMENT


MOV B,A

ANL A,#0FH

MOV R0,A

MOV A,B

ANL A,#0F0H

SWAP A

MOV R1,A

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

RESULT:
The given number is converted into ASCII using 8051 microcontroller kit is performed succecssfully.
EXP.NO :
DATE :

VIVA-VOCE QUESTIONS & ANSWERS


1. What is a queue
A data structure carried by the registers on the basis of first-in-first-out (FIFO) is called queue.

2. How queue is implemented in 8086


The 8086 have six numbers of 8 bit FIFO registers, which is used for instruction queue.

3. Name the signals used by 8086 to control the data bus buffers
DT/ R - Data transmit/receive
DEN -Data enable

4. What is the function of TEST Pin in 8086 processor


TEST Pin is used to check the status of software (through the TEST instruction). If the TEST output is
LOW, execution continues otherwise it waits until it goes to LOW.

5. What is called an interrupt


A signal to the processor to halt its current operation and immediately transfer the control to interrupt
service routine (ISR) is called an interrupt. Interrupt are triggered either by hardware or software.

6. What is the use of interrupt vector table in 8086


Interrupt vector table is a table maintained by the operating system. It contains the addresses of the
current interrupt service routine. When an interrupt occurs the processor branches to the address in the
table that corresponds to the interrupt number.

7. What is the function of Instruction pointer (IP)


IP is also referred as program counter. It is used in the calculation of actual memory address of
instruction. It stores the offset for the instruction.

8. Name the hardware interrupts of 8086


INTR – Interrupt Request
NMI – Non Maskable Interrupt

9. What are the general purpose register in 8086


Accumulator register
Base register
Count register
Data register

10. What is the BIOS function call in 8086


Basic Input Output System (BIOS) is used as a software interface between assembly language
programs and computer system hardware.

11. Give the operation of CBW


This (Convert Byte to Word) instruction converts a byte to a word. It extends the sign of the byte in
register AL through register AH.

You might also like