Now let us see a program of Intel 8085 Microprocessor. In this program we will see how to simulate the hexadecimal counter.
Write 8085 Assembly language program to simulate hexadecimal counter.
Hexadecimal counters in 8085 is similar to the binary counter. There are two different parts. The main counting part and the delay part. We have to define a delay subroutine to generate delay between each number while counting. We are considering that we have some external display which are connected through IO port, that will display the result in hexadecimal form.
Here we are not providing any input.
|F000||06, FF|| ||MVI B,FFH||Store FF into B|
|F002||04||NEXT||INR B||Increment B|
|F003||0E, FF|| ||MVI C,FFH||Store FF into C|
|F005||0D||DELAY||DCR C||Decrease C by 1|
|F006||C2, 05, F0|| ||JNZ DELAY||Delay for FF time|
|F009||78|| ||MOV A,B||Load A with B|
|F00A||D3, 10|| ||OUT 10H||Send output to port 10|
|F00C||C3, 02, F0|| ||JMP NEXT||Jump to NEXT|
Counts are displaying into the output port 10.