Google

Aug 30, 2008

check wether given 16 bit number is palindrome or not

Palindrome program taking 16 bits.

taking C7H,EBH as given data i have done the program
which is equivalant to 1101011111101011

ORG 2000H
LXI H,2100H ;DATAS ARE STORED AT LOCATIONS 2100H,21001H
MOV A,M
MVI C,07H

LOOP: RRC
CALL SBR ;SBR IS SUBROUTINE
DCR C
JNZ LOOP

ANI 01H
ADD D
INX H
CMP M
LXI H,2400H ;1 IS STORED AT MEM-LOC 2400H IF PALIIN ELSE 0
JZ PALIN
MVI M,00H
JMP FIN

PALIN: MVI M,01H
FIN: HLT

SBR: MOV B,A
MOV A,D
JNC BYPAS ;IF CARRY IS NOT 1 IS NOT AADED
ADI 01H
BYPAS: RLC
MOV D,A
MOV A,B
RET

ORG 2100H
DB 00C7H,00EBH ;DATA BYTE

END

here EBH is reversed and compared with C7H, if they are equal then plain else not palin


You might be also interested in:

:: Temperature Control system using 8086
:: Traffic light control system using 8086
:: Assembly Language Program to serve NMI
:: Interfacing Stepper Motor to 8086 using 8255

Aug 26, 2008

how to design a line following robot

line following robot is basically a bot with will move around following a particular line of some color

we can design it in many ways i.e using 2 motors or 1 motors for driving and other for steering and use of the microcontroller to control it is also left to readers choose

here I came across a good post relating to line follower bot
http://myfirstbot.blogspot.com/2008/07/line-follower.html

You might be also interested in:

:: assembly program to find out the largest number from an unordered array
:: Program to find out the number of even and odd numbers from a given series
:: assembly Program to create , write and close file

Aug 19, 2008

code for line following robot in atmega8

Basically a line following robot is the one which follows a particular line and moves along with that line even if its straight or curved or any thing you can look at the following video for a typical example



Now this is the source code for the line following Robot.
this will work for atmega8

int main(void)
{
DDRB|=0x0F;
PORTB=0x0F6;
while(1)
{PORTB|=0x06;
PORTB&=0x0F9;
}
}

with the above code the bot will move only in the straight path now if you want it to move in different directions just change the code in the while loop

You might be also interested in:

:: centigrade (celsius) to fahrenheit calculation for 8086 Assembly Language
:: Data transfer instructions of 8086 microprocessor
:: 8085 Microprocessor simulator for linux
::Interfacing pic microcontroller with LCD