link8001 发表于 2013-1-7 14:44
MOV P0,A
CLR P2.0
直接写入
求教 不知道中断里该怎么写org 0000h
ljmp main
org 0003h
ljmp int0
main: mov ie,#81h
mov a,#00h
mov dptr,#tab
mov r4,#16
loop:mov b,a
movc a,@a+dptr
mov p0,a
acall delay
mov a,b
inc a
djnz r4,loop
sjmp main
delay:MOV R7,#10
D1: MOV R6,#200
D2: MOV R5,#250
DJNZ R5,$
DJNZ R6,D2
DJNZ R7,D1
RET
tab:db 3fh,06h,5bh,4fh,66h
db 6dh,7dh,07h,7fh,6fh
db 77h,7ch,39h,5eh,79h
db 71h
end
|