A negative number has its msb as binary 1 …Hence we rotate the number through carry to the left and then decide upon the status of the carry flag. ORG 000h MOV A,#number ;The number…
Tag: 8051 code to find a number is even or odd
8051 code to find a number is even or odd
So the basic logic we use is to check weather a number divides with 2 or not . Here we can use another logic by rotating the value in the accumulator to the right through carry and then make the decision based on the value of the carry.I will post…