0% found this document useful (0 votes)
96 views67 pages

MP Lab Manual New

This document provides details about a microprocessor lab course. The course has 25 marks for internal assessment and 50 marks for the exam. Part A covers various instructions like data transfer, arithmetic/logical operations, bit manipulation, and branching/loops. Experiments include programs on string manipulation and software interrupts. Part B involves interfacing a microprocessor to devices like keyboards, displays and motors using a DIO card. The document also provides background on the 8086 microprocessor and its architecture, pinouts and registers. It lists DOS debug commands and interrupt functions.

Uploaded by

Senthilkumar S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views67 pages

MP Lab Manual New

This document provides details about a microprocessor lab course. The course has 25 marks for internal assessment and 50 marks for the exam. Part A covers various instructions like data transfer, arithmetic/logical operations, bit manipulation, and branching/loops. Experiments include programs on string manipulation and software interrupts. Part B involves interfacing a microprocessor to devices like keyboards, displays and motors using a DIO card. The document also provides background on the 8086 microprocessor and its architecture, pinouts and registers. It lists DOS debug commands and interrupt functions.

Uploaded by

Senthilkumar S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 67

MICROPROCESSOR LAB MANUAL 10ECL68

MICROPROCESSOR LAB

Subject Code : 10ECL68 IA Marks : 25


No. of Practical Hrs/Week: 03 Exam Hours : 03
Total no. of Practical Hrs. : 42 Exam Marks : 50

PART-A
1) Data transfer instructions like:
i] Byte and word data transfer in different addressing modes.
ii] Block move (with and without overlap)
iii] Block interchange

2) Arithmetic & logical operations like:


i] Addition and Subtraction of multi precision nos.
ii] Multiplication and Division of signed and unsigned Hexadecimal nos.
iii] ASCII adjustment instructions
iv] Code conversions
v] Arithmetic programs to find square cube, LCM, GCD, factorial

3) Bit manipulation instructions like checking:


i] Whether given data is positive or negative
ii] Whether given data is odd or even
iii] Logical 1’s and 0’s in a given data
iv] 2 out 5 code
v] Bit wise and nibble wise palindrome
4) Branch/Loop instructions like:
i] Arrays: addition/subtraction of N nos. Finding largest and smallest nos. Ascending and
descending order
ii] Near and Far Conditional and Unconditional jumps, Calls and Returns

5) Programs on String manipulation like:


String transfer, string reversing, searching for a string, etc.

6) Programs involving Software interrupts


Programs to use DOS interrupt INT 21h Function calls for Reading a Character from keyboard,
Buffered Keyboard input, Display of character/ String on console

PART-B
Experiments on interfacing 8086 with the following interfacing modules
through DIO (Digital Input/output-PCI bus compatible) card

a) Matrix keyboard interfacing


b) Seven segment display interface
c) Logical controller interface
d) Stepper motor interface

Dept. of ECE, SKIT, Bangalore Page 1


MICROPROCESSOR LAB MANUAL 10ECL68

Introduction to Microprocessor 8086:

Microprocessors are used in all modern appliances, which are Intelligent, meaning that they are
capable of working in different modes. For example an automatic washing machine has different
wash options, one for woolen and the other for nylon etc., Also in a printing Industry right from
type setting to page lay out to color photo scanning and printing and cutting and folding are also
taken care of by microprocessors.

The applications of microprocessors can be sub divided into three categories. The first and most
important one is the computer applications. The second one is the control application (micro
controllers, embedded controllers etc.) and the third is in Communication (DSP processors, Cell
phones etc.).

The basis of working of all the microprocessors is binary arithmetic and Boolean logic. The
number system used is Hexadecimal (base 16) and the character code used is ASCII. Many
assemblers are available to interface the machine code savvy processor to English language like
programs of the users.(CP/M, MASM, TASM etc.).

For Games we have joysticks, electronic guns and touch screens. Nowadays laptop and palmtop
computers are proliferating and in future nano computing, bio computing, molecular and optical
computing also are contemplated.

Dept. of ECE, SKIT, Bangalore Page 2


MICROPROCESSOR LAB MANUAL 10ECL68

8086 Pin diagram:

8086 is a 40 pin DIP using MOS technology. It has 2 GND’s as circuit complexity demands a
large amount of current flowing through the circuits, and multiple grounds help in dissipating the
accumulated heat etc. 8086 works on two modes of operation namely, Maximum Mode and
Minimum Mode.

Dept. of ECE, SKIT, Bangalore Page 3


MICROPROCESSOR LAB MANUAL 10ECL68

8086 Internal block diagram:

8086 Architecture:

The block diagram of 8086 is as shown. This can be subdivided into two parts, namely the Bus
Interface Unit and Execution Unit. The Bus Interface Unit consists of segment registers, adder to
generate 20 bit address and instruction prefetch queue. Once this address is sent out of BIU, the
instruction and data bytes are fetched from memory and they fill a First in First out 6 byte queue.

Dept. of ECE, SKIT, Bangalore Page 4


MICROPROCESSOR LAB MANUAL 10ECL68

Execution Unit:
The execution unit consists of scratch pad registers such as 16-bit AX, BX, CX and DX and
pointers like SP (Stack Pointer), BP (Base Pointer) and finally index registers such as source
index and destination index registers. The 16-bit scratch pad registers can be split into two 8-bit
registers. For example, AX can be split into AH and AL registers. The segment registers and
their default offsets are given below.
Segment Register Default Offset
CS IP (Instruction Pointer)
DS SI, DI
SS SP, BP
ES DI

The Arithmetic and Logic Unit adjacent to these registers perform all the operations. The results
of these operations can affect the condition flags.

Different registers and their operations are listed below:


Register Operations
AX Word multiply, Word divide, word I/O
AL Byte Multiply, Byte Divide, Byte I/O, translate, Decimal Arithmetic
AH Byte Multiply, Byte Divide
BX Translate
CX String Operations, Loops
CL Variable Shift and Rotate
DX Word Multiply, word Divide, Indirect I/O

Dept. of ECE, SKIT, Bangalore Page 5


MICROPROCESSOR LAB MANUAL 10ECL68

DOS DEBUG COMMANDS:


1. QUIT Q
Quit from debug program

2. REGISTER R REG NAME


Examine or modify the contents of internal register

3. DUMP D ADDRESS
Dump the contents of addressed memory to display

4. ENTER E ADDRESS [LIST]


Examine or modify the contents of memory locations

5. FILL F STARTING ADDRESS ENDING ADDRESS LIST


Fill a block in memory with data in the list

6. MOVE M STARTING ADDRESS ENDING ADDRESS DESTINATION ADDRESS


Move a block of data in the memory from source location to the destination location

7. COMPARE C STARTING ADDRESS ENDING ADDRESS DESTINATION ADDRESS


Compare two blocks of data in memory and display the location that contain different data

8. SEARCH S STARTING ADDRESS ENDING ADDRESS LIST


Search through a block of data in memory and display all the locations that match the data in the list

9. INPUT I ADDRESS
Read the input port

10. OUTPUT O ADDRESS BYTE


Write a byte to the output port

11. HEX ADD/ SUBTRACT H NUM1,NUM2


Generate hexadecimal sum and difference of two numbers

Dept. of ECE, SKIT, Bangalore Page 6


MICROPROCESSOR LAB MANUAL 10ECL68

12. UNASSEMBLE U [STARTING ADDRESS ENDING ADDRESS]


Unassembled the machine code into its equivalent assembler instructions

13. NAME N FILE NAME


Assign a file name to the data to be written to the disk

14. WRITE W [STARTING ADDRESS [DRIVE STARTING SECTOR NUMBER OF


SECTORS]]
Save the contents of memory in a file on the diskette

15. LOAD L[STARTING ADDRESS[DRIVE STARTING SECTOR NUMBER PF


SECTORS]
Load memory with the contents of a file

16. ASSEMBLE A [STARTING ADDRESS]


Assemble the instruction into machine code and store in the memory

17. TRACE T [=ADDRESS][NUMBER]


Trace the execution of specified number of instructions

18. GO G [=STARTING ADDRESS [BREAKPOINT ADDRESS…..]


Execute the instruction down through the breakpoint address.

INT FUNCTIONS:

1) 00 TERMINATE PROGRAM
Terminate a program to return MSDOS control.

2) 01 READ K/ B AND ECHO


Read a keyboard, echo it onto the screen and return typed character in AL.

3) 02 DISPLAY CHARACTER
Display a character on VDU passed through the DL register in ASCII form.

Dept. of ECE, SKIT, Bangalore Page 7


MICROPROCESSOR LAB MANUAL 10ECL68

4) 03 AUXILIARY INPUT
Input a character from the specified auxiliary device to AL register.

5) 04 AUXILIARY OUTPUT
Output a character in DL to the specified auxiliary device

6) 05 PRIINT CHARACTER
Output a character passed through the DL register to printer.

7) 08 READ K/B WITH NO ECHO


Read keyboard and return the typed character in AL without echo.

8) 09 DISPLAY STRING
Display a string passed through DS: DX registers, “$” ends string.

9) 4C TERMINATE PROCESS
Terminate a process and return the control to the operating system.

Dept. of ECE, SKIT, Bangalore Page 8


MICROPROCESSOR LAB MANUAL 10ECL68

PART-A
EXECUTION STEPS
1. Click on the start, select RUN Type ‘cmd’ and click OK.

2. Type “cd masm” and press enter.

3. Type “edit filename” with .asm extension and press enter.

4. Press Alt+Enter to make full screen.

5. Type the program and save it.

6. Go to file Type [or Select] EXIT.

7. Type “Masm filename.asm;” (It will show if any errors are present).

8. If there are errors then again go back to program by using edit command.

9. Correct the errors save and exit.

10.In order to link, type “Link filename.obj;” and enter

11.For the execution of the program, type “CV filename.exe” and press enter.

12.Go to view and select register in order to view register values during the
execution.

13.Make necessary changes in the memory blocks and press F8 to execute step
by step.

14.The necessary or the required output will be available in the corresponding


memory address.

Dept. of ECE, SKIT, Bangalore Page 9


MICROPROCESSOR LAB MANUAL 10ECL68

1. ALP TO TRANSFER A BLOCK OF DATA WITHOUT OVERLAP

. MODEL SMALL

. DATA
SRC DW 0001H, 0002H, 0003H, 0004H
DST DW 4 DUP (0)

. CODE
START: MOV AX,@DATA
MOV DS, AX

LEA SI, SRC


LEA DI, DST
MOV CX, 0004H

L: MOV AX, [SI]


MOV [DI], AX

INC SI
INC SI
INC SI
INC SI

LOOP L

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 10


MICROPROCESSOR LAB MANUAL 10ECL68

2. ALP TO TRANSFER DATA WITH OVERLAP

.MODEL SMALL

.DATA
NUM DB 11H,22H,33H,44H,55H,66H,77H,88H,99H
CNT DW 0009H
SHT DW 0005H

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV BX, OFFSET NUM


MOV CX, CNT
MOV SI, CX
MOV DI, SH

ADD DI, SI
DEC SI
DEC DI
DEC DI

BACK: MOV AL, [BX+SI]


MOV [BX+DI], AL

DEC SI
DEC DI
LOOP BACK

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 11


MICROPROCESSOR LAB MANUAL 10ECL68

3. ALP TO INTERCHANGE BLOCK OF DATA

. MODEL SMALL

. DATA
SRC DW 1111H, 2222H, 3333H, 4444H, 5555H
DST DW 6666H, 7777H, 8888H, 9999H, 0000H

. CODE
START: MOV AX,@DATA
MOV DS, AX

LEA SI, SRC


LEA DI, DS
MOV CX, 0005H

L: MOV AX, [SI]


MOV BX, [DI]
MOV [SI], BX
MOV [DI], AX

INC SI
INC SI
INC DI
INC DI

LOOP L

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 12


MICROPROCESSOR LAB MANUAL 10ECL68

4. ALP TO FINDOUT ADDITION OF TWO 16 BIT NUMBERS

. MODEL SMALL

. DATA
N1 DW 7890H
N2 DW 9876H
RES DW 4 DUP (0)

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV AX, N1
MOV BX, N2
MOV DX, 0000H

ADD AX, BX
JNC LAB1
INC DX

LAB1: MOV RES, AX


MOV RES+2, DX

MOV AH, 02CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 13


MICROPROCESSOR LAB MANUAL 10ECL68

5. ALP TO FINDOUT SUBTRACTION OF TWO 16 BIT NUMBERS

.MODEL SMALL

.DATA
N1 DW 9999H
N2 DW 0F555H
DIFF DW 4 DUP (0)

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV AX, N1
MOV BX, N2
MOV DX, 0000H

SUB AX, BX
JNC LAB1

LAB1: MOV DIFF, AX


MOV DIFF+2, DX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 14


MICROPROCESSOR LAB MANUAL 10ECL68

6. ALP TO FINDOUT MULTIPLICATION OF TWO 16 BIT NUMBERS

.MODEL SMALL

.DATA
MPAND DW 0FFFFH
MPLER DW 0FFFFH
RES DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV AX, MPAND


MUL MPLER

MOV RES, AX
MOV RES+2, DX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 15


MICROPROCESSOR LAB MANUAL 10ECL68

7. ALP FOR DIVISION OF 16 BIT NUMBER FROM 8 BIT NUMBER

.MODEL SMALL

.DATA
DIVIDEND DW 0FFFFH
DIVISOR DW 0FFH
QUO DW ?
REM DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV AX, DIVIDEND


MOV BX, DIVISOR

DIV DIVISOR

MOV QUO, AX
MOV REM, DX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 16


MICROPROCESSOR LAB MANUAL 10ECL68

8. ALP TO FINDOUT MULTIPRECISSION ADDITION

.MODEL SMALL

.DATA
W1 DW 1111H, 2222H, 0FFFFH, 0EEEEH
W2 DW 5555H, 6666H, 7777H, 8888H
SUM DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV SI, 0000H


MOV CX, 0004H
CLC

U: MOV AX, [W1+SI]


MOV BX, [W2+SI]

ADC AX, BX

MOV [SUM+SI], AX

INC SI
INC SI
LOOP U

MOV AX, 0000H


RCL AL, 01H

MOV [SUM+SI], AX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 17


MICROPROCESSOR LAB MANUAL 10ECL68

9. ALP TO FINDOUT MULTIPRECISSION SUBTRACTION

.MODEL SMALL

.DATA
W1 DW 8888H, 7777H, 2222H, 3333H
W2 DW 3333H, 2222H, 0FFFFH, 1111H
DIFF DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV SI, 0000H


MOV CX, 0004H
CLC

U: MOV AX, [W1+SI]


MOV BX, [W2+SI]

SBB AX, BX

MOV [DIFF+SI], AX

INC SI
INC SI
LOOP U

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 18


MICROPROCESSOR LAB MANUAL 10ECL68

10. ALP TO FINDOUT FACTORIAL OFA NUMBER

.MODEL SMALL

.DATA
NUM1 DW 8H
FACT DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV CX, NUM1


MOV AX, 01H
LOOP1: MUL CX
LOOP LOOP1

MOV FACT, AX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 19


MICROPROCESSOR LAB MANUAL 10ECL68

11. ALP TO FINDOUT SQUARE AND CUBE OF A NUMBER

.MODEL SMALL

.DATA
N DB 05H
SQ DW ?
CUBE DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV AL, N

MUL N
MOV SQ, AX

MUL N
MOV CUBE, AX
MOV CUBE+2, DX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 20


MICROPROCESSOR LAB MANUAL 10ECL68

12. ALP TO CHECK WHETHER THE GIVEN NUMBER IS PALINDROME OR


NOT

.MODEL SMALL

.DATA
N1 DB 45H
N2 DB 00H
MSG1 DB 0DH, 0AH,'NOT A PALINDROME $'
MSG2 DB 0DH, 0AH,'PALINDROME $'

.CODE
START: MOV AX,@DATA
MOV DS, AX

LEA DX, MSG1


MOV AL, N1
MOV CX, 08H

RPT: ROR AL, 01H


RCL N2, 01H
LOOP RPT

MOV AL, N1
CMP N2, AL
JNE FAIL

LEA DX,MSG2

FAIL: MOV AH,09H


INT 21H

MOV AH,04CH
INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 21


MICROPROCESSOR LAB MANUAL 10ECL68

13. ALP TO FIND WHETHER THE GIVEN NUMBER IS 2 OUT OF 5 CODE OR


NOT

.MODEL SMALL

.DATA
NUM DB 05H
RES DB 00H

.CODE
START: MOV AX, @DATA
MOV DS, AX

MOV AL, NUM

MOV CX, 0005H


MOV BL, 00H

ROT: RCR AL,01


JNC L1
INC BL

L1: LOOP ROT


CMP BL, 02H
JZ FND
JMP POS

FND: MOV RES, 00H


JMP EXIT

POS: MOV RES,00H

EXIT: MOV AH,04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 22


MICROPROCESSOR LAB MANUAL 10ECL68

14. ALP TO COUNT NUMBER OF POSITIVE AND NEGATIVE NUMBERS IN A


GIVEN ARRAY

.MODEL SMALL

.DATA
NUM DW 5678H, 0FFFFH, 0001H
COUNT DW 03H
POS DB ?
NEG1 DB ?

.CODE
START: MOV AX, @DATA
MOV DS, AX

MOV CX, COUNT


LEA SI, NUM

L1: MOV AX, [SI]


ROL AX, 01H
JC LOOP1

INC POS
INC SI
LOOP L1
JMP OVER

LOOP1: INC NEG1


INC SI
INC SI
LOOP L1

OVER: MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 23


MICROPROCESSOR LAB MANUAL 10ECL68

15. ALP TO FIND OUT NUMBER OF EVEN AND ODD NUMBERS IN A GIVEN
ARRAY

.MODEL SMALL

.DATA
NUM DW 5678H, 0FFFFH, 0001H
COUNT DW 03H
EVEN1 DB ?
ODD1 DB ?

.CODE
START: MOV AX, @DATA
MOV DS, AX

MOV CX, COUNT


LEA SI, NUM

L1: MOV AX, [SI]


ROR AX, 01H
JC LOOP1

INC EVEN1
INC SI
LOOP L1
JMP OVER

LOOP1: INC ODD1


INC SI
INC SI
LOOP L1

OVER: MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 24


MICROPROCESSOR LAB MANUAL 10ECL68

16. ALP TO COUNT NUMBER OF ONES AND ZEROES IN A GIVEN NUMBER

.MODEL SMALL

.DATA
NUM DW 00FFH
LEN EQU 16
ZERO DB ?
ONE DB ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV CX, LEN


MOV AX, NUM

RPT: ROL AX, 01H


JC INC_ONE
INC ZERO
JMP OVER

INC_ONE: INC ONE


OVER: LOOP RPT

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 25


MICROPROCESSOR LAB MANUAL 10ECL68

17. ALP TO FINDOUT ADDITION OF N 16 BIT NUMBERS

.MODEL SMALL

.DATA
NUM DW 7876H, 6768H, 5432H, 7231H
RESULT DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV CX, 04H


MOV AX, 0000H
MOV DX, 0000H
LEA SI, NUM

LOOP1: ADD AX,[SI]


JNC LOOP2
INC DX

LOOP2: INC SI
INC SI
LOOP LOOP1

MOV RESULT, AX
MOV RESULT+2, DX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 26


MICROPROCESSOR LAB MANUAL 10ECL68

18. ALP TO FINDOUT SUBTRACTION OF N 16 BIT NUMBERS

.MODEL SMALL

.DATA
NUM DW 7876H, 6768H, 5432H, 7231H
RESULT DW ?

.CODE
START: MOV AX, @DATA
MOV DS, AX

MOV CX, 03H

MOV AX, 0000H


MOV DX, 0000H
LEA SI, NUM

MOV AX, SI
INC SI
INC SI

LOOP1: SBB AX, [SI]


JNB LOOP2
INC DX

LOOP2: INC SI
INC SI
LOOP LOOP1

MOV RESULT, AX
MOV RESULT+2, DX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 27


MICROPROCESSOR LAB MANUAL 10ECL68

19. ALP TO FINDOUT THE SMALLEST OF N 16 BIT NUMBERS

.MODEL SMALL

.DATA
ARRAY DW 0009H, 0001H, 0008H, 0005H, 0006H, 0100H
SM DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

LEA SI, ARRAY


MOV AX, [SI]
MOV CL, 05H

L2: INC SI
INC SI
CMP AX, [SI]
JC L1
MOV AX,[SI]

L1: LOOP L2

MOV SM, AX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 28


MICROPROCESSOR LAB MANUAL 10ECL68

20. ALP TO FINDOUT THE LARGEST OF N 16 BIT NUMBERS

.MODEL SMALL

.DATA
ARRAY DW 0009H, 0001H, 0008H, 0005H, 0006H, 0100H
LN DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

LEA SI, ARRAY


MOV AX, [SI]
MOV CL, 05H

L2: INC SI
INC SI
CMP AX, [SI]
JNC L1
MOV AX,[SI]

L1: LOOP L2

MOV LA, AX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 29


MICROPROCESSOR LAB MANUAL 10ECL68

21. ALP TO ARRANGE GIVEN N 16 BIT NUMBERS IN ASCENDING ORDER

.MODEL SMALL

.DATA
ARRAY DW 7777H, 0567H, 9999H, 0000H

.CODE
START: MOV AX,@DATA
MOV DS,AX

MOV DX, 0003H

L3: MOV CX, DX


LEA SI, ARRAY

L2: MOV AX, [SI]


INC SI
INC SI

CMP AX, [SI]


JC L1

XCHG AX, [SI]


MOV [SI-2], AX

L1: LOOP L2
DEC DX
JNZ L3

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 30


MICROPROCESSOR LAB MANUAL 10ECL68

22. ALP TO ARRANGE GIVEN N 16 BIT NUMBERS IN DESCENDING ORDER

.MODEL SMALL

.DATA
ARRAY DW 7777H, 0567H, 9999H, 0000H

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV DX, 0003H

L3: MOV CX, DX


LEA SI, ARRAY

L2: MOV AX, [SI]


INC SI
INC SI

CMP AX,[SI]
JNC L1

XCHG AX, [SI]


MOV [SI-2], AX

L1: LOOP L2
DEC DX
JNZ L3

MOV AH , 04CH
INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 31


MICROPROCESSOR LAB MANUAL 10ECL68

23. ALP TO TRANSFER OF A STRING OF DATA

.MODEL SMALL

.DATA
STR1 DB 'MICRO$'
STR2 DB ?

.CODE
START: MOV AX,@DATA
MOV DS, AX
MOV ES, AX

CLD
LEA SI, STR1
LEA DI, STR2
MOV CX, 05H

LOOP1: LODSB
STOSB
LOOP LOOP1

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 32


MICROPROCESSOR LAB MANUAL 10ECL68

24. ALP TO REVERSE A STRING OF DATA

.MODEL SMALL

.DATA
STR1 DB 'MICRO$'
LEN DB ($-STR1)
STR2 DB 20 DUP (0)

.CODE
START: MOV AX,@DATA
MOV DS, AX
MOV ES, AX

MOV CL, BYTE PTR LEN


LEA SI, STR1
LEA DI, STR2

ADD SI, CX
DEC SI
DEC SI
CLD

LOOP1: LODSB
STOSB
DEC SI
DEC SI
LOOP LOOP1

MOV AL,'$'
STOSB

MOV DX, OFFSET STR2


MOV AH, 09H
INT 21H

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 33


MICROPROCESSOR LAB MANUAL 10ECL68

25. ALP TO SEARCH A GIVEN CHARACTER IN A STRING

.MODEL SMALL

.DATA
STR1 DB 'MICRO$'
LEN DB ($-STR1)
STR2 DB 'O'

MSG1 DB 0DH, 0AH,'CHARACTER NOT FOUND$'


MSG2 DB 0DH, 0AH,'CHARACTER FOUND$'

.CODE
START: MOV AX,@DATA
MOV DS, AX
MOV ES, AX

MOV AL, [STR2]


MOV CL, BYTE PTR LEN
LEA DI, STR1
CLD

LAB1: MOV BL, [DI]


SCASB
JE LAB2
LOOP LAB1

MOV DX, OFFSET MSG1


JMP LAB3

LAB2: MOV DX, OFFSET MSG2

LAB3: MOV AH, 09H


INT 21H

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 34


MICROPROCESSOR LAB MANUAL 10ECL68

26. ALP TO ACCEPT A CHARACTER FROM A KEYBOARD

.MODEL SMALL

.DATA
MSG DB 0DH,0AH,'TYPE A CHARACTER:$'

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV AH, 00H

MOV DX, OFFSET MSG


MOV AH, 09H ; TO DISPLAY MSG
INT 21H

MOV AH , 01H ; TO ACCEPT A CHARACTER


INT 21H

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 35


MICROPROCESSOR LAB MANUAL 10ECL68

27. ALP TO BUFFER INPUT FROM KEYBOARD USING DOS INTERRUPT

.MODEL SMALL

.DATA
BUFF DB 10

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV DX, OFFSET BUFF


MOV AH, 0AH ; TO BUFFER INPUT
INT 21H

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 36


MICROPROCESSOR LAB MANUAL 10ECL68

28. ALP TO CONVERT HEX TO BCD

.MODEL SMALL

.DATA
HEX DW 27H
BCD DW ?

.CODE
START: MOV AX,@DATA
MOV DS, AX

MOV CX, HEX


MOV AX, 0000H

L1: ADD AL, 01H


DAA
JNC L2
XCHG AL, 0AH

ADD AL, 01H


DAA
XCHG AL, AH

L2: LOOP L1
MOV BCD, AX

MOV AH, 04CH


INT 21H
END START

Dept. of ECE, SKIT, Bangalore Page 37


MICROPROCESSOR LAB MANUAL 10ECL68

29. BCD TO BINARY

.MODEL SMALL
.DATA
BCD_IP DB 17H
BIN_OP DB ?
.CODE
MOV AX, @DATA ; [Initialize
MOV DS, AX ; data segment]
MOV AL, BCD_IP ; get bcd input in al
MOV BL, AL ; albl
AND BL, 0FH ; logical and bl with 0fh
MOV CL, 04H ;04hcl
ROR AL, CL ; rotate right al for 04 times
MOV BH, 0AH ; 0ahbh
MUL BH ; multiply ah with bh
ADD AL, BL ; [al]+[bl]=result in al
MOV BIN_OP, AL ; result bin_op location
MOV AH, 4CH ; [terminate
INT 21H ; exit to DOS]
END

Dept. of ECE, SKIT, Bangalore Page 38


MICROPROCESSOR LAB MANUAL 10ECL68

30. LCM OF TWO NUMBERS

.MODEL SMALL
.STACK 60
.DATA
NUM1 DW 0013H, 0026H
LCM DW ?
.CODE
MOV AX, @DATA ; [initialize
MOV DS, AX ; data segment]
MOV AX, NUM1 ; get first number in ax reg
MOV BX, NUM1+2 ; get second number in bx reg
DO: PUSH AX ; push [ax] to stack
MOV DX, 0 ; clear dx reg
DIV BX ; [ax]/[bx],remainderdx
CMP DX, 0 ; check if [dx]=0
JZ RESULT ; if [dx]=0,jump to RESULT
POP AX ; pop stack contents to ax reg
ADD AX, NUM1 ;[ax]+first number=result in ax
JMP DO ; jump to DO
RESULT: POP AX ; pop stack contents again to ax reg
MOV LCM, AX ; [ax]lcm location
MOV AH, 4CH ; [ terminate
INT 21H ;exit to DOS]
END

Dept. of ECE, SKIT, Bangalore Page 39


MICROPROCESSOR LAB MANUAL 10ECL68

PART-B
(INTERFACING)

Dept. of ECE, SKIT, Bangalore Page 40


MICROPROCESSOR LAB MANUAL 10ECL68

PART-B
EXECUTION STEPS

1. Click on the start, select RUN Type ‘cmd’ and click OK.

2. Type “cd masm” and press enter.

3. Type “edit filename” with .asm extension and press enter.

4. Press Alt+Enter to make full screen.

5. Type the program and save it.

6. Go to file Type [or Select] EXIT.

7. Type “Masm filename;” (It will show if any errors are present).

8. If there are errors then again go back to program by using edit command.

9. Correct the errors save and exit.

10.In order to link, type “Link filename;” and press enter

11.Type type EXIT.

12.Again click on the start, select RUN Type ‘cmd’ and click OK.

13.CD masm.

14.IOPM _filename_Baseaddress(0xcd00)// [For Relaunch]

Note: In order to obtain the port address double click on CHKDIOT icon on
desktop and make a note of each port address.

Dept. of ECE, SKIT, Bangalore Page 41


MICROPROCESSOR LAB MANUAL 10ECL68

1. ALP TO INTERFACE A 4x4 KEYBOARD AND SCAN THE PRESSED KEY

.MODEL SMALL ;Specify the model for the executable. Must for every program.
.STACK 5000H

.DATA ;Any data declarations here.


Message1 DB 'DEMONSTRATION PROGRAM FOR KEYBOARD
INTERFACE',13,10,'$'
Message2 DB 'This program will display the key you pressed on the Interface.',13,10,'$'
Message3 DB 'This program is running...',13,10,'Press any key to EXIT.',13,10,'$'
Message4 DB 13,'The Key You Pressed is : ','$'
Keys DB '0 1 2 3 4 5 6 7 8 9 A B C D E F','$'
Show DB '01','$ '

PA EQU 0cd00H
PB EQU 0cd01H
PC EQU 0cd02H
CR EQU 0cd03H
.CODE ;Start your coding here.

MOV AX,@DATA ;Initialize all segemnt regesters as needed here.


MOV DS,AX

MOV AH,9h ;Display the message line1.


MOV DX, OFFSET Message1
INT 21h
MOV AH,9h ;Display the message line2.
MOV DX, OFFSET Message2
INT 21h
MOV AH,9h ;Display the message line3.
MOV DX, OFFSET Message3
INT 21h

MOV AX,90h ;Initialize Port A - Input, Port B - Output


MOV DX,CR
OUT DX,AX ;Write to Control Register.

GETKEY:
MOV BH,01h ;Scan Lines
MOV BL,00h ;Initialize a counter. It contains the no of the Key

SCANLINES:

MOV AL,BH
MOV DX,PB ;Send Line Number to Port B
Dept. of ECE, SKIT, Bangalore Page 42
MICROPROCESSOR LAB MANUAL 10ECL68

OUT DX,AL

MOV DX,PA ; Read from Port A


IN AL,DX
MOV CH,AL ; CH Has the value indicating the key pressed
MOV AL,00H

CHECK: ; Initialize the counter


; Now Repeatedly check which key was selected.
MOV CL,CH
AND CL,01h ; CH is shifted to right
CMP CL,01h
JZ DISPLAY ; If Equal Come out
INC BL
SHR CH,01h ; CH = CH >> 1
INC AL
CMP AL,04h ; All bits are compared
JNZ CHECK
;Go back for next scan line
SHL BH,01h ;Move to next scan line
CMP BH,10h
JNZ SCANLINES ;Repeat the SCAN Lines Loop (4 times)
JMP LOOPOUT

DISPLAY: ; Display the selected key


MOV AH,9h ;Display the message line3.
MOV DX, OFFSET Message4
INT 21h

MOV AX,0000h
MOV AL,BL
MOV BL,02h
MUL BL
MOV BX,AX
MOV DI,OFFSET Show
MOV AL,Keys[BX]
MOV Show[0h],AL
MOV AL,Keys[BX + 1h]
MOV Show[1h],AL
MOV AH,9h ;Display the charecter pressed.
MOV DX, OFFSET Show
INT 21h
MOV CX,0FFFFh

DELAY:
MOV AX,0FFh
DELAY1: DEC AX

Dept. of ECE, SKIT, Bangalore Page 43


MICROPROCESSOR LAB MANUAL 10ECL68

JNZ DELAY1
LOOP DELAY

LOOPOUT:

MOV AH,01h
INT 16h ;Get the Key
JZ GETKEY ;Check for the key

MOV AH,4ch ;Exit the program safely.


INT 21h
END ;This is the end of your program.

Dept. of ECE, SKIT, Bangalore Page 44


MICROPROCESSOR LAB MANUAL 10ECL68

2. ALP TO INTERFACE 7 SEG DISPLAY

.MODEL SMALL ;Specify the model for the executable. Must for every program.
.STACK 5000H
.DATA ;Any data declarations here.
Message1 DB 'DEMONSTRATION PROGRAM FOR SEVEN SEGMENT
DISPLAY',13,10,'$'
Message2 DB 'Check the Message < ELECTRO SYSTEMS > on Seven Segment
Display',13,10,'$'
Message3 DB 'This program is running...',13,10,'Press any key to EXIT.',13,10,'$'

DisplayData DB 0ffh,0ffh,0ffh,0ffh,0c6h,086h, 0c7h,086h,0bfh,0c0h,0deh,087h,0bfh,


092h,091h,092h,092h,0c8h,086h,087h

PA EQU 0cd00H
PB EQU 0cd01H
PC EQU 0cd02H
CR EQU 0cd03H

.CODE ;Start your coding here.

MOV AX,@DATA ; Initialize all segment registers as needed here.


MOV DS,AX

MOV AH,9h ;Display the message line1.


MOV DX, OFFSET Message1
INT 21h
MOV AH,9h ;Display the message line2.
MOV DX, OFFSET Message2
INT 21h
MOV AH,9h ;Display the message line3.
MOV DX, OFFSET Message3
INT 21h

; Send the control word

MOV AL,80h
MOV DX,CR
OUT DX,AL

GETKEY:
MOV BX,0000h

LOOP1: ; Display the charecters 4 at a tine.


MOV AL,BL
AND AL,03h
CMP AL,00H
Dept. of ECE, SKIT, Bangalore Page 45
MICROPROCESSOR LAB MANUAL 10ECL68

JNZ NO_DELAY

MOV CX,0FFFFh
DELAY : MOV AX,04FFFh
DELAY1: DEC AX
JNZ DELAY1
LOOP DELAY
NO_DELAY:

MOV CL,00h
MOV CH,DisplayData[BX]
LOOP2:
MOV AH,01h
INT 16h ;Get the Key
JNZ END_PROGRAM
;MOV CL,01
MOV AH,CH
AND AH,80h
CMP AH,00h
JNZ CONTROL
MOV DX,PB
MOV AL,00h
OUT DX,AL
JMP END_CONTROL
CONTROL:
MOV DX,PB
MOV AL,01h
OUT DX,AL
END_CONTROL:

MOV DX,PC
MOV AL,01h
OUT DX,AL
MOV DX,PC
MOV AL,00h
OUT DX,AL

SHL CH,1
INC CL
CMP CL,08h

JNZ LOOP2 ;LOOP2 Repeats from here.

INC BX
CMP BX,20
JNZ LOOP1 ;LOOP1 Repeats from here.

Dept. of ECE, SKIT, Bangalore Page 46


MICROPROCESSOR LAB MANUAL 10ECL68

MOV AH,01h
INT 16h ;Get the Key
JZ GETKEY

END_PROGRAM:
MOV AH,4ch ; Exit the program safely.
INT 21h
END ;This is the end of your program.

Dept. of ECE, SKIT, Bangalore Page 47


MICROPROCESSOR LAB MANUAL 10ECL68

3. ALP TO INTERFACE STEPPER MOTOR AND RORATE CLOCKWISE AND


ANTI CLOCK WISEDIRECTION

.MODEL SMALL ;Specify the model for the executable. Must for every program.
.STACK 100h
.DATA ;Any data declarations here.
;User must change the port addresses as assigned by the PC.
PA EQU 0cd00H
PB EQU 0cd01H
PC EQU 0cd02H
CR EQU 0cd03H
Message1 DB 'DEMONSTRATION PROGRAM FOR STEPPER MOTOR',13,10,'$'
Message2 DB 13,10,'The program is running...',13,10,'$'

.CODE

MOV AX,@DATA
MOV DS,AX
MOV AH,9h ;Display the message line1.
MOV DX, OFFSET Message1
INT 21h

MOV AH,9h ;Display the message line3.


MOV DX, OFFSET Message2
INT 21h

again: MOV AH,01h


INT 16H
JZ s1
MOV AH,4ch ;EXIT PROGRAM
INT 21h
s1: MOV DX,CR
MOV AL,80h
OUT DX,AL

MOV AL,11h ;To rotate in opposite direction, change the data as 88H instead of 11H
CALL OUT_A
CALL DELAY

MOV AL,22h ;To rotate in opposite direction, change the data as 44H instead of 22H
CALL OUT_A
CALL DELAY

MOV AL,44h ;To rotate in opposite direction, change the data as 22H instead of 44H
CALL OUT_A

Dept. of ECE, SKIT, Bangalore Page 48


MICROPROCESSOR LAB MANUAL 10ECL68

CALL DELAY

MOV AL,88h ;To rotate in opposite direction, change the data as 11H instead of 88H
CALL OUT_A
CALL DELAY
JMP again

OUT_A: MOV DX,PA


OUT DX,AL
RET

DELAY: MOV CX,1FFFh


D2 : MOV AX,05FFh
D1 : DEC AX
JNZ D1
DEC CX
JNZ D2
RET

END ;This is the end of your program.

Dept. of ECE, SKIT, Bangalore Page 49


MICROPROCESSOR LAB MANUAL 10ECL68

4. ALP TO INTERFACE LOGIC CONTROLLER INTERFACE

.MODEL SMALL ;Specify the model for the executable. Must for every program.

.DATA ;Any data declarations here.

PA EQU 0cd00H
PB EQU 0cd01H
PC EQU 0cd02H
CR EQU 0cd03H

Message1 DB 'DEMONSTRATION PROGRAM FOR LOGIC CONTROLLER',13,10,'$'


Message2 DB 'This program will read input in Port B. and outputs',13,10,'$'
Message3 DB 'it''s compliment in Port A.',13,10,13,10,'$'
Message4 DB 'This program is running...',13,10,'Press any key to EXIT.',13,10,'$'
.STACK
.CODE ;Start your coding here.
MOV AX,@DATA ;Initialize all segment registers as needed here.
MOV DS,AX

MOV AH,9h ;Display the message line1.


MOV DX, OFFSET Message1
INT 21h
MOV AH,9h ;Display the message line2.
MOV DX, OFFSET Message2
INT 21h
MOV AH,9h ;Display the message line3.
MOV DX, OFFSET Message3
INT 21h

MOV AH,9h ;Display the message line4.


MOV DX, OFFSET Message4
INT 21h

MOV AL,82H ;Initialize A - Output B-Input Ports


MOV DX,CR
OUT DX,AL ;Write to Control Register.

GETKEY:
MOV DX,PB ;Get Data from Regester B
IN AL,DX

NOT AL ;Compliment it.

MOV DX,PA ;Pet Data to Register A


OUT DX,AL

Dept. of ECE, SKIT, Bangalore Page 50


MICROPROCESSOR LAB MANUAL 10ECL68

MOV AH,01h
INT 16h ;Get the Key
JZ GETKEY

MOV AH,4ch ; Exit the program safely.


INT 21h
END ;This is the end of your program.

Dept. of ECE, SKIT, Bangalore Page 51


MICROPROCESSOR LAB MANUAL 10ECL68

Microprocessor Lab Viva Questions with Answers

1. What is a Microprocessor?
Microprocessor is a CPU fabricated on a single chip, program-controlled device, which fetches
the instructions from memory, decodes and executes the instructions.

2. What is Instruction Set?


 It is the set of the instructions that the Microprocessor can execute.

3. What is Bandwidth?
 The number of bits processed by the processor in a single instruction.

4. What is Clock Speed ?


Clock speed is measured in the MHz and it determines that how many instructions a processor
can processed. The speed of the microprocessor is measured in the MHz or GHz. 

5. What are the features of Intel 8086 ?


Features:
 Released by Intel in 1978
 Produced from 1978 to 1990s
  A 16-bit microprocessor chip.
  Max. CPU clock rate:5 MHz to 10 MHz
 Instruction set:  x86-16
 Package: 40 pin DIP
 16-bit Arithmetic Logic Unit
 16-bit data bus  (8088 has 8-bit data bus)
 20-bit address bus - 220 = 1,048,576 = 1 meg
 The address refers to a byte in memory.
 In the 8088, these bytes come in on the 8-bit data bus.  In the 8086, bytes at even addresses
come in on the low half of the data bus (bits 0-7) and bytes at odd addresses come in on the
upper  half of the data bus (bits 8-15).
 The 8086 can read a 16-bit word at an even address in one operation and at an odd address in
two operations.  The 8088 needs two operations in either case.
    The least significant byte of a word on an 8086 family microprocessor is at the  lower
address.

6. What is Logical Address:?
 A memory address on the 8086 consists of two numbers, usually written in hexadecimal and
separated by a colon, representing the segment and the offset. This combination of segment and
offset is referred to as a logical address
  Logical address=segment: offset

7. What is The Effective Address:


 In general, memory accesses take the form of the following example:
 Mov ax, [baseReg + indexReg + constant]
 This example copies a word sized value into the register AX.

Dept. of ECE, SKIT, Bangalore Page 52


MICROPROCESSOR LAB MANUAL 10ECL68

 Combined, the three parameters in brackets determine what is called the effective address,
which is simply the offset referenced by the instruction

8. What is Physical Address?
Physical memory address pointed by SEGMENT:OFFSET pair is calculated as:

Physical address = (<Segment Addr> * 10) + <Offset Addr>

9.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.

10.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.

11.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.

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


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

13.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.

14.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.

15.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.

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


Byte contains 8 combinations of bits.

17.Have you studied buses? What types?


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

Dept. of ECE, SKIT, Bangalore Page 53


MICROPROCESSOR LAB MANUAL 10ECL68

18.What is the Maximum clock frequency in 8086?


5 Mhz is the Maximum clock frequency in 8086.

19.What is meant by Maskable interrupts?


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

20.What is Non-Maskable interrupts?


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

21.What are the different functional units in 8086?


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

22.What are the various segment registers in 8086?


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

23.What does EU do?


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

24.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.

25.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.

26.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.

27.What are the different types of Addressing Modes?


A:- There are 12 different types of Addressing Modes.They are:-
<1> Immediate:-The Immediate data is a part of instruction, and appears in the form of
successive bytes.

<2> Direct:-A 16-bit memory address(offset) is directly specified in the instruction as a part of it.

<3> Register:-Data is stored in a register and it is referred using the particular register (except
IP).
<4> Register Indirect:-The address of the memory location which contains data or operand is
determined in an indirect way.

<5> Indexed:-offset of the operand is stored in one of the index registers.

Dept. of ECE, SKIT, Bangalore Page 54


MICROPROCESSOR LAB MANUAL 10ECL68

<6> Register Relative:-The data is available at an eefective address formed by adding an 8-bit or
16-bit displacement with the content of any one of the registers BX,BP,SI and DI in the default
(either DS or ES) segment.

<7> Based Indexed:-The effective address of the data is formed,in this addressing mode,by
adding content of a base register to the content of an index register.
<8> Relative Based Indexed:- The effective address is formed by adding an 8 or 16-bit
displacement with the sum of contents of any one of the base registers and any one of the index
registers,in the default segment.

<9> Intrasegment Direct Mode:-In this mode,the address to which the control is to bve
transferred lies in the segment in which the control transfer instruction lies and appears directly
in the instruction as an immediate displacement value.

<10> Intrasegment Indirect Mode:-In this mode,the displacement to which the control is to be
transferred,is in the same segment in whgich the control transfer instruction lies,but it is passed
to the instruction indirectly.
<11> Intersegment Direct:-In this mode,the address to which the control is to be transferred is in
a different segment.
<12> Intersegment Indirect:-In this mode,the address to which the control is to be transferred lies
in a different segment and it is passed to the instruction indirectly sequentially.

28.What are the General Data Registers & their uses?


A:- The Registers AX,BX,CX,DX are the general Purpose 16-bit registers.AX register as 16-bit
accumulator.BX register is used as an offset Storage.CX register is used as default or implied
counter.Dx register is used as an implicit operand or destination in case of a few instructions.

29.What are Segment Registers & their uses?


A:-There are 4 Segment Registers Code Segment(CS),Data Segment(DS),Extra Segment(ES) &
Stack Segment(SS) registers.CS is used for addressing memory locationin code.DS is used to
points the data.ES refers to a segment which is essentially in another data segment.SS is used
fopr addressing stack segment of memory.

30.What are Flag registers?


A:-Divided into 2 parts:-Condition code or status flags and machine control flags.
S-Sign Flag:-Is to set when the result of any computation is negative.
Z-Zero Flag:-Is to set if the result of the computation or comparision performed by the previous
instruction is zero.
C-Carry Flag:-Is set when there is carry out of MSB in case of addition or a borrow in case of
subtraction.
T-Trap Flag:-Is set,the processor enters the single step execution mode.
I-Interrupt Flag:-Is set,the maskable interrupts are recognised by the CPU.
D-Direction Flag:-Is set for autoincrementing or autodecrementing mode in string manipulation
instructions.
AC-Auxiliary Carry Flag:-Is set if there is a carry from the lowest nibble during addition or
borrow for the lowest nibble.

Dept. of ECE, SKIT, Bangalore Page 55


MICROPROCESSOR LAB MANUAL 10ECL68

O-Overflow Flag:-Is setif the result of a signed operation is large enough to be accommodated in
a destination register.

31.What does the 8086 Architecture contain?


A:-The complete architecture of 8086 can be divided into 2types :-Bus Interface Unit(BIU) &
Execution Unit.
The BIU contains the circuit for physical address calculations and a precoding instruction byte
queue & it makes the bus signals available for external interfacing of the devices.
The EU contains the register set of 8086 except segment registers and IP.It has a 16-bit
ALU,able to perform arithmetic and Logic operations.

32) What are Data Copy/Transfer Instructions?


A:- Mov
Push
Pop
Xchg
In
Out
Xlat
Lea
Lds/Les
Lahf
Sahf
Pushf
Popf

33. What are Machine Control Instructions?


A:- Nop
Hlt
Wait
Lock

34) What are Flag Manipulation Instructions?


A:- Cld
Std
Cli
Sti

35) What are String Instructions?


A:- Rep
MovSB/MovSW
  Cmps
  Scas
  Lods
Stos

Dept. of ECE, SKIT, Bangalore Page 56


MICROPROCESSOR LAB MANUAL 10ECL68

36) What are different parts for 8086 architecture?


A:- The complete architecture of 8086 can be divided into 2types :-Bus Interface Unit(BIU) &
Execution Unit.
The BIU contains the circuit for physical address calculations and a precoding instruction byte
queue & it makes the bus signals available for external interfacing of the devices.
The EU contains the register set of 8086 except segment registers and IP.It has a 16-bit
ALU,able to perform arithmetic and Logic operations.

37.What is an Interrupts
Def:- An interrupt operation suspends execution of a program so that the system can take special
action.The interrupt routine executes and normally returns control to the interrupted procedure,
which then resumes execution.BIOS handles Int 00H-1FH, whereas DOS handles INT 20H-3FH.

38. What is an Opcode?


A:-The part of the instruction that specifies the operation to be performed is called the Operation
code or Op code.

39.What is an Operand?
A:-The data on which the operation is to be performed is called as an Operand.

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


A:-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.

41. What is meant by Polling?


A:- Polling or device Polling is a process which identifies the device that has interrupted the
microprocessor.

42.What is meant by Interrupt?


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

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

44.What is Microcontroller and Microcomputer?


A:- 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.

45.What is Assembler?
A:-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.

Dept. of ECE, SKIT, Bangalore Page 57


MICROPROCESSOR LAB MANUAL 10ECL68

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

47.Explain Dup?
A:-The DUP directive can be used to initialize several location & to assign values to these
locations.

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

49.What is the use of HLDA?


A:-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.

50. Explain about "LEA"?


A:-LEA(Load Effective Address) is used for initializing a register with an offset address.
A common use for LEA is to initialize 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.

51. Difference between "Shift" and "Rotate".


A:-Shift and Rotate commands are used to convert a number to another form where some bits are
shifted or rotated.
A rotate instruction is a closed loop instruction. That is, the data moved out at one end is put
back in at the other end.
The shift instruction loses the data that is moved out of the last bit locations.
Basic difference between shift and rotate is shift command makes "fall of” bits at the end of the
register. Where rotate command makes "wrap around" at the end of the register.

52. Explain about .MODEL SMALL?


A:- .MODEL directive:-This simplified segment directive creates default segments and the
required ASSUME and GROUP statements.
Its format is .MODEL memory-model. The following are the memory models
Tiny:-Code and data in one segment, for .COM programs.
Small:-Code in one segment (<=64K), data in one segment (<=64K). It generates 16-bit offset
addresses.
Medium:-Any number of code segments, data in one segment (<=64K).
Compact:-Code in one segment (<=64K), any number of data segments. It generates 32-bit
addresses, which require more time for execution.
Large:-Code and data both in any number of segments, no array >64K.
Huge:-Code and data both in any number of segments, arrays may be >64K.
Flat:-Defines one area up to 4 gigabytes for both code and data. It is un segmented. The program
uses 32-bit addressing and runs under Windows in protected mode.

Dept. of ECE, SKIT, Bangalore Page 58


MICROPROCESSOR LAB MANUAL 10ECL68

53.Difference between JMP and JNC?


A:-JMP is Unconditional Branch.
JNC is Conditional Branch.

54.List the String Manipulation Commands?


A:-REP=Repeat.
MOVS=Move Byte/Word
CMPS=Compare Byte/Word
SCAS=Scan Byte/Word
LODS=Load byte/Wd to AL/AX
STOS=Stor Byte/Wd from AL/A

55.What are the 4 Segments?


A:-Code Segment Register {CS}
Data Segment Register {DS}
Extra Segment Register {ES}
Stack Segment Register{SS}

56.What is the main use of ready pin?


A:-READY is used by the microprocessor to check whether a peripheral is ready to accept or
transfer data.
A peripheral may be a LCD display or analog to digital converter or any other.
These peripherals are connected to microprocessor using the READY pin.
If READY is high then the periphery is ready for data transfer. If not the microprocessor waits
until READY goes high.

57.Explain about Direction Flag?


A:-This is used by string manipulation instructions.
If this flag bit is 0 , the string is processed beginning from the lowest to the highest
address,i.e.,.Autoincrement mode. Otherwise,the string is processed from the highest towards the
lowest address,i.e.,.Autodecrementing mode.

58.What are the basic units of a microprocessor ?


The basic units or blocks of a microprocessor are ALU, an array of registers and control unit.

59.what is Software and Hardware?


The Software is a set of instructions or commands needed for performing a specific task by a
programmable device or a computing machine.
The Hardware refers to the components or devices used to form computing machine in which the
software can be run and tested. Without software the Hardware is an idle machine.

60.What is assembly language?


The language in which the mnemonics (short -hand form of instructions) are used to write a
program is called assembly language. The manufacturers of microprocessor give the mnemonics.
61.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.

Dept. of ECE, SKIT, Bangalore Page 59


MICROPROCESSOR LAB MANUAL 10ECL68

62. 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 .

63. Define bit, byte and word.


A digit of the binary number or code is called bit. Also, the bit is the fundamental storage unit of
computer memory.
The 8-bit (8-digit) binary number or code is called byte and 16-bit binary number or code is
called word. (Some microprocessor manufactures refer the basic data size operated by the
processor as word).

64. What is a bus?


Bus is a group of conducting lines that carries data, address and control signals.

65. Why data bus is bi-directional?


The microprocessor has to fetch (read) the data from memory or input device for processing and
after processing, it has to store (write) the data to memory or output device. Hence the data bus is
bi-directional.

66. Why address bus is unidirectional?


The address is an identification number used by the microprocessor to identify or access a
memory location or I / O device. It is an output signal from the processor. Hence the address bus
is unidirectional.

67. What is the function of microprocessor in a system?


The microprocessor is the master in the system, which controls all the activity of the system. It
issues address and control signals and fetches the instruction and data from memory. Then it
executes the instruction to take appropriate action.

68. What are the modes in which 8086 can operate?


The 8086 can operate in two modes and they are minimum (or uniprocessor) mode and
maximum ( or multiprocessor) mode.

69. What is the data and address size in 8086?


The 8086 can operate on either 8-bit or 16-bit data. The 8086 uses 20 bit address to access
memory and 16-bit address to access 1/0 devices.

70. Explain the function of M/IO in 8086.


The signal M/IO is used to differentiate memory address and 1/0 address When the processor is
accessing memory locations MI 10 is asserted high and when it is accessing 1/0 mapped devices
it is asserted low.

71. Write the flags of 8086.


The 8086 has nine flags and they are
1. Carry Flag (CF) 6. Overflow Flag (OF)
2. Parity Flag (PF) 7. Trace Flag (TF)

Dept. of ECE, SKIT, Bangalore Page 60


MICROPROCESSOR LAB MANUAL 10ECL68

3. Auxiliary carry Flag (AF) 8. Interrupt Flag (IF)


4. Zero Flag (ZF) 9. Direction Flag (DF)
5. Sign Flag (SF)

72. What are the interrupts of 8086?


The interrupts of 8085 are INTR and NMI. The INTR is general maskable interrupt and NMI is
non-maskable interrupt.

73. How clock signal is generated in 8086? What is the maximum internal clock frequency of
8086?
The 8086 does not have on-chip clock generation circuit. Hence the clock generator chip, 8284 is
connected to the CLK pin of8086. The clock signal supplied by 8284 is divided by three for
internal use. The maximum internal clock frequency of8086 is 5MHz.

74. Write the special functions carried by the general purpose registers of 8086.
The special functions carried by the registers of 8086 are the following.
Register Special function
1. AX 16-bit Accumulator
2. AL 8-bit Accumulator
3. BX Base Register
4. CX Count Register
5. DX .Data Register

75. What is pipelined architecture?


In pipelined architecture the processor will have number of functional units and the execution
time of functional units are overlapped. Each functional unit works independently most of the
time.

76. What are the functional units available in 8086 architecture?


The bus interface unit and execution unit are the two functional units available in 8086
architecture.

77. List the segment registers of 8086.


The segment registers of 8086 are Code segment, Data segment, Stack segment and Extra
segment registers.

78. Define machine cycle.


Machine cycle is defined as the time required to complete one operation of accessing memory,
I/O, or acknowledging an external request. This cycle may consist of three to six T-states.

79. Define T-State.


T-State is defined as one subdivision of the operation performed in one clock period. These
subdivisions are internal states synchronized with the system clock, and each T-State is precisely
equal to one clock period.
80. List the components of microprocessor (single board microcomputer) based system
The microprocessor based system consist of microprocessor as CPU, semiconductor memories
like EPROM and RAM, input device, output device and interfacing devices.

Dept. of ECE, SKIT, Bangalore Page 61


MICROPROCESSOR LAB MANUAL 10ECL68

81. Why interfacing is needed for 1/0 devices?


Generally I/O devices are slow devices. Therefore the speed of I/O devices does not match with
the speed of microprocessor. And so an interface is provided between system bus and I/O
devices.

82. What is the difference between CPU bus and system bus?
The CPU bus has multiplexed lines but the system bus has separate lines for each signal. (The
multiplexed CPU lines are demultiplexed by the CPU interface circuit to form system bus).

83.What does memory-mapping mean?


The memory mapping is the process of interfacing memories to microprocessor and allocating
addresses to each memory locations.

84.What is interrupt 1/0?


If the 1/0 device initiate the data transfer through interrupt then the 1/0 is called interrupt driven
1/0.

85. Why EPROM is mapped at the beginning of memory space in 8085 system?
In 8085 microprocessor, after a reset, the program counter will have OOOOH address. If the
monitor program is stored from this address then after a reset, it will be executed automatically.
The monitor program is a permanent program and stored in EPROM memory. If EPROM
memory is mapped at the beginning of memory space, i.e., at OOOOH, then the monitor
program will be executed automatically after a reset.

86. What is DMA?


The direct data transfer between I/O device and memory is called DMA.

87. What is the need for Port?


The I/O devices are generally slow devices and their timing characteristics do not match with
processor timings. Hence the I/O devices are connected to system bus through the ports.

88. What is a port?


The port is a buffered I/O, which is used to hold the data transmitted from the microprocessor to
I/O device or vice-versa.

89.Give some examples of port devices used in 8085 microprocessor based system?
The various INTEL I/O port devices used in 8085 microprocessor based system are 8212, 8155,
8156, 8255, 8355 and 8755.

90. Write a short note on INTEL 8255?


The INTEL 8255 is a I/O port device consisting of 3 numbers of 8 –bit parallel I/O ports. The
ports can be programmed to function either as a input port or as a output port in different
operating modes. It requires 4 internal addresses and has one logic LOW chip select pin.

91.What is the drawback in memory mapped I/0?


When I/O devices are memory mapped, some of the addresses are allotted to I/O devices and so
the full address space cannot be used for addressing memory (i.e., physical memory address

Dept. of ECE, SKIT, Bangalore Page 62


MICROPROCESSOR LAB MANUAL 10ECL68

space will be reduced). Hence memory mapping is useful only for small systems, where the
memory requirement is less.

92. How DMA is initiated?


When the I/O device needs a DMA transfer, it will send a DMA request signal to DMA
controller. The DMA controller in turn sends a HOLD request to the processor. When the
processor receives a HOLD request, it will drive its tri-stated pins to high impedance state at the
end of current instruction execution and send an acknowledge signal to DMA controller. Now
the DMA controller will perform DMA transfer.

93. 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.

94. 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.

95. 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.

96.What is Block and Demand 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 and so on.
In Demand transfer mode the DMA controller will complete the entire .data transfer at a stretch
and then relieve the bus to processor.

97. 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.

98. How many machine cycles constitute one instruction cycle in 8085?
Each instruction of the 8085 processor consists of one to five machine cycles.

99. Define opcode and operand.


Opcode (Operation code) is the part of an instruction / directive that identifies a specific
operation.
Operand is a part of an instruction / directive that represents a value on which the instruction
acts.

100. 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.

Dept. of ECE, SKIT, Bangalore Page 63


MICROPROCESSOR LAB MANUAL 10ECL68

101. 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.

102. 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. Also, it can be used for memory expansion (by providing separate memory banks for
program & data and selecting the bank using status signals).

103. How the 8085 processor differentiates a memory access (read/write) and 1/0 access
(read/write)?
The memory access and 1/0 access is differentiated using 10 I M signal. The 8085 processor
asserts 10 I M low for memory read/write operation and 10 I M is asserted high for 1/0
read/write operation.

104. When the 8085 processor checks for an interrupt?


In the second T -state of the last machine cycle of every instruction, the 8085 processor checks
whether an interrupt request is made or not.

105. What is interrupt acknowledge cycle?


The interrupt acknowledge cycle is a machine cycle executed by 8085 processor to get the
address of the interrupt service routine in-order to service the interrupt device.

106. How the interrupts are affected by system reset?


Whenever the processor or system is resetted , all the interrupts except TRAP are disabled. fu
order to enable the interrupts, El instruction has to be executed after a reset.

107. What is Software interrupts?


The Software interrupts are program instructions. These instructions are inserted at desired
locations in a program. While running a program, if software interrupt instruction is encountered
then the processor executes an interrupt service routine.

108. What is Hardware interrupt?


If an interrupt is initiated in a processor by an appropriate signal at the interrupt pin, then the
interrupt is called Hardware interrupt.

109. Where is the READY signal used?


READY is an input signal to the processor, used by the memory or I/O devices to get extra time
for data transfer or to introduce wait states in the bus cycles.

110. What is HOLD and HLDA and how it is used?


Hold and hold acknowledge signals are used for the Direct Memory Access (DMA) type of data
transfer. The DMA controller place a high on HOLD pin in order to take control of the system
bus. The HOLD request is acknowledged by the 8085 by driving all its tristated pins to high
impedance state and asserting HLDA signal high.

Dept. of ECE, SKIT, Bangalore Page 64


MICROPROCESSOR LAB MANUAL 10ECL68

111. What is polling?


Polling is a scheme or an algorithm to identify the devices interrupting the processor. Polling is
employed when multiple devices interrupt the processor through one interrupt pin of the
processor.

112. What are the different types of Polling?


The polling can be classified into software and hardware polling. In software polling the entire
polling process is governed by prograrn.In hardware polling, the hardware takes care of checking
the status of interrupting devices and allowing one by one to the processor.

113.What is the need for interrupt controller?


The interrupt controller is employed to expand the interrupt inputs. It can handle the interrupt
request from various devices and allow one by one to the processor.

114. List some of the features of INTEL 8259 (Programmable Interrupt Controller)
1.         It manage eight interrupt request
2.         The interrupt vector addresses are programmable.
3.         The priorities of interrupts are programmable.
4.         The interrupt can be masked or unmasked individually.

115. What is a programmable peripheral device ?


If the functions performed by a peripheral device can be altered or changed by a program
instruction then the peripheral device is called programmable device. Usually the programmable
devices will have control registers. The device can be programmed by sending control word in
the prescribed format to the control register.

116. What is synchronous data transfer scheme?


For synchronous data transfer scheme, the processor does not check the readiness of the device
after a command has been issued for read/write operation. fu this scheme the processor will
request the device to get ready and then read/W1.ite to the device immediately after the request.
In some synchronous schemes a small delay is allowed after the request.

117. What is asynchronous data transfer scheme?


In asynchronous data transfer scheme, first the processor sends a request to the device for
read/write operation. Then the processor keeps on polling the status of the device. Once the
device is ready, the processor executes a data transfer instruction to complete the process.

118. What are the operating modes of 8212?


The 8212 can be hardwired to work either as a latch or tri-state buffer. If mode (MD) pin is tied
HIGH then it will work as a latch and so it can be used as output port. If mode (MD) pin is tied
LOW then it work as tri- state buffer and so it can be used as input port.

119. Explain the working of a handshake output port


In handshake output operation, the processor will load a data to port. When the port receives the
data, it will inform the output device to collect the data. Once the output device accepts the data,
the port will inform the processor that it is empty. Now the processor can load another data to
port and the above process is repeated.

Dept. of ECE, SKIT, Bangalore Page 65


MICROPROCESSOR LAB MANUAL 10ECL68

120.What are the internal devices of 8255 ?


The internal devices of 8255 are port-A, port-B and port-C. The ports can be programmed for
either input or output function in different operating modes.

121. What is baud rate?


The baud rate is the rate at which the serial data are transmitted. Baud rate is defined as l /(The
time for a bit cell). In some systems one bit cell has one data bit, then the baud rate and bits/sec
are same.

122. What is USART?


The device which can be programmed to perform Synchronous or Asynchronous serial
communication is called USART (Universal Synchronous Asynchronous Receiver Transmitter).
The INTEL 8251A an example of USART.

123. What are the functions performed by INTEL 8251A?


The INTEL 825lA is used for converting parallel data to serial or vice versa. The data
transmission or reception can be either asynchronously or synchronously. The 8251A can be
used to interface MODEM and establish serial communication through MODEM over telephone
lines.

124. What is an Interrupt?


Interrupt is a signal send by an external device to the processor so as to request the processor to
perform a particular task or work.

125. What are the control words of 8251A and what are its functions?
The control words of 8251A are Mode word and Command word. The mode word informs 8251
about the baud rate, character length, parity and stop bits. The command word can be sending to
enable the data transmission and reception.

126. What are the information that can be obtained from the status word of 8251 ?
The status word can be read by the CPU to check the readiness of the transmitter or receiver and
to check the character synchronization in synchronous reception. It also provides information
regarding various errors in the data received. The various error conditions that can be checked
from the status word are parity error, overrun error and framing error.

127. Give some examples of input devices to microprocessor-based system.


The input devices used in the microprocessor-based system are Keyboards, DIP switches, ADC,
Floppy disc, etc.

128. What are the tasks involved in keyboard interface?


The task involved in keyboard interfacing are sensing a key actuation, Debouncing the key and
Generating key codes (Decoding the key). These task are performed software if the keyboard is
interfaced through ports and they are performed by hardware if the keyboard is interfaced
through 8279.

Dept. of ECE, SKIT, Bangalore Page 66


MICROPROCESSOR LAB MANUAL 10ECL68

129. How a keyboard matrix is formed in keyboard interface using 8279?


The return lines, RLo 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. In
encoded scan mode, the output lines of external decoder are used as rows of keyboard matrix.

130. What is scanning in keyboard and what is scan time?


The process of sending a zero to each row of a keyboard matrix and reading the columns for key
actuation is called scanning. The scan time is 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 again.

131. What is scanning in display and what is the scan time?


In display devices, the process of sending display codes to 7 –segment LEDs to display the LEDs
one by one is called scanning ( or multiplexed display). The scan time is the time taken to
display all the 7-segment LEDs one by one, starting from first LED and coming back to the first
LED again.

132. What are the internal devices of a typical DAC?


The internal devices of a DAC are R/2R resistive network, an internal latch and current to
voltage converting amplifier.

133. What is settling or conversion time in DAC?


The time taken by the DAC to convert a given digital data to corresponding analog signal is
called conversion time.

134. What are the different types of ADC?


The different types of ADC are successive approximation ADC, counter type ADC flash type
ADC, integrator converters and voltage- to-frequency converters.

135. Define stack


Stack is a sequence of RAM memory locations defined by the programmer.

136. What is program counter? How is it useful in program execution?


The program counter keeps track of program execution. To execute a program the starting
address of the program is loaded in program counter. The PC sends out an address to fetch a byte
of instruction from memory and increments its content automatically.

137. How the microprocessor is synchronized with peripherals?


The timing and control unit synchronizes all the microprocessor operations with clock and
generates control signals necessary for communication between the microprocessor and
peripherals.

Dept. of ECE, SKIT, Bangalore Page 67

You might also like