Assignment Help, Cloud Based ERP System, Microsoft NAV Certification
WELCOME !!

Please Register, ask for assignment solutions & post the solutions if you know any.

LETS START POSTING YOUR IDEAS AND THOUGHTS AND BUILD THE COMMUNITY OF EXPERTS.

Assignment Help, Cloud Based ERP System, Microsoft NAV Certification

Stock Market, Online Tutoring, Cloud Based ERP System, Microsoft Dynamics Reporting, Microsoft Nav Certification


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Assessment Question (8085) on 21st March 2009, 4:33 pm

diadem59

avatar
Administrator
With the assumption that there are 100 eight bit data in a table starting from memory location A000H, write a program to find the sums of even and odd numbers of the table and store the 16-bit sums at the end of the table.

SOLUTION:

Code:
    LXI B,0000H
    LXI D,0000H
    LXI H,0A000H
   
Agn:    MOV A,M
    RRC
    RLC    ;Restore origial data but CY holds D0 bit
    JC Odd
   
    ADD C
    MOV C,A
    JNC Nxt
    INR B
    JMP Nxt
   
Odd:ADD E
    MOV E,A
    JNC Nxt
    INR D
   
Nxt:INX H
    MOV A,L
    CPI 64H
    JNZ Agn
   
    MOV M,C
    INX H
    MOV M,B
    INX H
    MOV M,E
    INX H
    MOV M,D
   
    HLT

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum