| 
 
 Sample Problem:
 (HL) =3629
 (DE) =4738
 
 
                   Step 1 : 29 + 38 = 61 and auxiliary carry flag = 1Result = 8367:.add 06
 61 + 06 = 67
 Step 2 :  36 + 47 + 0 (carry of LSB) = 7D
 Lower nibble of addition is greater than 9, so add 6.
 7D + 06 = 83
 
 Source program :
 
 
MOV A, L : Get lower 2 digits of no. 1ADD E : Add two lower digitsDAA : Adjust result to valid BCDSTA 2300H : Store partial resultMOV A, H : Get most significant 2 digits of numberADC D : Add two most significant digitsDAA : Adjust result to valid BCDSTA 2301H : Store partial resultHLT : Terminate program execution. | 
 
 
 
 
 
 
 
Flowchart for Program | 
1 Comments
Question 1
ReplyDeleteWrite 8085 Assembly Language Program to classify the numbers into positive, negative, odd and even
numbers. The list of numbers is stored from A001h and the amount of number is stored in A000h. The
result of classification is stored starting from the corresponding memory location:
– Positive number: A011h
– Negative number: A021h
– Odd number: A031h
– Even number: A041h
Note: Assume the amount of number is less than 10 and 2's complement.