You are on page 1of 1

1/1

; Assembler generated listing; Not editable.


; Generated by GNUSim8085: http://www.gnusim8085.org/

;<Program OEP1>

4200 C3 03 042 jmp start

;data

;code
4203 00 start: nop
4204 21 00 080 LXI H,8000H ; Load memory address of the first number into H…
4207 46 MOV B,M ; Move the first number to register B
4208 23 INX H ; Increment memory address to point to the second…
4209 AF XRA A ; Clear accumulator A
420A 4F MOV C,A ; Move 0 to register C (used for storing the resu…

420B 86 LOOP: ADD M ; Add the second number to the accumulator


420C D2 10 42 JNC SKIP ; Jump if no carry (positive sum)
420F 0C INR C ; Increment the result (register C)

4210 05 SKIP: DCR B ; Decrement the counter (register B)


4211 C2 0B 042 JNZ LOOP ; Jump to LOOP if B is not zero

4214 21 50 80 LXI H,8050H ; Load memory address to store the result


4217 71 MOV M,C ; Store the result in memory
4218 23 INX H ; Increment memory address
4219 77 MOV M,A ; Store the content of the accumulator (carry) in…
421A 76 hlt

http://www.gnusim8085.org/

You might also like