0% found this document useful (0 votes)
24 views

Programs Assembly Language

This document contains code for serial communication and printing messages on a 7-segment display. It receives data through the serial port, stores it in a buffer, and then subtracts the ASCII value of '0' to convert it to a number. This number is then used to select which message from a table to display on the 7-segment display.

Uploaded by

Ranjith Crazy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Programs Assembly Language

This document contains code for serial communication and printing messages on a 7-segment display. It receives data through the serial port, stores it in a buffer, and then subtracts the ASCII value of '0' to convert it to a number. This number is then used to select which message from a table to display on the 7-segment display.

Uploaded by

Ranjith Crazy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

jnb p1.

3,$

Serial check:jnb p1.0,dptrvalue0

jnb p1.1,dptrvalue1
communication
jnb p1.2,dptrvalue2
Different switches different jnb p1.3,dptrvalue3
messages print
sjmp check
main:mov dptr,#400h

mov tmod,#20h
dptrvalue0:mov dptr,#500h
mov scon,#50h
sjmp print
mov th1,#-3
dptrvalue1:mov dptr,#600h
setb tr1
sjmp print
mov r4,#30
dptrvalue2:mov dptr,#700h
print:movc a,@a+dptr
sjmp print
mov sbuf,a
dptrvalue3:mov dptr,#800h
jnb ti,$
sjmp print
clr ti
org 400h
clr a
db "welcome to my world",0dh
inc dptr
org 500h
djnz r4,print
db "don't wear helmet",0dh
jnb p1.0,$
org 600h
jnb p1.1,$
db "don't wear seat belt",0dh
jnb p1.2,$
org 700h
db "please drink and drive",0dh mov r0,#60h

org 800h back1:jnb ri,$

db "don't get caught by traffic mov a,sbuf


police",0dh
mov @r0,a
end
mov sbuf,a

AADHAR DETAILS jnb ti,$

PRINT clr ti

clr ri
main:mov dptr,#400h
inc r0
mov tmod,#20h
djnz r4,back1 //for
mov scon,#50h
comprae
mov th1,#-3
mov dptr,#600h
setb tr1
back3:mov r4,#12
mov r4,#30
mov r0,#60h
mov r1,#00h
back2:clr a
back:movc a,@a+dptr
movc a,@a+dptr
mov sbuf,a
mov b,@r0
jnb ti,$
cjne a,b,fault
clr ti
inc dptr
clr a
inc r0
inc dptr
djnz r4,back2
djnz r4,back
sjmp printdetails
mov r4,#12
fault:inc r1 mov dptr,#800h

cjne r1,#01h,next1 sjmp print

mov dptr,#100h next6:cjne r1,#03h,next7

sjmp back3 mov dptr,#900h

next1:cjne r1,#02h,next2 sjmp print

mov dptr,#200h next7:cjne r1,#04h,stop

sjmp back3 mov dptr,#950h

next2:cjne r1,#03h,next32 sjmp print

mov dptr,#300h

sjmp back3 print:mov r0,#30h

next32:cjne r1,#04h,stop clr a

mov dptr,#350h

sjmp back3 back5:movc a,@a+dptr

mov sbuf,a

printdetails: jnb ti,$

cjne r1,#00h,next4 clr ti

mov dptr,#500h clr a

sjmp print inc dptr

next4:cjne r1,#01h,next5 djnz r0,back5

mov dptr,#700h ajmp main

sjmp print

next5:cjne r1,#02h,next6
stop:clr a org 800h

mov r5,#40 db "mounika",0dh,"sagar",0dh

mov dptr,#1000h org 400h

back6:movc a,@a+dptr db "enteraadharnum of


ranjith",0dh
mov sbuf,a
org 600h
jnb ti,$
db "623779810165"
clr ti
org 100h
inc dptr
db "632936963005"
clr a
org 200h
djnz r5,back6
db "632936963006"
ajmp main
org 300h

db "632936963007"
org 900h
org 350h
db "ranjith",0dh,"bittu",0dh
db "123212265222"
org 950h
org 1000h
db
"ranadeepreddy",0dh,"building",0dh db "enter aadhar num is wrong
re enter"
org 500h
end
db "nee aadharnum",0dh,"type
chey",0dh

org 700h

db "nee aadharnum",0dh,"type
chey2",0dh
SERIAL RECEPTION&BLINKING LEDS: clr ri

mov scon,#50h mov a,sbuf

mov tmod,#20h mov sbuf,a

mov th1,#-3 jnb ti,$

setb tr1 clr ti

back:jnb ri,$ mov b,#48

clr ri subb a,b

mov a,sbuf movc a,@a+dptr

mov sbuf,a mov p2,a

jnb ti,$ sjmp back

clr ti org 500h

mov p2,a db
0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f
sjmp back
8h,80h,90h
END
end
SERIAL RECEPTION PRINTING ON
7SEGMENT DISPLAY
mov dptr,#500h

mov scon,#50h

mov tmod,#20h

mov th1,#-3

setb tr1

back:jnb ri,$
mov sbuf,#'*'
PASSWORD PROGRAM:
jnb ti,$
clr p1.0
clr ti
clr p1.1
clr ri
mov dptr,#400h
inc r0
mov tmod,#20h
djnz r4,back1
mov scon,#50h
mov r0,#60h
mov th1,#-3
mov dptr,#600h
setb tr1
mov r4,#6
mov r4,#15
back2:clr a
back:movc a,@a+dptr
movc a,@a+dptr
mov sbuf,a
mov b,@r0
jnb ti,$
cjne a,b,fault
clr ti
inc dptr
clr a
inc r0
inc dptr
djnz r4,back2
djnz r4,back
clr p1.0
mov r4,#6
setb p1.1
mov r0,#60h
sjmp stop
back1:jnb ri,$
fault:setb p1.0
mov a,sbuf
clr p1.1
mov @r0,a
stop:nop
ajmp $

org 400h

db "enter password"

org 600h

db "RANJITH"

end

You might also like