⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rm.asm

📁 主从报警系统
💻 ASM
字号:
        org 0000h
        ljmp start
        org 0040h
;*********************initialize
start:  mov sp,#60h
        clr ex0
        clr ex1
        clr et0
        clr et1
        clr es
        clr ea
        clr ri
        clr ti
        mov p2,#00h
        mov p0,#00h
        mov tmod,#21h
        mov tl1,#0e8h
        mov th1,#0e8h
        mov pcon,#00h
        mov scon,#0d0h ;
        setb tr1       ;      tcon  tf1 tr1 tf0 tr0 ie1 it1 ie0 it0
                       ;bit address 8f  8e  8d  8c   8b 8a  89   88
;**********************Hand to pc
start1: jbc ri,qu      ;jump if r1=1(have int),then clear r1
        sjmp start1
qu:     mov a,sbuf
        clr ri
        dec a
        jz answer
        sjmp start
answer: mov sbuf,#88h
next:   jbc ti,hint
        sjmp next
hint:   clr ti
;**********************Recycle check and transmit the IMF to pc
check:  mov a,p1
        anl a,#0fh  
        mov sbuf,a
        acall  light

        jbc  ri,resets
        sjmp  l3
      resets: mov  a,sbuf
             dec a
             dec a
             jz  reset2
             sjmp l3
      reset2:ljmp start

l3:     jbc ti,l33
        sjmp l3
l33:    clr ti
        acall delay
        sjmp check
;**********************sub programme to delay the time

delay:  mov r3,#0ffh
dl1:    mov a,#0ffh
dl0:    dec a
        jnz dl0
        djnz r3,dl1
        ret
;**********************

;It's the end of the file

 light: mov  a,p1
        anl  a,#0fh
        swap  a
        mov   p2,a
        jnz  beep
        sjmp  wc
  beep: acall  delay
        setb p2.0
        acall  delay
        clr  p2.0
  wc:   ret
  ;****************


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -