Program No. 3 Addition of Two 8 Bit Numbers Without Carry
Program No. 3 Addition of Two 8 Bit Numbers Without Carry
+. %dd accumulator with an immediate data +1h -. Store the % register content to memory location 9000h. &. Stop the program.
Method II: Add!t!o# $%!#& 'e&!%te'% $. +. o0e an 8bit immediate data to % register. o0e an 8bit immediate data to 2 register.
-. %dd accumulator and 2 register without carry .. Store the %ccumulator content to memory location 800$h &. Stop the program.
PROGRAM:
Method I: I Addre ss 9000 9001 9002 9003 9004 900) 900 9007
ed!"te "dd!t!o# Mnemonic s MVI A, 14H Opcode 3E 14 ADI 27H C 27 &'A 9000H 32 *0 90 +&'3 D, &to- t%e -rogram &tore t%e A!!"m"#ator !ontent to memor( #o!ation 9000% Add a!!"m"#ator $it% an immediate data 27H Comments Move an 8bit immediate data to A register
Label
Method II: Add!t!o# $%!#& 'e&!%te'% Addre ss 9000 9001 9002 9003 9004 900) 900 9007 9008 +&'3 ADD . &'A 9000H MVI ., 27H Label Mnemonic s MVI A, 14H Opcode 3E 14 0 27 80 32 *0 90 D, &to- t%e -rogram &tore t%e A!!"m"#ator !ontent to memor( #o!ation 9000% %dd accumulator and 2 register without carry Move an 8bit immediate data to C register Comments Move an 8bit immediate data to A register
CONCLUSION: E3ecuted and 0eri"ied output o" the program "or addition o" two 8bit numbers without carry.
$.h
000$ 0$00 6
+1h
00$0 0$$$
777777777777777777777777
00$$ $0$$
-2h
Be+o'e E(e,$t!o#: %
//
9000h
//
A+te' E(e,$t!o#: %
3.
9000h
3.%
% 2
//
9000h
A+te' E(e,$t!o#: % 2
27% 3.%
9000h
3.%
&tart
o0e an 8bit immediate data to % register. %dd accumulator with an immediate data +1h
&tart
&tart
o0e an 8bit immediate data to % register.
&tart