answersLogoWhite

0


Best Answer

Oh, dude, to find out if a number is positive or negative on an 8085 microprocessor, you can use the sign flag (SF) in the flags register. If the sign flag is set, it means the number is negative. So, like, just check if the SF is 1, and you've got your answer. Easy peasy lemon squeezy!

User Avatar

DudeBot

2h ago
This answer is:
User Avatar
More answers
User Avatar

Somosree Dey

Lvl 4
6mo ago

LXI H, 6000H : Initialize memory pointer

MVI C, 00H : Initialize number counter

MVI B, 00H : Initialize negative number counter

MVI E, 00H : Initialize zero number counter

BEGIN:MOV A, M : Get the number

CPI 00H : If number = 0

JZ ZERONUM : Goto zeronum

ANI 80H : If MSB of number = 1i.e. if

JNZ NEGNUM number is negative goto NEGNUM

INR D : otherwise increment positive number counter

JMP LAST

ZERONUM:INR E : Increment zero number counter

JMP LAST

NEGNUM:INR B : Increment negative number counter

LAST:INX H : Increment memory pointer

INR C : Increment number counter

MOV A, C

CPI 32H : If number counter = 5010 then

JNZ BEGIN : Store otherwise check next number

LXI H, 7000 : Initialize memory pointer.

MOV M, B : Store negative number.

INX H

MOV M, E : Store zero number.

INX H

MOV M, D : Store positive number.

HLT : Terminate execution

This answer is:
User Avatar

User Avatar

Wiki User

12y ago
  • LXI H, 6000H : Initialize memory pointer
  • MVI C, 00H : Initialize number counter
  • MVI B, 00H : Initialize negative number counter
  • MVI E, 00H : Initialize zero number counter
  • BEGIN:MOV A, M : Get the number
  • CPI 00H : If number = 0
  • JZ ZERONUM : Goto zeronum
  • ANI 80H : If MSB of number = 1i.e. if
  • JNZ NEGNUM number is negative goto NEGNUM
  • INR D : otherwise increment positive number counter
  • JMP LAST
  • ZERONUM:INR E : Increment zero number counter
  • JMP LAST
  • NEGNUM:INR B : Increment negative number counter
  • LAST:INX H : Increment memory pointer
  • INR C : Increment number counter
  • MOV A, C
  • CPI 32H : If number counter = 5010 then
  • JNZ BEGIN : Store otherwise check next number
  • LXI H, 7000 : Initialize memory pointer.
  • MOV M, B : Store negative number.
  • INX H
  • MOV M, E : Store zero number.
  • INX H
  • MOV M, D : Store positive number.
  • HLT : Terminate execution
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program to find whether a number is positive and negative in 8085 microprocesser?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


When you add a positive and a negative what does it become?

the answer could be negative or positive depending on whether the negative number you're adding is bigger than the positive number


Is the product positive or negative when an even number of negative numbers are multiplied?

Any 2 negative numbers, whether even or odd, when multiplied are positive


Without actually multiplying how can you decide whether the product of two integers is positive negative or 0?

the answer is a positive because two negative or two positive is always positive.


Are irrational numbers negative integers?

No. Every integer, whether negative or positive, is rational.


Are negative decimals integers?

Only whole numbers are integers, whether negative or positive.


What happen when you divide negative and positive number?

When you divide or multiply positive and negative numbers, you first do the division or multiplication as normal. The next step is to assess whether or not the answer will be negative or positive. If the two numbers of the question were the same (negative and negative or positive and positive) then the answer will be positive. If the two numbers in the question were different (one negative and one positive) then the answer will be negative. Thus, if you divide a negative number by a positive number, the result will be the same as normal division, but the answer will be negative.


What is critisism?

Criticism is having a comment for something and delivering it, whether in a positive or completely negative way. Criticism is having a comment for something and delivering it, whether in a positive or completely negative way.


Why is negative 3 a rational number?

Any integer, whether it is positive or negative, is a rational number.


What if you divide a negative by a positive?

You will end up with a negative value. It does not matter whether the numerator or denominator is negative. If either value is negative, the answer will be negative.


If you add a positive and a negative number how can you tell whether the answer will be positive negative or equal?

If the negative number is bigger then the answer will be negative If the bigger number is positive then the answer will be positive. All you do is subtract the two numbers and take the sign of the bigger number Ex (+2)+(-7)=(-5)


What determines whether an electric force is attractive or repulsive?

The charges of the objects involved determine whether an electric force is attractive or repulsive. Like charges (positive-positive or negative-negative) will repel each other, while opposite charges (positive-negative) will attract each other.