Friday, 25 February 2011

KOde program mcs-51 membentuk flip-flop,johnson counter,wiper dan kipas

org 0h
mulai: mov r2,#45
mov dptr,#numerik
nextdata: clr a
movc a,@a+dptr
mov p0,a
inc dptr
acall ldelay
djnz r2,nextdata
sjmp mulai

ldelay: mov r1,#243
y: mov r0,#00h
x: nop
nop
nop
nop
nop
nop
djnz r0,x
djnz r1,y

mov r3,#228
z: nop
nop
nop
nop
nop
djnz r3,z
nop
nop
nop
nop
nop
nop
ret
numerik:
db 0fh,0f0h,0fh,0f0h,7fh,3fh,1fh,0fh,07h,03h,01h,00h,80h,0c0h,0e0h,0f0h,0f8h,0fch,0feh,0ffh,0ffh,7eh,3ch,18h,00h,18h,3ch,7eh,0ffh,00h,80h,0c0h,0e0h,0f0h,0f8h,0fch,0feh,0ffh,0feh,0fch,0f8h,0f0h,0e0h,0c0h,80h
end

No comments:

Post a Comment