Вы находитесь на странице: 1из 2

Write a program for addition with carry.

START

[HL] 7501

[C] 00

[A] [M]

[HL] [NL+1]

[A] [A]+[M]

IS THERE
ANY CARRY

[C] [C]+1

7503 [C]

7504 [A]

STOP
Memory address label Machine codes mnemonics Comments
7000 3A LXI 7501H Address of 1st
number in H-L pair
7001 01
7002 75
7003 0E MVI MSB’of sum in
register C initial
value=00
7004 00
7005 7E MOV First no. in
accumulator
7006 23 INX Address of the 2nd
no. 8502 in H-L
pair
7007 86 ADD 1st no. +2nd no.
7008 D2 JNC Is carry ?no, go to
the label AHEAD
7009 0C
700A 70
700B 0C INR Yes, increement C
700C 0F RRC Rotate right
without carry
700D AHEAD 32 STA LSB’s of sum in
7503H
700E 03
700F 75
7010 79 MOV MSB’s of sum in
accumulator
7011 32 STA MSB’sof sum in
7504H
7012 04
7013 75
7014 CF RST STOP

Вам также может понравиться