Subtraction of Two 8-bit numbers


Aim:-

Subtraction of two 8-bit number.

Apparatus:-

Microprocessor kit.

Data:-

7501-49H
7502-32H

 

Memory address

 

Machine code

 

Mnemonics

 

Operands

 

Comments

 

7000

 

21,01,75

 

LXI

 

H, 7501 H

 

Get address of 1st no. in H-l pair

 

7003

 

7E

 

MOV

 

A,M

 

1st no. in the accumulator

 

7004

 

23

 

INX

 

H

 

Increment the content of H-l pair by 1

 

7005

 

96

 

SUB

 

M

 

Subtract 2nd number from 1st number

 

7006

 

32, 03, 75

 

STA

 

7503 H

 

Store result in 7503 H

 

7009

 

CF

 

RST-1

 

 

stop


Procedure:-

1)How to enter the program
Esc->S->CR->CR->S.address (7000)->CR->Esc->S->CR->CR->Data->CR.

2)How to execute the program
ESc->Go->CR->CR->S.address->CR

3)How to check the result.
S->CR->CR->address(7503)-> result

Result:-
7503-17

Comments

Popular posts from this blog

Estimation of total chlorophyll by Aron's method

Here's what you need to know about sun's coronal heating

what would have happened if gravitation force was 9.9 km/s^2 instead of 9.8 km/s^2