Page 54 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 54
Introduction to Microprocessors
Notes Some of the opcodes are given below:
1. Add the contents of a register to the Accumulator. The opcode is 10000 SSS (5 bit opcode – 3
bits are reserve for a register). If the register is B then the steps are as follows:
ADD 10000
to Register B 000
to Accumulator A Implicit
Binary Instruction 1000 0000
8 0 H
Then the Assembly language presentation of this is as follows:
Opcode Operand Hexcode
ADD B 80H
2. Move/copy the contents of the source register (R ) to the destination register (R ). If the R is
s d S
Register A and R is Register D and 2-bit opcode or MOV is 01 then the binary value of this
d
instruction is
MOVE the contents 01
To register D 010
From register A 111
Binary Instruction 0101 0111
5 7 H
Then the Assembly language presentation of this is as follows:
Opcode Operand Hexcode
MOV D, A 57H
3.5 Sample Programs
An assembly program to add two numbers
Program
MVI D, 8BH
MVI C, 6FH
MOV A, C
1100 0011
1000 0101
0010 0000
ADD D
OUT PORT1
HLT
48 LOVELY PROFESSIONAL UNIVERSITY