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

Exp 4 New

Uploaded by

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

Exp 4 New

Uploaded by

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

Microprocessor Lab.

2
Experiment No. (4)

Student Name:

Date:
Experiment 4 pre-Lab.
Objective:-
Practice at home with the following using DEBUG program:
1. Find The Contents of AL at Each Step of the Following:
a) MOV AL,55h AL= . . . . .. . .. .. . .. .
b) AND AL,1Fh AL= . . . . .. . .. .. . .. .
c) OR AL,C0h AL= . . . . .. . .. .. . .. .
d) XOR AL,0Fh AL= . . . . .. . .. .. . .. .
e) NOT AL AL= . . . . .. . .. .. . .. .

2. Describe the Function of the Following Sequence of Instructions:


a) MOV AL, 3 AL= . . . . . . . . . . . . . . .
b) MOV BL,AL BL= . . . . . . . . . . . . . . .
c) MOV CL,4 CL= . . . . . . . . . . . . . . .
d) ROR AL,CL AL= . . . . . . . . . . . . . . .
e) AND AL,F0h AL= . . . . . . . . . . . . . . .
f) AND BL,0Fh BL= . . . . . . . . . . . . . . .
g) OR AL,BL AL= . . . . . . . . . . . . . . .

The function is: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


3. What are the results that are produced in the destination operands by executing instructions (a)
through (g)? Use DEBUG commands to alter the contents of memory & registers prior to
operation as follows:
AX=5555h BX=0010h CX=0010h DX=AAAAh SI=0100h DI=0200h DS:100h=0Fh
DS:101h=F0h DS:110h=00h DS:111h=FFh DS:200h=30h DS:201h=00h
DS:210h=AAh DS:211h=AAh DS:220h=55h DS:221h=55h DS:300h=AAh
DS:301h=55h
a) AND BYTE PTR [0300h],0Fh [0300h]= . . . . . . . . . . . . . . . CF= . . . . . .
b) AND DX,[SI] DX= . . . . . . . . . . CF= . . . . .
c) OR [BX+DI],AX [BX+DI]= . . . . . . . . . . . . . . . CF= . . . . . .
d) OR BYTE PTR [BX][DI]+10h,0F0h [BX+DI+10h]= . . . . . . . . . . . . . . . CF= . . . . . .
e) XOR AX,[SI+BX] AX= . . . . . . . . . . . . CF= . . . . . .
f) NOT BYTE PTR [0300h] [0300h] ]= . . . . . . . . . . . . . . . CF= . . . . . .
g) NOT WORD PTR [BX+DI] [BX+DI]= . . . . . . . . . . . . . . . CF= . . . . . .
1 Student Experiment Manual 2023-2024
Microprocessor Lab. 2

4. What are the results that are produced in the destination operands by executing instructions (a)
through (f)? Use DEBUG commands to alter the contents of memory & registers prior to
operation as follows:
AX=0000h BX=0010h CX=0105h DX=1111h SI=0100h DI=0200h CF=0
DS:100h=0Fh DS:200h=22h DS:201h=44h DS:210h=55h DS:211h=AAh
DS:220h=AAh DS:221h=55h DS:400h=AAh DS:401h=55h
a) ShL DX,CL DX= . . . . . . . . . . CF= . . . . .
b) ShL BYTE PTR [0400h],CL [0400h]= . . . . . . . . . . . . . . . CF= . . . . . .
c) ShR BYTE PTR[DI],1 [DI]= . . . . . . . . . . . . . . . CF= . . . . . .
d) ShR BYTE PTR [BX+DI],CL [BX+DI]= . . . . . . . . . . . . . . . CF= . . . . . .
e) SAR WORD PTR [BX+DI],1 [BX+DI]= . . . . . . . . . . . . . . . CF= . . . . . .
f) SAR WORD PTR [BX][DI]+10h,CL [BX+DI+10h]= . . . . . . . . . . . . . . CF= . . . . . .

g) What are the results that are produced in the destination operands by executing instructions (a)
through (f)? Use DEBUG commands to alter the contents of memory & registers prior to
operation as follows:
AX=0000h BX=0010h CX=0105h DX=1111h SI=0100h DI=0200h CF=1
DS:100h=0Fh DS:200h=22h DS:201h=44h DS:210h=55h DS:211h=AAh
DS:220h=AAh DS:221h=55h DS:400h=AAh DS:401h=55h
a) ROL DX,CL DX= . . . . . . . . . . CF= . . . . .
b) RCL BYTE PTR [0400h],CL [0400h]= . . . . . . . . . . . . . . . CF= . . . . . .
c) ROR BYTE PTR [DI],1 [DI]= . . . . . . . . . . . . . . . CF= . . . . . .
d) ROR BYTE PTR [BX+DI],CL [BX+DI]= . . . . . . . . . . . . . . . CF= . . . . . .
e) RCR WORD PTR [BX+DI],1 [BX+DI]= . . . . . . . . . . . . . . . CF= . . . . . .
f) RCR WORD PTR [BX][DI]+10h,CL [BX+DI+10h]= . . . . . . . . . . . . . . CF= . . . . . .

2 Student Experiment Manual 2023-2024


Experiment No. (4)
Microprocessor Lab. 2
Student Name:

Date: Logical Group and


Shift/Rotate Group
Objective:-
To apply instructions of logical group and shift and rotate group using assembly
language.
Equipments:-
➢ PC
Procedure:-
Use NOTEPAD text editor to write assembly instructions (using logical group and shift and
rotate group) for each of the following:

code segment
assume cs:code

code ends
end start
Notes:
➢ Use the above structure.
➢ Each solution should not take more than half an hour.

1. Count the number of “1” bits in the register AX and save the result in BL.
2. Separate the odd numbers from the even numbers of the 100 bytes stored in memory.
Count each of them and store the number of odds in CL and the number of evens in CH.
Assume the first byte is stored at the location 30000h and each number consists of single
byte. Save odd numbers at 50000h and the even numbers at 40000h.
Test them using DEBUG, write them on LAB paper with comments and describe the results.

3 Student Experiment Manual 2023-2024

You might also like