You are on page 1of 1

Compiled by Arun Kumar Agrawal Page 1

8085 PROGRAMS
1. Store 8 bit data in memory
a. Store the data byte 32H into memory location 4000H.
2. Exchange the contents of memory locations
a. Exchange the contents of memory locations 2000H and 4000H.
3. Add two 8-bit numbers
a. Add the contents of memory locations 4000H and 4001H and place the result in memory location
4002H
4. Add two 16 bit numbers
a. Add the 16- bit number in memory locations 4000H and 4001H to the 16-bit number in memory
locations 4002H and 4003H. The most significant eight bits of the two numbers to be added are in
memory locations 4001H and 4003H. Store the result in memory locations 4004H and 4005H with
the most significant byte in memory location 4005H.
5. Subtract two 8 bit numbers
a. Subtract the contents of memory location 4001H from the memory location 2000H and place the
result in memory location 4002H.
6. Subtract two 16-bit numbers
a. Subtract the 16-bit number in memory locations 4002H and 4003H from 16 bit number in memory
locations 4000H and 4001H. The most significant eight bits of the two numbers are in memory
locations 4001H and 4003H. Store the result in memory locations 4004H and 4005H with the most
significant byte in memory location 4005H.
7. Finding ones complement of a number
a. Find the 1s complement of the number stored at memory location 4400H and store the
complemented number at memory location 4300H.
8. Finding 2s complement of a number
a. Find the 2s complement of the number stored at memory location 4200H and store the
complemented number at memory location 4300H.
LOOPING
1. Sixteen bytes of data are stored in memory locations at XX50H to XX5FH. Transfer the entire block of data
to a new memory locations starting at XX70H.
2. Six bytes of data are stored in memory locations starting a XX50H. Add all the data bytes. Use register B to
save any carries generated, while adding the data bytes. Display the entire sum at two output ports,(store
the sum at two consecutive memory locations XX70H and XX71H)
3. A set of ten current readings is stored in memory locations starting at XX60H. The readings are expected to
be positive(<127
10
). Write a program to
a. Check eachreading to determine whether it is positive or negative.
b. Reject all negative readings.
c. Add all positive readings
d. Output FFH to PORT1 at any time when the sum exceeds eight bits to indicate overload; otherwise,
display the sum. If no output port is available in the system, go to step 5
e. Store FFH in the memory location XXX70H when the sum exceeds eight bits; otherwise store the
sum.