Académique Documents
Professionnel Documents
Culture Documents
)
(SETH BALKRISHAN MEMORIAL)
Experiment No: 01
Date: 13 July. 2010
Aim: To add two 16bit RAM variables with carry and the result is to be stored in R0,R1 pair
Requirements: 8051IDE Software, Sim8051 Software, PC.
Program:
MOV A,0DH
ADD A,14H
MOV R1,A
MOV A,0EH
ADDC A,15H
MOV R0,A
END
Opcode Operand
Result:
INPUT IN DRAM:
MEMORY DATA
0E0DH 3412H
1514H 7856H
OUTPUT
R0 = 112H R1 = 68H
. .
. .
.
Experiment No: 08
Date: 9th Mar. 2009
Aim: Write an assembly language program to solve the given arithmetic equation ∑ X2i , where
X is the 8bit unsigned no present in the memory location 30h onwards put the result in the
memory location 51h-50h.
Program:
MOV R2,#10
MOV R0,#30H
CLR A
MOV R7,#00H
MOV R3,#00H
L2: MOV A,@R0
MOV B,A
MUL AB
ADD A,R7
JNC L3
INC R3
L3: MOV R7,A
INC R0
DJNZ R2,L2
MOV 50H,R7
MOV 51H,R3
L1: SJMP L1
Program and Source Code:
Address Hex object code Mnemonics Comments
Opcode Operand
Result:
MEMORY LOCATION
30H=00 OUTPUT
31H=01 MEMORY LOCATION:
32H=04 50H=1DH
. 51H=01H
.
..
39H=51H
Experiment No: 09
Date: 09 March 2009
Aim: Write an assembly language program to find largest byte from the 10 number present in the
memory location from 30H onward , put the result & show at the end of the block.
Program:
MOV R3,#10
MOV R0,#30H
CLR A
MOV A,@R0
L3: INC R0
MOV 3AH,@R0
CJNE A,3AH,L1
L1: JNC L2
MOV A,3AH
L2: DJNZ R1,L3
L4: SJMP L4
Opcode Operand
37H=AC H
38H=EB H
39H=0E H