8085 microprocessor example question
TRANSCRIPT
[email protected] 2014
INTRODUCTION to
MICROCOMPUTERS in ESOGU
Example Question about 8085 Software Solved by AHMET ÖZDEMİR
Assume that three switches controls 8 LEDs a system
- 4 LEDs called Low Bank
- 4 LEDs called High Bank
Switches connected to PORT1 and LEDs connected to PORT2.
- SW0 controlls system ON/OFF
- If the system is ON;
SW1 controls (all lights on or off) Low Led Bank (4 LEDs)
SW2 controls (all lights on or off) High Led Bank (4 LEDs)
MNEMONICS SOLUTION INIT: START: READ: DISPLAY_0: DISPLAY_1: DISPLAY_2:
LXI MVI OUT IN ANI MOV ANI CPI JNZ JMP MOV CPI JNZ MVI OUT JMP CPI JNZ MVI OUT JMP MVI OUT JMP
SP,FFH 00H PORT2 PORT1 07H D,A 01H 00H DISPLAY_0 START A,D 02H DISPLAY_1 A,0FH PORT2 READ 05H DISPLAY_2 A,F0H PORT2 READ A,FFH PORT2 READ
START
Initialize StackPointer
Initialize each PORT for Blank
Read switches on PORT1
SW0 is ON
Light On
on Low Bank
No
Yes
SW1 is ON
No
No
Light On
on HighBank
Yes
Yes SW2 is ON
Both LEDs of Banks ON