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

📄 dcm44g.a51

📁 8051实时操作系统
💻 A51
字号:
$TITLE (iDCM 44 COMMUNICATIONS FIRMWARE: GATEWAY MODULE)
$DATE (8 AUGUST 86)
$NOMO
$PAGING
$REGISTERBANK (0)

;***************************************************************************
;*
;*     TITLE:          iDCM 44 COMMUNICATIONS FIRMWARE: GATEWAY MODULE
;*
;*     RELEASE:        2.0
;*
;*     DESCRIPTION:    THIS MODULE CONTAINS THE GATEWAY PROCEDURES
;*
;*     UPDATES:
;*
;***************************************************************************

;*         

;*           COPYRIGHT 1983, 1986 INTEL CORPORATION

;*

;*           INTEL CORPORATION PROPRIETARY INFORMATION.  THIS LISTING

;*           IS SUPPLIED UNDER THE TERMS OF A LICENSE  AGREEMENT WITH

;*           INTEL CORPORATION  AND MAY NOT  BE COPIED NOR  DISCLOSED

;*           EXCEPT IN  ACCORDANCE WITH THE  TERMS OF THAT AGREEMENT.

;* 

;***************************************************************************

NAME    DCM44G


USING 0


$include(reg44.pdf)
$include(dcm44c.lit)

$include(dcm44m.a51)

PUBLIC  local_gateway_switch, parallel_gateway_switch, serial_gateway_switch


EXTRN   CODE    (send_local, send_parallel, send_serial)

DCMFW_CODE_SEG  SEGMENT CODE
DCMFW_BIT_SEG   SEGMENT DATA    BITADDRESSABLE

RSEG            DCMFW_CODE_SEG

$EJECT
;***************************************************************************
;*
;*     PROCEDURE:      local_gateway_switch
;*
;*     PURPOSE:        Route message from local source
;*
;*     CALLED FROM:    event_detect
;*
;*     ENTERED FROM:   process_rac_cmd
;*
;*     CALLS:          None
;*
;*     ENTERS:         Send_Local              (msg_ptr in R0)
;*                     Send_Serial             (msg_ptr in R0)
;*                     Send_Parallel           (msg_ptr in R0)         
;*
;*     INPUTS:         Msg_Ptr                 (in R0)
;*
;*     RETURNS:        Nothing
;*
;*     DESCRIPTION:    Local Gateway Switch reads the message header to
;*                     determine where to route message coming from
;*                     a local source, either a user task or the RAC
;*                     task.  If the Station_Address is 0, then the
;*                     message is sent via Send_Local.
;*                     If the Station_Address is 255, then the
;*                     destination is to an extension device and the
;*                     message is sent via Send_Parallel.  Otherwise,
;*                     if the message_type is an order, then the
;*                     src_ext is checked.  If the src_ext is 0,
;*                     then the message is sent via Send_Serial.  If
;*                     the src_ext is 1, then the message is sent via
;*                     Send_Parallel.
;*                     If the message_type is a Reply, then the
;*                     dst_ext is checked.  If the dst_ext is 0, then
;*                     the message is sent via Send_Serial.  If the dst_ext
;*                     is 1, then the message is sent via Send_Parallel.
;*
;***************************************************************************

local_gateway_switch:


    %set_msg_ptr(message_station_ofs)       ;chk station addr for 0
    cjne    @r1,#local_device_station,gl_not_local_station ;if not local, jump
    ajmp    send_local                      ;if local station, then send local
        
gl_not_local_station:                       ;Check Station Address for 255
    cjne    @r1,#ext_device_station,gl_type_switch ;if not, jump
    ajmp    send_parallel                   ;else, send parallel w/ a = msg_ptr
 
gl_type_switch:                             ;r1 => msg.station
    dec     r1                              ;r1 => msg.route
    mov     a,@r1                           ;
    clr     acc.trk_bit_bpos                ;clear trk bit in case user forgot
    mov     @r1,a                           ;


; if a reply type, then go check out the rest of the routing

;
    jb      acc.msg_type_bpos,gl_local_reply_message_switch

gl_local_order_message_switch:              ;else route as order

    jb      acc.src_ext_bpos,gl_send_parallel ;if src_ext=1 then send parallel

gl_send_serial:
    ajmp    send_serial                     ;else, send_serial, a = msg_ptr

gl_local_reply_message_switch:
    jb      acc.dst_ext_bpos,gl_send_parallel ;if dst_ext=1 then send parallel
    ajmp    send_serial                     ;else send serial, a,r0 = msg_ptr

gl_send_parallel:
    ajmp    send_parallel                     ;send parallel, r0 = msg_ptr



$EJECT
;***************************************************************************
;*
;*     PROCEDURE:      parallel_gateway_switch
;*
;*     PURPOSE:        Route message from parallel source
;*
;*     CALLED FROM:    input_interrupt_check
;*
;*     ENTERED FROM:   None
;*
;*     CALLS:          None
;*
;*     ENTERS:         Send_Local              (msg_ptr in R0)
;*                     Send_Serial             (msg_ptr in R0)
;*
;*     INPUTS:         Msg_Ptr: R0
;*
;*     RETURNS:        Nothing
;*
;*     DESCRIPTION:    Parallel Gateway Switch reads a message header
;*                     to determine where to route a message received
;*                     from the parallel interface.
;*                     First, the Station_Address is checked.  If it
;*                     is 255, then the message is sent via Send_Local.
;*                     Otherwise, the message_type is checked.  If the
;*                     message_type is an Order, then the src_ext, dst_ext,
;*                     and trk_bit are checked.  If the src_ext is 0, then
;*                     the message is sent via Send_Local.  Otherwise, if
;*                     the dst_ext is 0, then the message is sent via
;*                     Send_Serial.  Otherwise, if the the Trk_bit is
;*                     0, the the message is sent via Send_Serial, and the
;*                     Trk_bit is set to 1.  If the trk_bit is 1, then
;*                     the message is sent via Send_Parallel.
;*                     If the message_type is a Reply, then the src_ext,
;*                     dst_ext, and trk_bit are checked.  If the src_ext is 0,
;*                     then the message is sent via Send_Serial.  Otherwise,
;*                     if the dst_ext is 0, then the message is sent via
;*                     Send_Local.  Otherwise, if the the Trk_bit is
;*                     0, the the message is sent via Send_Serial, and the
;*                     Trk_bit is set to 1.  If the trk_bit is 1, then
;*                     the message is sent via Send_Local.
;*
;***************************************************************************

parallel_gateway_switch:
    

    %set_msg_ptr(message_station_ofs)       ;chk station addr for ffh
    cjne    @r1,#ext_device_station,gp_type_switch


gp_send_local:                 
    ajmp    send_local                      ;if so, send parallel, r0 = msg_ptr

gp_type_switch: 
    dec     r1                              ;r1 => message.route
    mov     a,@r1                           ;a = message.route


; if a reply type, then go check out the rest of the routing

;
    jb      acc.msg_type_bpos,gp_parallel_reply_message_switch

    jnb     acc.dst_ext_bpos,gp_send_serial ;if dst_ext <> 1 then send serial

    jb      acc.trk_bit_bpos,gp_send_local  ;else if trk_bit=1 then send local


    setb    acc.trk_bit_bpos                ;else set trk bit and send serial
    mov     @r1,a                           ;

gp_send_serial:
    ajmp    send_serial                     ;send serial, a = msg_ptr

gp_parallel_reply_message_switch:

;
; if reply type, then check for src_ext = 1

;
    jb      acc.src_ext_bpos,gp_source_extended_reply ;if src_ext=1, jump


    ajmp    send_serial                     ;else send serial, a = msg_ptr

gp_source_extended_reply:
    jnb     acc.dst_ext_bpos,gp_send_local  ;if dst_ext=0, go send local


    jb      acc.trk_bit_bpos,gp_send_local  ;else if trk=1, then send local


    setb    acc.trk_bit_bpos                ;else set trk flag bit

    mov     @r1,a                           ;and send serial, a = msg_ptr

    ajmp    send_serial                     ;

$EJECT
;***************************************************************************
;*
;*     PROCEDURE:      serial_gateway_switch
;*
;*     PURPOSE:        Route message from serial source
;*
;*     CALLED FROM:    UI_Control_Check
;*                     Non_Auto_Information_Receive
;*                     Serial_Timeout
;*                     Auto_Information_Frame_Check
;*
;*     ENTERED FROM:   None
;*
;*     CALLS:          None
;*
;*     ENTERS:         Send_Parallel           (msg_ptr in R0)
;*                     Send_Local              (msg_ptr in R0)
;*
;*     INPUTS:         Msg_Ptr: R0
;*
;*     RETURNS:        Nothing
;*
;*     DESCRIPTION:    Serial Gateway Switch reads a message header
;*                     to determine where to route a message received
;*                     from the BITBUS interface.
;*                     If the message is an Order, then the dst_ext is
;*                     checked.  If the dst_ext is 0, then the message
;*                     is sent via Send_Local.  Otherwise it is sent
;*                     via Send_Parallel.
;*                     If the message is a Reply, then the src_ext is
;*                     checked.  If the src_ext is 0, then the message
;*                     is sent via Send_Local.  Otherwise it is sent
;*                     via Send_Parallel.
;*                     
;***************************************************************************

serial_gateway_switch:


    %set_msg_ptr(message_route_ofs)         ;get message route flag
    mov     a,@r1                           ; a = route flag


; if a reply type then go check out the rest of the routing

;
    jb      acc.msg_type_bpos,gs_serial_reply_message_switch

gs_serial_order_message_switch:           
    jb      acc.dst_ext_bpos,gs_send_parallel ;if dst_ext=1, send parallel

gs_send_local:                      
    ajmp    send_local                      ;else send local, r0 = msg_ptr

gs_serial_reply_message_switch:             ;If reply type,
    jnb     acc.src_ext_bpos,gs_send_local  ;if src_ext=0, send local

gs_send_parallel:                           ;Otherwise,
    ajmp    send_parallel                   ;else send parallel, r0=msg_ptr

END

⌨️ 快捷键说明

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