Add 16-Bit With Carry

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

www.eazynotes.

com

Gursharan Singh Tatla

Page No. 1

Flow Chart to Add Two 16-bit Numbers With Carry

www.eazynotes.com

Gursharan Singh Tatla

Page No. 2

Program to Add Two 16-bit Numbers With Carry


Address
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 200A 200B 200C 200D 200E 200F 2010 2011 2012 2013 2014 2015

Mnemonics
LHLD

Operand
3000 H

Opcode
2A 00 30 EB 2A 02 30 0E 00 19 D2 0E 20 0C 22 04 30 79 32 06 30 76

Remarks
Load H-L pair with data from 3000 H

XCHG LHLD

3002 H

Exchange H-L pair with D-E pair Load H-L pair with data from 3002 H

MVI DAD JNC

C, 00 H D 200E H

Move 0 to C Add D-E pair with H-L pair Jump to location 200E H if no carry

INR SHLD

C 3004 H

Increment C Store the result at location 3004 H

MOV STA

A, C 3006 H

Move carry from C to A Store the carry at location 3006 H

HLT

Halt

Before Execution: 3000: 3001: 3002: 3003: 16 H 5A H 9A H 7C H

After Execution: 3004: B0 H 3005: 76 H 3006: 01 H

You might also like