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

📄 fax.asm

📁 智能电话系统的全部C-51,ASM51源程序 内部文件较多
💻 ASM
📖 第 1 页 / 共 4 页
字号:
		mov     p1, #hi_mem
;
		mov     a, #op_none
		lcall   setop
;
		mov     a, #xon
		mov     dptr, #recvflow
		movx    @dptr, a
		mov     dptr, #tranflow
		movx    @dptr, a
;
;       function setting
		 mov     a, #func_voice
		 mov     dptr, #funcpointer
		 movx   @dptr, a
;
;       ring times setting
		mov     a, #33h                 ;ascii
		mov     dptr, #ringcntptr
		movx    @dptr, a
;
;       set dialing mode
;                mov      a, #dtmf           ;modified on 1/12/96;#pulse / #dtmf
;                lcall   setdial
;       clear cancel flag
		lcall   clrcancl
;       clear the channel control word
		mov     dptr, #chnword
		mov     a, #40h
		movx    @dptr, a
;
		push    p1
                setb    p1.4
		mov     dptr, #chnport
		movx    @dptr, a
;       clear ip flag by reading
		mov     dptr, #intreg
		movx    @dptr, a
		pop     p1
;
                lcall   hukon
                lcall   micoff
                lcall   tohand
                lcall   spkoff
;
;       devices and system initialization
		clr     ea
;;                lcall   delmails
		lcall   initsys                 ;system
		lcall   initrtm                 ;#timeout timer
		lcall   initsio                 ;comm. port
		lcall   initfax                 ;fax / modem ;int init. in it
;
;       return to main menu
		pop     p1
                ret

;############################################################################
;               entry:  clrcancl
;                       clear cancel flag
;############################################################################
;
clrcancl:       push    acc
		push    p1
		push    dpl
		push    dph
		mov     p1, #hi_mem
;
		mov     a, #success
		mov     dptr, #fcancel
		movx    @dptr, a
		pop     dph
		pop     dpl
		pop     p1
		pop     acc
		ret
;

;############################################################################
;               entry:  spkoff
;############################################################################
;
spkoff:         push    p1
		push    acc
		push    dpl
		push    dph
;
		mov     p1, #hi_mem
		mov     dptr, #chnword
		movx    a, @dptr
		setb    acc.5
		movx    @dptr, a
;
                setb    p1.4
		mov     dptr, #chnport
		movx    @dptr, a
;
		pop     dph
		pop     dpl
		pop     acc
		pop     p1
		ret
;

;############################################################################
;               entry:  tohand
;############################################################################
;
tohand:         push    p1
		push    acc
		push    dpl
		push    dph
;
		mov     p1, #hi_mem
		mov     dptr, #chnword
		movx    a, @dptr
		clr     acc.3
		movx    @dptr, a
;
                setb    p1.4
		mov     dptr, #chnport
		movx    @dptr, a
;
		pop     dph
		pop     dpl
		pop     acc
		pop     p1
		ret
;

;############################################################################
;               entry:  micoff
;############################################################################
;
micoff:         push    p1
		push    acc
		push    dpl
		push    dph
;
		mov     p1, #hi_mem
		mov     dptr, #chnword
		movx    a, @dptr
		setb    acc.2
		movx    @dptr, a
;
                setb    p1.4
		mov     dptr, #chnport
		movx    @dptr, a
;
		pop     dph
		pop     dpl
		pop     acc
		pop     p1
		ret
;

;############################################################################
;               entry:  hukon
;############################################################################
;
hukon:          push    p1
		push    acc
		push    dpl
		push    dph
;
		mov     p1, #hi_mem
		mov     dptr, #chnword
		movx    a, @dptr
		clr     acc.4
		movx    @dptr, a
;
                setb    p1.4
		mov     dptr, #chnport
		movx    @dptr, a
;
                setb    21h.0
		lcall   clrrptim
;
		pop     dph
		pop     dpl
		pop     acc
		pop     p1
		ret
;

;
;########################################################################
;#      subroutine: clrrptim                                            #
;#      entry : none                                                    #
;#      return: none                                                    #
;########################################################################
;
clrrptim:       push    acc
		push    p1
		push    dph
		push    dpl
                setb    p1.4
;
		mov     dptr, #rtc_pctl
		movx    a, @dptr
		clr     acc.6
		movx    @dptr, a
;
		pop     dpl
		pop     dph
		pop     p1
		pop     acc
		ret
;

;############################################################################
;       entry:          initsys
;       function:       initializing the system
;############################################################################
;
initsys:        push    p1
;
;       clear ip
                setb    p1.4
		mov     dptr, #intreg
		movx    @dptr, a
;
;       clear the echo result
		mov     p1, #hi_mem
		mov     dptr, #resultptr
		mov     a, #echo_unknown
		movx    @dptr, a
;       clear the temp buffer
		mov     dptr, #tmpptr
		mov     a, #0h
		movx    @dptr, a
;       clear the temp buffer for comparing
		mov     dptr, #tmpbufptr
		mov     a, #0h
		movx    @dptr, a
;       clear the timer counter
		mov     dptr, #timeaddr
		mov     a, #0h
		movx    @dptr, a
;       clear the flag end of a command line
		mov     dptr, #endofcmd
		mov     a, #0h
		movx    @dptr, a
;       clear the system status
		mov     dptr, #sysstate
		mov     a, #sys_command
		movx    @dptr, a
;       clear the ring counter
		mov     dptr, #recordring
		mov     a, #0h
		movx    @dptr, a
		inc     dptr
		movx    @dptr, a
;       clear the busy tone counter
		mov     dptr, #busycounter
		mov     a, #0h
		movx    @dptr, a
;       rings before hook off
		mov     dptr, #ringcntptr
		mov     a, #30h
		movx    @dptr, a
;
;       clear the operation byte
		mov     a, #op_none
		lcall   setop
;-------------------------------------------------------------------
;
		mov     p1, #lo_mem             ;1996,10,14                
		mov     r0, #50h
		clr     a
		mov     dptr, #tab_col
tab_clr:        movx    @dptr, a
		inc     dptr
		djnz    r0, tab_clr
;
		mov     r0, #08h
tab_clr1:       mov     dptr, #tab_col
		mov     a, r0
		dec     a
		add     a, dpl
		mov     dpl, a
		clr     a
		addc    a, dph
		mov     dph, a
		mov     a, r0
		inc     a
		movx    @dptr, a
;
		add     a, #07h
		mov     r0, a
		clr     c
		subb    a, #51h    
		jc      tab_clr1
;
		pop     p1
;
;       reset the fax/modem receiving queue
		lcall   faxrqclr
;
;       reset the fax/modem transfering queue
		lcall   faxtqclr
;
;       reset the comm transfering queue
		lcall   comquclr
;
;       reset the vt100 receiving queue
		lcall   vtrquclr
;
;       reset the vt100 transfering queue
		lcall   vttquclr
;
		ret
;############################################################################
;               entry:  faxrqclr          ;added aug.2,1995
;               function:  reset the pointer of fax/modem receiving queue
;############################################################################
;
faxrqclr:       push    acc
		push    p1
		push    dpl
		push    dph
                mov     p1, #lo_mem             ;;;#hi_mem
;
		mov     a, #0h
		mov     dptr, #faxr_wr   ;write pointer(lower byte)
		movx    @dptr, a
		mov     dptr, #faxr_rd   ;read pointer(lower byte)
		movx    @dptr, a
;
		pop     dph
		pop     dpl
		pop     p1
		pop     acc
		ret
;
;############################################################################
;               entry:  faxtqclr          ;added aug.2,1995
;               function:       reset the fax/modem transfering queue
;############################################################################
;
faxtqclr:       push    acc
		push    p1
		push    dpl
		push    dph
                mov     p1, #lo_mem                     ;;;#hi_mem
;
		mov     a, #0h
		mov     dptr, #faxt_wr   ;write pointer(lower byte)
		movx    @dptr, a
		mov     dptr, #faxt_rd   ;read pointer(lower byte)
		movx    @dptr, a
;
		pop     dph
		pop     dpl
		pop     p1
		pop     acc
		ret
;
;############################################################################
;               entry:  comquclr          ;added aug.2,1995
;               function:       reset the comm transfering queue
;############################################################################
;
comquclr:       push    acc
		push    p1
		push    dpl
		push    dph
		mov     p1, #hi_mem
;
		mov     a, #0h
		mov     dptr, #comm_wr           ;clear write pointer
		movx    @dptr, a
		mov     dptr, #comm_rd           ;clear read pointer
		movx    @dptr, a
;
		pop     dph
		pop     dpl
		pop     p1
		pop     acc
		ret
;
;############################################################################
;               entry:  vtrquclr          ;added aug.2,1995
;               function:  reset the vt100 receiving queue
;############################################################################
;
vtrquclr:       push    acc
		push    p1
		push    dpl
		push    dph
		mov     p1, #hi_mem
;
		mov     a, #0h
		mov     dptr, #rvt_wr     ;write pointer(lower byte)
		movx    @dptr, a
		mov     dptr, #rvt_rd     ;read pointer(lower byte)
		movx    @dptr, a
;
		pop     dph
		pop     dpl
		pop     p1
		pop     acc
		ret
;
;############################################################################
;               entry:  vttquclr          ;added aug.4,1995
;               function:  reset the vt100 transfering queue
;############################################################################
;
vttquclr:       push    acc
		push    p1
		push    dpl
		push    dph
		mov     p1, #hi_mem
;
		mov     a, #0h
		mov     dptr, #tvt_wr     ;write pointer(lower byte)
		movx    @dptr, a
		mov     dptr, #tvt_rd     ;read pointer(lower byte)
		movx    @dptr, a
;
		pop     dph
		pop     dpl
		pop     p1
		pop     acc
		ret
;

;########################################################################
;#      subroutine: initrtm                                             #
;########################################################################
rtc_psec        equ     0c0h
;
rtc_pmin        equ     0c2h
rtc_phou        equ     0c4h
rtc_pday        equ     0c6h
rtc_pdat        equ     0c7h
rtc_pmon        equ     0c8h
rtc_pyea        equ     0c9h
;
rtc_pstu        equ     0cah
rtc_pctl        equ     0cbh
rtc_pint        equ     0cch
rtc_ppwr        equ     0cdh
rtp_osec        equ     0d1h
rtp_cntl        equ     0d2h
rtp_cnth        equ     0d3h
;
rtp_ssec        equ     0d4h
rtp_smin        equ     0d5h
rtp_shou        equ     0d6h
rtp_sday        equ     0d7h
rtp_sdat        equ     0d8h
rtp_smon        equ     0d9h
rtp_syea        equ     0dah
rtp_syear       equ     0dbh

timeer:         push    p1
                push    dph
                push    dpl
;
                setb    p1.4
                mov     dptr,#rtc_pstu
                mov     a,#2bh
                movx    @dptr,a
                mov     dptr,#rtc_pint
                movx    a,@dptr
                mov     dptr,#rtc_ppwr
                movx    a,@dptr
                mov     dptr,#rtc_pctl
                mov     a,#0ah
                movx    @dptr,a
;
                pop     dpl
                pop     dph
                pop     p1
;
                ret

settime:        push    dpl
                push    dph
                push    p1
                setb    p1.4
                mov     dptr,#rtc_pctl
                mov     a,#8ah
                movx    @dptr,a
                mov     dptr,#rtc_pstu
                mov     a,#7fh
                movx    @dptr,a
;                mov     dptr,#rtc_ppwr
;                movx    a,@dptr
;                jnb     acc.7, set1
;                ljmp    set2
;        
;set1:
                mov     a,#0h
                mov     dptr,#rtc_psec
                movx    @dptr,a
                inc     dptr
                inc     dptr
                movx    @dptr,a
                inc     dptr
                inc     dptr
                movx    @dptr,a
set2:           lcall   timeer
                pop     p1
                pop     dph
                pop     dpl
                ret

gettime:        push    dpl
                push    dph
                push    p1

⌨️ 快捷键说明

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