program for single user electronic voting machine in assembly language:



org 00h

lcd equ p0

rs equ p1.0

rw equ p1.1

en equ p1.2

mov lcd,#38h

acall cmd

acall delay

mov lcd,#06h

acall cmd

acall delay

mov lcd,#01h

acall cmd

acall delay

mov lcd,#0ch

acall cmd

acall delay

mov lcd,#85h

acall cmd

nop

mov lcd,#'0'

acall disp

mov lcd,#86h

acall cmd

nop

mov lcd,#'0'

acall disp

nop                                                                                        ;jdsjdkd

setb p2.0

mov dptr,#300h

mov r0,dpl

mov r3,dph

mov r6,#00d

check: jb p2.0,check

inc r6

mov a,r6

mov b,#10

div ab

mov r5,b                                                             

cjne r5,#00,go                                   ;gdhfjgk

mov dpl,r0

mov dph,r3                                                         ;//////*********1st**********//////

                                               

mov a,r5

movc a,@a+dptr

mov lcd,#86h

acall cmd

mov lcd,#'0'

acall disp

mov lcd,#85h

acall cmd

mov lcd,a

acall disp

inc dptr

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

acall delay

mov r0,dpl

mov r3,dph

sjmp check



go: mov dptr,#200h

mov a,r5

movc a,@a+dptr

mov lcd,#86h

acall cmd

acall delay

acall delay

acall delay

acall delay

acall delay

mov lcd,a

acall disp

sjmp check





abc2: sjmp abc2



cmd: clr rs

clr rw

setb en

acall delay2

clr en

ret



delay2: mov r1,#0cch

here3: mov r2,#001h

here: djnz r2,here

djnz r1,here3

ret



disp: setb rs

clr rw

setb en

acall delay2

clr en

ret



delay: mov r4,#0f1h

abn2: mov r7,#0ffh

abn: djnz r7,abn

djnz r4,abn2

ret



org 200h

db '0123456789'



org 300h

db '123456789'



Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © Microcontroller Projects -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -