Free Tutorials, Linux Command, Source Code Architecture,  Software Engineering, Intelligent Systems, RDBMS, Computer Accounting,  Operations Research, Discrete Mathematics, Network, SAD Lay Networks Lay Networks
Computer Science Networking Operating Systems Linux and Unix Source Code Script & Languages Protocols Glossary
 


PROGRAM TO INCREMENT OR DECREMENT THE COUNTER.

org 0000h
mov psw,#00h
mov p1,#ffh
mov r4,#00h
mov r7,#00h
mov r5,#01h

x2: mov r0,#08h
setb c
mov a,r7
x1: rlc a
mov p2,a
mov p0,#7fh
lcall del
jnb p1.2,x6
djnz r0,x1
ajmp x2

x6: mov dptr,#0600h
mov r3,#00h
mov a,r3
movc a,@a+dptr
mov p2,#01h
mov p0,#00h
acall de1
mov p0,a
acall de1
inc r3

mov a,r3
movc a,@a+dptr
mov p2,#02h
mov p0,#00h
acall de1
mov p0,a
acall de1
inc r3

mov a,r3
movc a,@a+dptr
mov p2,#04h
mov p0,#00h
acall de1
mov p0,a
acall de1
inc r3

mov a,r3
movc a,@a+dptr
mov p2,#08h
mov p0,#00h
acall de1
mov p0,a
acall de1
inc r3

mov dptr,#0700h
mov a,r4
movc a,@a+dptr
mov p2,#80h
mov p0,#00h
acall de1
mov p0,a
acall de1

mov a,r4
movc a,@a+dptr
mov p2,#40h
mov p0,#00h
acall de1
mov p0,a
acall de1

mov a,r4
movc a,@a+dptr
mov p2,#20h
mov p0,#00h
acall de1
mov p0,a
acall de1

mov a,r4
movc a,@a+dptr
mov p2,#10h
mov p0,#00h
acall de1
mov p0,a
acall de1
djnz r5,x11
mov r5,#01h
jnb p1.3,x4
jnb p1.1,x7
ajmp x6

x11: ajmp x6

x4: mov r5,#4fh
mov a,r4
cjne a,#09h,x5
mov r4,#00h
ajmp x6
x5: inc r4
ajmp x6

x7: mov r5,#4fh
mov a,r4
cjne a,#00h,x8
mov r4,#09h
ajmp x6
x8: dec r4
ajmp x6

de1: mov b,#7fh
djnz b,$
ret

del: mov r6,#03h
x10: mov r1,#ffh
x3: mov r2,#ffh
djnz r2,$
djnz r1,x3
djnz r6,x10
ret

org 0600h
db 1fh
db 09h
db 69h
db 7eh

org 0700h
db 77h
db 44h
db 3dh
db 7ch
db 4eh
db 7ah
db 7bh
db 54h
db 7fh
db 7eh

end

Top

Back
Next
free computer articles
 

Copyright © 2000- 2008 Lay Networks All rights reserved. 

Web Hosting sponsored by Customized Software Company India
Web Site Designed by Web Designing, Flash Animation, Multimedia Presentations, Broacher/catalogue designing, Web Promotion 
Refer to your freind About Us Legal IGNOU Contact Us Feedback Donate to laynetworks.com Download Management Tutorials Tutorials History Search here