Question: 1 . a ) 1 0 numbers are stored from location 1 0 0 0 onwards. Write an assembly language program to count the number

1. a)10 numbers are stored from location 1000 onwards. Write an assembly language program to count the number of odd numbers in these. Draw the flowchart also.
```
From Code Segment
MOV BX,1000H
MOV CX,10
XOR AH, AH
AGAIN: MOV AL,[BX]
ROR AL,1
JNC NEXT
INC AH
NEXT: LOOP AGAIN
```
b) Suppose \(\mathrm{AX}=\mathrm{ACH}\). What will be the value in AX in each of the following cases if the carry flag is set? (i)ROL \(\mathrm{AX},2\)(ii) RCL \(\mathrm{AX},2\)
2. What will be the values of the specified registers and flags after the execution of the following instructions?
```
MOV CX,0604H
MOV AX,0A98H
RCL AL,CL ; CF=1
ADD AX,CX
AX=?, CX=?, CF=?,
PF=?, AF=?, SF=?, ZF=?
```
```
2 MOV AX,8F0AH
3 MUL AL
- SUB AH,AL
s ADC AX,AX
AX=?, CF=?, PF=?
(6 AX=?, CF=?, PF=?,
```
and B are ASCII number
3. Given the definition of the following data segment, where A and B are ASCII numbers.
```
.DATA
A DB '28,
B DB '54
ORG 0100H
C DB ?
```
Write the required code segment that converts these ASCII numbers to packed BCD and add them up to calculate sum in pack BCD form. Save the result in variable C. The resulting BCD number is assumed to be a byte.
4. Write an assembly language program that will process the following sentence as follows :
a) Convert the first letter of each word to upper-case,
b) Count and save the number of words in the sentence,
c) Count and save the number of alpha characters (letters) in the sentence
Consider the following sentence in your program : "king khalid university was established in \(1419 H \)."
The program should be general and work for any sentence ending with a full stop '.' character.
Uppercase characters are ordered between '\( A \)'\((41 H)\) and '\( Z \)'\((5 A H)\) and lowercase characters are ordered between '\( a \)'\((61 H)\) and '\( z \)'\((7 A H)\) in the in the ASCII Code table. For lowercase letters, bit \(5(d 5)\) of the ASCII code is 1 where for uppercase letters it is 0.
For example,
5. Write a program that finds the number of 1 s in a 16-bits data.
6. Write a program that finds the number of 0 s in a 8-bits data.
7. How many I/O modes are available in 8255 A programmable peripheral interface? List and explain them in short.
8. For the circuit diagram shown in Figure 1:
a) What are the addresses of port A, port B, port C, and control register PCW.
b) Which control word is required to interface seven segments display to port A and switches to port B and port C in mode 0.
c) Write an 8086 ALP program to read the switches and display their sum on the seven segment display continuously.
1 . a ) 1 0 numbers are stored from location 1 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!