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

Solved Quetion Bank For 2nd Class Test - DTM

Uploaded by

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

Solved Quetion Bank For 2nd Class Test - DTM

Uploaded by

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

List any four Directives of 8086

 DB (Define Byte): Allocates memory for a byte or bytes and initializes them with specified values.

 DW (Define Word): Allocates memory for a word (2 bytes) and initializes it with specified values.

 EQU (Equate): Assigns a constant value to a symbol, allowing for easier reference and modification in the
code.

 ORG (Origin): Specifies the starting address for the assembler to place the following code or data in memory.

List any four addressing of 8086

 Immediate Addressing:.

 Direct Addressing:

 Register Addressing:.

 Indirect Addressing:

State steps involved in program development


 Defining the problem
 Algorithm
 Flowchart
 Initialization
 Choosing instruction
 Converting algorithm to program

List instruction formats of 8086


 One byte Instruction
 Register to register
 Register to memory without displacement
 Register to memory with displacement
 Immediate data to register
Explain MUL and DIV instructions with examples
MUL Source

In this instruction destination is AL for 8 bit and AX for 16 bit and one number is present in AL/AX and other
number is in any other register

MOV BX

MOV BL

DIV Source

In this instruction dividend must be in AX register and divisor is any 8 bit register after division 8 bit quotient will
be in AL and 8 bit remainder is in AH

DIV BL

DIV CX

Explain PUSH and POP instructions with examples


PUSH Source

This instruction is used to store word from source on to the stack location

Operation

SP SP-2

SS:[SP] MSB of source

SS:[SP-1] LSB of Source

PUSH BX

POP Destination

This instruction is used to store word from stack location to specified destination

Operation

LSB of Destination SS:[SP]

MSB of Destination SS:[SP+1]

SP SP+2

POP DX
Explain CMP instruction with example
CMP destination, Source

This instruction is used to compare source with destination

Operation

If destination > source then CF=0, ZF=0, SF=0.

If destination < source then CF=1, ZF=0, SF=1.

If destination = source then CF=0, ZF=1, SF=0.

CMP AL,BL

CMP AX,[SI]

Explain CALL and RET instruction


The CALL instruction is used to transfer the program control to the sub-program of subroutine

The RET instruction is used to return the program execution control from a procedure to next instruction
immediate after CALL instruction

Give programming model of 8086


.model small

.data

Declaration of data

End data segment

.code

MOV AX, @ data

MOV DS,AX

………..

………..

……………

End code segment

END code
List machine control instructions
 HLT
 NOP
 LOCK
 WAIT

Explain string instructions


MOVS: Move String

MOVSB: Move string byte

MOVSW: Move string word

The source must be in data segment and destination should be extra segment

ES:[DI] DS:[SI]
4 Marks Questions
Explain any four addressing modes of 8086

 Immediate Addressing: The operand is specified directly in the instruction. For example, MOV AX, 5 moves
the immediate value 5 into the AX register.

 Direct Addressing: The effective address of the operand is given explicitly in the instruction. For example, MOV
AX, [1234h] moves the value stored at memory address 1234h into the AX register.

 Register Addressing: The operand is located in a register. For example, MOV BX, AX moves the content of the
AX register into the BX register.

 Indirect Addressing: The effective address of the operand is determined by a register. For example, MOV AX,
[BX] moves the value from the memory address pointed to by the BX register into the AX register.

Explain the concept of pipeline in 8086


• Description: Process of fetching the next instruction while the current instruction is executing is called
pipelining.
• This reduces the execution time. In 8086, pipelining is implemented by providing 6 byte queue where as
long as 6 one byte instructions can be stored well in advance and then one by one instruction goes for
decoding and executions.
• So, while executing first instruction in a queue, processor decodes second instruction and fetches 3rd
instruction from the memory
• In this way, 8086 perform fetch, decode and execute operation in parallel i.e. in single clock cycle as shown
in above fig (b)
Explain Minimum mode of 8086 microprocessor

Minimum Mode 8086

Pin Configuration in Minimum Mode

 MN/MX Pin (Pin 33): Must be connected to a logic high level to select minimum mode.
 ALE Pin: Used to latch the address into external latches.
 DT/R Pin: Controls the direction of data flow, determining whether data is read from or written to memory
or I/O devices.
 DEN Pin: Data Enable, used to enable the data bus drivers.
Explain Maximum mode of 8086 microprocessor

Pin Configuration in Maximum Mode

 MN/MX Pin (Pin 33): Must be connected to a logic low level to select maximum mode.
 ALE Pin: Address Latch Enable, used to latch the address into external latches.
 DT/R Pin: Data Transmit/Receive, controls the direction of data flow.
 DEN Pin: Data Enable, used to enable the data bus drivers.
 S0, S1, S2 Pins: Used to indicate the type of operation (read, write, etc.) and are connected to the 8288 Bus
Controller.
Draw architecture of 8086
Explain process of physical address generation with suitable example
1. Segment registers carry 16bit data, which is also known as base address.
2. BIU appends four 0 bits to LSB of the base address.This address becomes 20-bitaddress.
3. Any base/pointer or index register carries 16bit offset.
4. Offset address is added into 20-bit base address which finally forms 20 bit physical address of memory
location
If CS=69FAH and IP=834CH calculate the physical address

CS=69FAH and IP=834CH


Physical address =CS*10H+IP
=69FAH*10H+834CH
=69FA0+834C
=722ECH
Write ALP to arrange numbers in array in ascending order

.model small

.data

array db 12h,11h,21h,9h,19h

.code

mov ax,@data

mov ds,ax

mov bx,5

up1:

mov si,offset array

mov cx,4

up:

mov al,[si]

cmp al,[si+1]

jc dn

xchg al,[si+1]

xchg al,[si]

dn: inc si

loop up

dec bx

jnz up1

ends

end
Write ALP to multiply two singed numbers

.model small

.data

num1 db -23h

num2 db 45h

.code

mov ax,@data

mov ds,ax

mov ax,num1

mov bx,num2

imul bx

ends

end
Write ALP to convert upper case of string to lower case

.MODEL SMALL

.DATA

STR_1 DB 'COMPUTER$'

STR_2 DB 20 DUP('$')

.CODE

MOV AX,@DATA

MOV DS,AX

MOV SI,OFFSET STR_1

MOV DI,OFFSET STR_2

NEXT:MOV AL,[SI]

CMP AL,'$'

JE EXIT

ADD AL,20H

MOV [DI],AL

INC SI

INC DI

JMP NEXT

EXIT:

MOV AH,09H

MOV DX,OFFSET STR_2

INT 21H

ENDS

END
Write ALP to convert given BCD number into Hexadecimal number

.model small

.data

num db '9999'

hex_num dw 0

mult_fact dw 1

digit_count dw 4

.code

mov ax,@data

mov ds,ax

mov bx,0ah

mov cx,digit_count

mov si,offset num+3

uP: mov al,[si]

and ax,000fh

mul mult_fact

add hex_num,ax

mov ax,mult_fact

mul bx

mov mult_fact,ax

dec si

loop up

ends

end
Write ALP to add the series of 5 numbers

.model small

.data

array db 1,2,3,4,5

sum db 0

.code

mov ax,@data

mov ds,ax

mov cx,5

mov si,offset array

up: mov al,[si]

add sum,al

inc si

loop up

ends

end
Write ALP to transfer block of numbers in memory location

.model small

.data

scr_arr db 1,2,3,4,5,6,7,8,9,10

dst_arr db 10 dup(0)

.code

mov ax,@data

mov ds,ax

mov cx,10

mov si,offset scr_arr

mov di,offset dst_arr

up:

mov al,[si]

mov [di],al

inc si

inc di

loop up

ends

end
Write ALP to add only odd numbers in given array

.model small

.data

array db 11h,12h,13h,14h,15h

sum_odd db 0

.code

mov ax,@data

mov ds,ax

mov cx,5

mov si,offset array

up: mov al,[si]

ror al,1

jc dn

jmp next

dn: rol al,1

add sum_odd,al

next:inc si

loop up

ends

end
Write ALP to check given number is odd or even

.model small

.data

num db 89h

odd db 0

even db 0

.code

mov ax,@data

mov ds,ax

mov al,num

ror al,1

jnc dn

rol al,1

mov odd,al

jmp exit

dn: rol al,1

mov even,al

exit:ends

end
Write ALP to add two 16 bit numbers

.model small

.data

num1 dw 2323h

num2 dw 3445h

.code

mov ax,@data

mov ds,ax

mov ax,num1

add ax,num2

ends

end

You might also like