OBJECT:Write a program to find the greatest number from an array of 10 numbers.
INSTRUMENT REQUIRED: 8086 Microprocessor Trainer Kit.
|MEMORY LOCATION||MACHINE CODE||OPCODE||OPERAND|
|020D||BE 00 02||MOV||SI,0200H|
|0212||46||L1 : INC||SI|
|0215||73 02||JNB L2|
|0219||FE C9||L2 : DEC||CL|
|021B||75 F5||JNZ L1|
|021D||BF 0A 02||MOV||DI,020AH|
To solve the given objective, we have taken ten hexadecimal numbers in the memory locations from 0200H and 0209H. In order to find the greatest number amongst them we need to compare each number with the other. The greatest number will be stored in the memory location 020AH.
To solve the given objective, we have taken the following steps:
- Initially we initialize the counter register CL to 9 because the number of comparisons with any one number would be 9. In other words, it will compare 9 times.
- Move the source index register (SI) pointer to the location of the first number.
- Store the first number in the Al register using SI.
- Initiate a loop and compare each element with the element stored in AL while simultaneously decrementing counter CL.
- If the number is greater than that stored in AL then we store that number in AL else we do not change the value in AL.
- The above mentioned process goes on until CL becomes zero, at this point we have the greatest number in the AL register.
- Move the destination index (DI) pointer to point to the memory location where the result is to be stored.
- Finally move the result from the AL register to the destination using DI and Halt.
RESULT:The greatest of the 10 hexadecimal numbers is E6H, which gets stored in the memory location 020AH.
1. INC SI: The content of a specified 8-bit or 16-bit register or memory location(s) is incremented by one by this instruction.
2. CMP AL,[SI]: The compare instruction compares two specified operands. For comparison one operand is subtracted from the other.
3. JNC: It causes the program execution to jump to the label given in the instruction.
4. HLT: This instruction stops program execution. The processor stops fetching and executing instructions.
Most Important Question for Exam
Binary Code Decimal
Dual inline package
Destination Index register
Address Latche Enable
Non Mask able Interrupt
0000H to FFFFH
Properties of the programs being executed
Control Unit and ALU
- 8086 Instruction Hex Code
- Write a program to two add 16 bit Hexadecimal numbers without carry.
- Write a program to two add 16 bit Hexadecimal numbers with carry.
- Write a program to find the greatest number from an array of 10 numbers.
- Write a program to calculate the factorial of a number.
- Write a program to multiply two 16-bit numbers result should be greater than 16 bit.
- Write a program to input 5 numbers and arrange them in descending order.
- Write a program to convert the string data it’s Two’s complement form.
- Write a program to read 8 bit data from Port B. Complement this data & send it back to Port A of
- Write a program to move a block of data from one memory location to another. Input Value
- Write a program to find Gray code equivalent of a Binary number using Lookup Table.
- Microprocessor 8086 Video Play List