Uploaded by adreaminginworld

slow learners question

advertisement
Slow Learners Question
All questions are compulsory to answer.
Topics: Each set 4 questions are present as per following covered topics
1. Architecture / Pin diagram / Min or Max mode (5 Marks)
2. Addressing mode / Instruction set (10 Marks)
3. ALP PROGRAM (10 Marks)
4. DOS BIOS (Advanced ALP) (5 Marks)
Q. Set
No.
1
2
Question
(A) Write instructions for the following operations:
(i) Push the content of AX register on to the stack.
(ii) Push the content of memory location offset address 0500 on to the stack.
(iii) Store the content of stack top memory locations in AL and AH registers.
(iv) Store the16-bit flags on to the stack.
(v) Pop the top of the stack into the 16-bit flag word.
(B) Write instructions for the following operations:
(i) Compare 16-bit immediately available data (4567H) from the AX register
(ii) Increment the contents of the CX register by one
(iii) Decrement the contents of memory location specified by the BX register
(iv) 2’s complement of the accumulator
(v) Compare 8-bit immediately available data (FFH) from contents of memory
location specified by source index address 0400
(A) The content of registers are given below.
[AX]-1000H, [BX]-2000H, [SI]-3000H, [DI]-4000H, [BP]-5000H, [SP]-6000H,
[CS]-0000H, [DS]-1000H, [SS]-2000H, [IP]-7000H.
Identify the addressing mode, and calculate effective addresses for following
instruction with explanation
(i) MOV AX, [5000H]
(ii) MOV AX, [BX]
(iii) MOV AX, 5000[BX]
(iv) MOV AX, [BX][SI]
(v) MOV AX, 5000 [BX][SI]
(B) (i) Identify the different addressing mode in 8086.
(a) MOV BX, 1234
(b) MOV AX, [SI]
(c) MOV [Offset Address], 2345
(d) MOV CX, [BX+SI]
(e) MOV AX, [BX+SI+1234]
(ii) Identify the memory location accessed by the following instructions:
(a) MOV AL, [0100]
(b) MOV CL, [BX + 0200]
Assume CS = 2300, BX = 1000H, SI = 0100
3
(A) Create a program for Decimal addition of two 16 –bit numbers and the sum is 16
bit. Two decimal numbers 4477H and 2299H are stored in DX and BX registers
respectively. After addition, the result is to be stored in the CX register.
(B) Create an assembly language program to multiply two numbers of 16-bit data for
given Input and output. The data representation is as follows.
4
(A) Determine the output following program and explain the used bios function call.
Program:
mov bl, 061h
mov cx, 8
print: mov ah, 2
mov dl, '0'
test bl, 10000000b
jz zero
mov dl, '1'
zero: int 21h
shl bl, 1
loop print
mov dl, 'b'
int 21h
(B) Determine the output following program and explain the used bios function call.
Program:
.MODEL SMALL
.STACK 100H
.DATA
SQUARE DB '12345678','$'
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
LEA DX, SQUARE
MOV AH, 9
INT 21H
INT 21H
MOV AH, 4CH
INT 21H
MAIN ENDP
END MAIN
Q.
No.
5
6
Question
(A)
Show which JMP instruction assembles (short, near, or far) if the JMP THERE
instruction is stored at memory address 10000H and the address of THERE is:
(a) l0020H
(b) 11000H
(c) 0FFFEH
(d) 30000H
(B)
Write instructions for the following operations:
(i) Exchange the byte between memory location offset address 0300 and the AL
register
(ii) Load 8 bits of flags in the AH register
(iii) Exchange the word between DX and AX registers
(iv) Copy a byte from the port address 03 to the AL register
(v) Output the content of accumulator to port address 01
(i) Develop code for an AND instruction that will:
(a) AND 0EAH with DH
(b) AND DI with BP and save the result in DI
(c) AND the data addressed by BP with CX and save the result in memory
(d) AND the data stored in four words before the location addressed by SI with DX
and save the result in DX
(e) AND AL with memory location WHAT and save the result at location WHAT
(A)
(ii) Suppose that DS = 1000H, SS = 2000H, BP = 1000H, and DI = 0100H.
Determine the memory address accessed by each of the following instructions,
assuming real mode operation:
(a) MOV AL,[BP+DI]
(b) MOV CX,[DI]
Identify addressing mode used and explain with diagram.
(B)
(i) Develop code for XOR instruction that will:
(a) XOR BH with AH and save the result in AH
(b) XOR 99H with CL
(c) XOR DX with DI and save the result in DX
(d) XOR the data stored 30 words after the location addressed by BP with DI and
save the result in DI
(e) XOR DI with memory location WELL and save the result in DI
(ii) Suppose that DS = 1300H, SS = 1400H, BP= 1500H, and SI = 0100H.
Determine the address accessed by each of the following instructions, assuming real
mode operation
(a) MOV AL, [BP+SI-200H]
(b) MOV AL,[ SI-0100H]
Identify addressing mode used and explain with diagram.
7
8
(A)
Design a program to add two ASCII number. Use decimal number 9 and 8 for
addition. Start the program at memory location 17B3: 0100. Write physical address
for each instruction and values of AX, BX, CX and DX.
(B)
Develop a program to multiply the two ASCII digits in CH and CL and leave the
ASCII result in AH and AL. Determine the contents of AX if CX = 3639H.
(A)
Determine the output following program and explain the used bios function call.
Program:
org 100h
.DATA
a DB "8086emu is easy and interesting $"
b DB 0DH,0AH,"$"
.code
MOV AH,9
LEA DX,a
INT 21H
LEA DX,b
INT 21H
INT 21H
LEA DX,a
INT 21H
ret
(B)
Determine the output following program and explain the used bios function call.
Program:
.MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN PROC
MOV CX,2
START:
MOV AH,2
MOV DL,'*'
INT 21H
INT 21H
MOV dl, 10
MOV ah, 02h
INT 21h
INT 21h
MOV dl, 13
INT 21h
MOV ah, 02h
INT 21h
LOOP START
MOV CX,5
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
Q. Question
No
9
a) What are functional units of Bus interface unit (BIU)?
b) Describe their functions
10 a)Write the name of the addressing mode for the following: 1. MOV BX,
[1354H]
2. MOV AX, [BX + 08H]
3. MOV AX, 0A9FH
4. MOV CL, DH
5. MOV DX, [BX + SI + 0AH]
b) Identify the status of the Accumulator after executing each line MOV AL,23H
MOV BL,45H ADD AL,BL XOR
AL,BL SUB AL,3H
MOV BL,AL
11
Develop the Assemble Language Program (ALP) for the shown flow chart below.
12
Determine the character (Ascii) will display on the output device for the following
program.
DATA SEGMENT DATA1 DB
20 DATA2 DB 15H DATA
ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA START:
MOV AL,DATA1 MOV
BL,DATA2 ADD AL,BL MOV
DL,AL MOV AH,02H INT 21H
MOV AH,4CH INT 21H
CODE ENDS END START
END
Download