You are on page 1of 2

EXPERIMENT No. 12 1.

0 TITLE :
To write a program to subtract two numbers.

2.0 PRIOR CONCEPTS:


8051 Architecture & Instruction Set

3.0 NEW CONCEPTS:


1. Entering opcode and operand in the microcontroller. 2. Entering the program in proper order. 3. Executing the program. 4. Checking the results/ contents in various registers.

4.0 LEARNING OBJECTIVES:


1. To enter opcode and operand in the microcontroller.

2. To enter the program in proper order. 3. To execute the program. 4. To check the results/contents in the various registers.

5.0 APPARATUS:
8051 Microcontroller Kit.
6.0

PROCEDURE & OBSERVATION TABLE :


Address 6000 6002 6004 6005 90 Opcode/data 74 78 98 7000 33 22 Instruction MOV A, # 33 MOV R0, #22 SUBB A,R0 MOV DPTR, # 7000 Comment Load 33 in the accumulator Load 22 in the R0 register Subtract the contents of register R0 from the contents of accumulator Set 7000 in the DPTR

6008 6009

MOVX@DPTR,A RET

Move contents of the accumulator into 7000 Return to command mode

You might also like