Skip to content

Instantly share code, notes, and snippets.

View SaurabPoudel's full-sized avatar
🦊
experimenting

Saurab Poudel SaurabPoudel

🦊
experimenting
  • Pulchowk Campus
  • Bhaisepati,Lalitpur, Nepal
  • 03:41 (UTC +05:45)
  • X @SaurabPoudel07
View GitHub Profile
@SaurabPoudel
SaurabPoudel / lab1.asm
Last active May 29, 2024 14:33
A table consists of ten 8-bit data starting at 8050H. Write an 8085 program to store the sum of odd numbers at 8060H and store sum of even numbers at 8070H. Also display the sum at output ports.
LXI H, 8050H ; Memory Location
LXI B, 0000H ; Carry-Sum even
LXI D, 0000H; Carry-Sum odd
TOP: MOV A, M
RRC ; Rotate right to check odd or even
JC ODD ; if 1 in carry then jump to ODD
MOV A, M; as we rotated we can re-rotate or simply move
ADD C ; sum in accumulator, in first instance it is 0
MOV C,A ; move sum in sum register