Saturday, 16 March 2013

A µP 8085 ALP to Sort out even and odd number

Algorithm:
1. Store the input data bytes in consecutive memory locations.
2. Fetch each data byte and check it D0 bit.
3. If D0 bit=0 then even, else odd.
4. Store odd in  memory locations. Store even in some other consecutive memory location.

I/P 6 data byte from 9500H, store odd from 8600H and even from 8700H.

                       LXI H,9500H
                  LXI B,8600H
                  LXI D,8700H
                  MVI A,06H
COUNTR   STA 9100H
                  MOV A,M
                  ANI 01H
                  JNZ CARRY
                  MOV A,M
                  STAX B
                  INX B 
                  JMP JUMP
CARRY      MOV A,M
                  STAX D
                  INX D
JUMP         LDA 9100H
                  DCR A
                  INX H
                  JNZ COUNTR
                  RST 1 

The Programming Model of Microprocessor Controlled Temperature System(MCTS)

The Schematic Diagram of Microprocessor Controlled Temperature System

ALP to create multiplication table

An ALP for 8085. Multiplication table on any number between 0-9 upto nX10 if n is the number. Input the number at 9000H and see nX(0,1,2,3.....,9) from 8500H memory location to 850AH memory location. 
LDA 9000H
LXI H,8500H
MVI M,00H
INX H
MVI C,08H
STAX H
INX H
LOOP ADD A
STAX H
INX H
DCR C
JNZ LOOP
RST 1

Happy Programming

Friday, 15 March 2013

Program to calculate a^b

A µP 8085 Program to Calculate a^b. The calculation is possible upto 8-bit and has to be stored in a memory location.

LDA 8500H

LXI H,8600H

MOV B,M

ZERO ANA

DCR B

JNZ ZERO

STA 9100H

RST 1

load a into 8500H, b into 8600H and check o/p at 9100H...kindly verify the program!


Happy Programming... cheers

Monday, 11 March 2013

µP for Students

As we all are aware µP 8085 is the most basic microprocessor that we learn at college level. In this blog, I will be bringing to you some facts and programs that will help in developing interest for the subject. Well, the subject already seems to be very cool, now its our job to make it cooler.