在1602LCD显示字符串
——
;p1口为数据
rs bit p3.0
rw bit p3.1
e bit p3.5
org 00h
mov sp,#70h
mov p1,#01h
call enrw
mov p1,#38h
call enrw
mov p1,#0fh
call enrw
mov p1,#06h
call enrw
mov p1,#80h
call enrw
mov dptr,#tab
call rwram
mov p1,#0ch
call enrw
mov dptr,#tab1
call rwram
mov p1,#0c2h
call enrw
jmp $
enrw:clr rs
clr rw
clr e
call delay
setb e
ret
rwram:mov r1,#00h
a1: mov a,r1
movc a,@a+dptr
call rwram2
inc r1
cjne a,#00h,a1
ret
rwram2:mov p1,a
setb rs
clr rw
clr e
call delay
setb e
ret
delay:mov r4,#05
d1: mov r5,#0ffh
djnz r5,$
djnz r4,d1
ret
tab: db 'http//www.c51.cn ',00h
tab1:db 00h
end
linux操作系统文章专题:linux操作系统详解(linux不再难懂)
评论