EXPERIMENT 2: INPUT/OUTPUT and ARITHMETIC/LOGICAL OPERATIONS

OBJECT:

To investigate input/output instructions, arithmetic logical instructions, counting and loop.

REFERENCE:

Gaonkar, R.S., Microprocessor Architecture, Programming and Applications with the 8085/8080A

Sections: 6.1-6.5, 7.1-7.3, 8.1-8.3

Appendix F 8085/8080A Instruction Set

1. PRELIMINARY WORK

1.1.Write a program that performs the following operations (step-by-step):

      i) take inputs from dipswitches (address: 12H)

      ii) if input is in range 80H-FFH continue reading,

      iii) else if input is in range 00H-7FH, store this input in memory range starting from F100H (i.e. F100H and F101H contains first and second inputs in this range, respectively, and so on).

      iv) the program adds up these inputs in range 00H-7FH and shows this sum on LEDs (address:11H),

      v) if the summation of these inputs gets larger than FFH, program sends the number of bytes written into memory on LEDs and finishes.

      vi) if the summation is not greater than FFH, program checks D7 bit of dipswitches, if it is 0 program continues reading dipswitch value, if D7 is 1 program goes to beginning (step i) to get the next input and goes on the same procedure.

      Note: LEDs are common anode, so you have to complement your value before sending LEDs.

1.2. (Optional) Write a program to sum up the contents of memory locations E000H to E0DFH and store the result into the memory locations E0E0H (LSB) and E0E1H (MSB). Do not use 16-bit arithmetic instructions.

2. EXPERIMENTAL WORK:

2.1. Execute the program that you have written in part 1.1 and check the related memory contents.

2.2. (Optional) Fill the related memory range (E000H-E0DFH) with a byte. Execute the program that you have written in part 1.2 and check related memory contents.