You are on page 1of 2

S.Y.

(CSE)-I Subject: Digital Systems & Microprocessor Lab

Experiment No. : 07 (A)

Title: Addition of two 8-bit nos.

Objective: Addition of 8-bit no. using various addressing modes.

Keywords: - addressing modes.

Theory:
Algorithm: -
1. Register addressing:
a. Take first 8-bit data in one Register.
b. Take second 8-bit data in another Register
c. Add the two operand
d. Store result in any register.

2. Direct addressing:
a. Take first 8-bit data in accumulator from one memory location.
b. Move data from accumulator to another reg.
c. Take another 8-bit data in accumulator from another memory location.
d. Add these two data.
e. Store result at another memory location.

3. Indirect addressing:
a. Load one reg. pair.
b. Move data from memory i.e. specified by register pair to accumulator.
c. Add accumulator and memory location contents.
d. Store result.

Instructions used in this program:


ADI : add immediate data to Accumulator
Operation: A← A + data
Addressing mode: Immediate addressing
No. of bytes: 2 bytes
Flags: all flags are affected

STA: Transfer Accumulator data to specified memory.


Operation: Memory← A
Addressing mode: direct
No. of bytes: 3 bytes
Flags : no flags are affected

LDA: Load data in Accumulator directly from address given


Operation: A← memory content
Addressing mode: direct
No. of bytes : 3 bytes
Flags: no flags are affected

Department of Computer Science and Engineering. 7.1


Textile and Engineering Institute, Ichalkaranji.
Experiment No.: 5 Subject: : Digital Systems & Microprocessor Lab

LXIH Rp, addr(16) : load address of memory in register pair


Operation: HL← address (16)
Addressing mode: indirect
No. of bytes: 3 bytes
Flags: no flags are affected

EXPT.NO.07 B)
Title: Subtractions of two 8-bit nos.

Aim: Program for Subtractions of two 8-bit numbers.

Objective: Subtractions of 8-bit no. using various addressing modes

Keywords: addressing modes,

Theory:
Algorithm: -
1) Register addressing:
a. Take first 8-bit data in one Register.
b. Take second 8-bit data in another Register.
c. Subtract the two operand.
d. Store result in any register.
2) Direct addressing:
a. Take first 8-bit data in accumulator from one memory location.
b. Move data from accumulator to another reg.
c. Take another 8-bit data in accumulator from another memory location.
d. Subtracts these two data.
e. Store result at another memory location.
3) Indirect addressing:
a. Load one reg. pair.
b. Move data from memory i.e. specified by register pair to accumulator
c. Subtracts memory contents from accumulator.
d. Store result.

Instructions used in this program:


SUI: subtract 8 bit immediate data from accumulator
Operation: A← A-data (8)
Addressing mode: immediate
No. of bytes: 2 bytes
Flags: All flags are affected

Sub r : subtract specified register from accumulator


Operation: A← A-r
Addressing mode: register
No. of bytes: 1 bytes
Flags: All flags are affected

Department Computer Science and Engineering.


D.K.T.E.’s Textile and Engineering Institute, Ichalkaranji. 7.2

You might also like