mcs-51单片机编程问题,急用

2024-11-19 04:26:58
推荐回答(2个)
回答1:

.
org 0000h
ajmp main
org 0003h
ajmp X0_INT
org 0013h
ajmp stop
org 001bh
ajmp to
org 0030h
;------------------------
main:
mov tmod, #20h
mov tl1, #06h
mov th1, #06h
setb it0
setb it1

MOV IE, #8BH
MOV R1, #100
MOV R2, #10 ;中断1000次, 才能到500ms
MOV 20H, #0

sjmp $
;------------------------
to:
djnz r1, a1

MOV R1, #100
DJNZ R2, A1
MOV R2, #10
INC 20H
MOV P1, 20H

a1: reti
;------------------------
stop:
clr tr1
reti
;------------------------
X0_INT:
setb tr1
reti
end

回答2:

你要C51还是汇编的
5分也太太少了吧