Statement:: Source Program 1
Statement:: Source Program 1
Statement:: Source Program 1
a. Consider the sum to be 8 bit number. So, ignore carries. Store the sum at memory location
4300H.
b. Consider the sum to be 16 bit number. Store the sum at memory locations 4300H and 4301H.
Sample problem 1:
4200H = 04H
4201H = 10H
4202H = 45H
4203H = 33H
4204H = 22H
Result = 10 +41 + 30 + 12 = H
4300H = H
Source program 1:
LDA 4200H
SUB A : sum = 0
4200H = 04H
420lH = 9AH
4202H = 52H
4203H = 89H
4204H = 3EH
Source program 2
LDA 4200H
JNC SKIP
MOV A, B
Statement: Multiply two 8-bit numbers stored in memory locations 2200H and 2201H by
repetitive addition and store the result in memory locations 2300H and 2301H.
Sample problem 1:
(2200H) = 03H
(2201H) = B2H
Result = B2H + B2H + B2H = 216H
= 216H
(2300H) = 16H
(2301H) = 02H
Source program :
LDA 2200H
MOV E, A
MVI D, 00 : Get the first number in DE
register pair
LDA 2201H
MOV C, A : Initialize counter
LX I H, 0000 H : Result = 0
BACK: DAD D : Result = result + first
number
DCR C : Decrement count
JNZ BACK : If count 0 repeat
SHLD 2300H : Store result
HLT : Terminate program execution
Statement: Program to shift a 16-bit data 1 bit left. Assume data is in the HL register
Source Program
Statement: Two decimal numbers six digits each, are stored in BCD package form. Each
number occupies a sequence of byte in the memory. The starting address of first number is
6000H Write an assembly language program that adds these two numbers and stores the sum in
Statement: Write an assembly language program to convert the contents of the five memory
locations starting from 2000H into an ASCII character. Place the result in another five memory
locations starting from 2200H.
Sample Problem
(2000H) = 1
(2001H) = 2
(2002H) = 9
(2003H) = A
(2004H) = B
Result:(2200H) = 31
(2201H) = 32
(2202H) = 39
(2203H) = 41
(2204H) = 42
Source program:
ADI 30H
JMP LAST