.model small
.stack 64
.data
n1 db 08h,02h
res db ?
.code
mov ax,@data
mov ds,ax
mov cx,02
lea si,n1
mov bl,0ffh
mine:mov al,[si]
cmp al,bl
jne loop1
jmp loop2
loop1:jnc loop2
mov bl,al
inc si
loop mine
jmp exit
loop2:inc si
loop mine
exit:mov res,bl
hlt
end
#include<iostream.h>
void main()
{ int a,b;
cout<<"Enter the two numbers";
cin>>a>>b;
if(x>y)
{
cout<<"\nThe greatest number"<<x;
}
else if
cout<<"\nThe greatest number"<<y;
}
You can use following steps for finding smallest number in 8085 microprocessor :-
XRA ; clear the accumulator MVI B, 30H ; load a number to B Register MVI C, 40H ; load a number to C Register MOV A, B ; Move the content of B to A CMP C ; Compare value of C against A JNC SMALL ; Jump if smaller **JMP END** ; Halt program if not small SMALL: MOV A, C ; save smaller num in accumulator **END: HLT**
Use the following algorithm (written in pseudocode). Let largest be the lowest possible real number. Let smallest be the greatest possible real number. Repeat while there is input... { Read real number r from input. If r is greater than largest then let largest be r. If r is less than smallest then let smallest be r. } End repeat. Let range be largest minus smallest. Output range.
1024
1. Read the 3 nos a,b,c 2. Let larget = a 3. if b > largest then largest = b 4. if c > largest then largest = c..... If you have to process more nos, read all of them in an array. Assume the first element be largest, do comparison through all elements of the array.... Similar algorithm can be developed for finding the lowest also. /*lab practice 2 damithguruge question 4 */ #include<stdio.h> int main() { int num1,num2,num3,num4; int smallest; printf("Please enter a number1"); scanf("%d%*c", &num1); printf("Please enter a number2"); scanf("%d%*c" ,&num2); printf("Please enter a number3"); scanf("%d%*c", &num3); Printf("Please enter a numbe4r"); scanf("%d%*c", &num4); /* num1 set as the smallest */ smallest=num1; if(smallest > num2) then smallest=num2; else if smallest >num3 then smallest=num3; else if smallest>num4 then smallest=num4; printf("smallest number:%d\n,smallest"); return(0); endif endif endif }
The greatest number is infinity.
To find the largest number: Assume (temporarily) that the first number is the largest number. You might call this the "largest number found so far". Then, for each number after the first one, compare the number with the largest number found so far. If the new number in the list is larger, call that one the "largest number found so far". Repeat for each number. After processing all the numbers, the "largest number found so far" will simply be the largest number.For example, if your list is (5, 2, 8, -1), you start assuming that 5 (the first number in the list) is the largest number. You compare with 2 - "5" is still the largest number, since 2 is smaller. When you compare with 8, you find that 8 is larger, so you replace your "largest number" with 8. "-1" is smaller, so nothing changes. Since we processed the entire list, the largest number is now 8.You can do the same - mutatis mutandis - to find the smallest number.
A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.
program to find prime number in 8085 microprocessor
k
syntax error
Lxih, 2200 mov c,m inxh mov a,m inxh cmp m jc l1 mov a,m dcr c jnz l2 inhx mov m,a hlt
kjhk
Sp[[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix|Answer]]ell chec[[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix&action=edit&section=new|Answer it!]]k your answe[[Q/Discuss:Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix|Disc]][[help/answering questions|guidelin]]Spell check your answeresussionr[[help/signing in|full benefits]] Save C[[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix|Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 ]][[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix&action=edit&section=new|Answering 'Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix?']]matrix?ancel[[Q/How many animals are in West Texas|How many animals are in West Texas?]][[Q/How do you increase the number of four wheelers vehicles for servicing in a Service workshop|How do you increase the number of four wheelers vehicles for servicing in a]][[Q/How do you increase the number of four wheelers vehicles for servicing in a Service workshop|How do you increase the number of four wheelers vehicles for servicing in a Service workshop?]] Service workshop?[[Q/How do you increase the number of four wheelers vehicles for servicing in a Service workshop|How do you increase the number of four wheelers vehicles for servicing in a Service workshop?]]More Q&A
the smaller number
The microprocessor is also known as a central processing unit, or CPU.
you read the book how to solve by dromy.
As quoted from Google Books, "Word size refers to the number of bits that a microprocessor can manipulate at one time."
You take the smallest number in of data and subtract it from the biggest number. For example in 34, 41, 37, 29, and 34 the biggest number is 41 and the smallest number is 29, so you do 41-29 which is 12. Your range is 12.