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

📄 int.s

📁 nucleus 的以太网协议栈
💻 S
📖 第 1 页 / 共 5 页
字号:
_INT_Initialize:

//      XDEF    _main
//      _main:
;VOID    INT_Initialize(void)
;{
;
;    /* Lockout interrupts during initialization.  */
;
        MOVE.W  #$2700,SR                   ; Lockout interrupts
;
;    /* Setup the vectors loaded flag to indicate to other routines in the 
;       system whether or not all of the default vectors have been loaded. 
;       If INT_Loaded_Flag is 1, all of the default vectors have been loaded.
;       Otherwise, if INT_Loaded_Flag is 0, registering an LISR cause the
;       default vector to be loaded.  */
;    INT_Loaded_Flag =  1;
;
        MOVE.L  #1,_INT_Loaded_Flag         ; Indicate whether vector table is
                                            ;   loaded (1) or not loaded (0)
;
;*******************************************************************************
; Steal whole interrupt vector table.  Modified by Daoxu Hu.
;*******************************************************************************

; QUAD Board.  Do not steal the interrupt vector table.  Only steal the timer
; interrupt.  LISR interrrupts and direct interrupts should be setup directly.
;

        MOVE.L  #_INT_Vectors,D0            ; Pickup address of vector table
	SUBQ.L  #8,D0
        MOVEC   D0,vbr                      ; Setup vector table base register
;
;       MOVEC   vbr,A0                      ; Pickup vector table base address
;
;    /* Save the current value of the system stack.  */
;
        CLR.L   -(A7)                       ; Place a NULL on the system stack 
        MOVE.L  A7,_TCD_System_Stack        ; Save system stack pointer
;        
;    /* Define the global data structures that need to be initialized by this
;       routine.  These structures are used to define the system timer 
;       management HISR.  */
;    TMD_HISR_Stack_Ptr =        _sys_memory;
;    TMD_HISR_Stack_Size =       HISR_STACK;
;    TMD_HISR_Priority =         0;
;
;       MOVE.L  #_sys_memory,D0

    	MOVE.L	#`BASE(sys_memory),D0            ; Put the available memory
                                                 ;   address in D0
        MOVE.L  D0,_TMD_HISR_Stack_Ptr           ; Save the HISR stack pointer
        MOVE.L  #HISR_STACK,_TMD_HISR_Stack_Size ;   and stack size
        MOVE.L  #0,_TMD_HISR_Priority            ; HISR priority 0-2
        ADD.L   #HISR_STACK,D0                   ; Position past the HISR stack
;
;     /* Call INC_Initialize with a pointer to the first available memory 
;        address after the compiler's global data.  This memory may be used
;        by the application.  */
;     INC_Initialize(first_available_address);
;
        MOVE.L  D0,-(A7)
        BSR     _INC_Initialize
;}
;
;
;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */
;/*                                                                       */
;/*      INT_Vectors_Loaded                                               */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This function returns the flag that indicates whether or not     */
;/*      all the default vectors have been loaded.  If it is false,       */
;/*      each LISR register also loads the ISR shell into the actual      */
;/*      vector table.                                                    */
;/*                                                                       */
;/* AUTHOR                                                                */
;/*                                                                       */
;/*      William E. Lamie, Accelerated Technology, Inc.                   */
;/*                                                                       */
;/* CALLED BY                                                             */
;/*                                                                       */
;/*      TCC_Register_LISR                   Register LISR for vector     */
;/*                                                                       */
;/* CALLS                                                                 */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* INPUTS                                                                */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*      W. Lamie        07-15-1993      Created initial version 1.0      */
;/*      D. Lamie        07-15-1993      Verified version 1.0             */
;/*                                                                       */
;/*************************************************************************/
        XDEF    _INT_Vectors_Loaded
_INT_Vectors_Loaded:
;INT    INT_Vectors_Loaded(void)
;{
;
;    /* Just return the loaded vectors flag.  */
;    return(INT_Loaded_Flag);
        MOVE.L  _INT_Loaded_Flag,D0         ; Put the flag into D0
        RTS                                 ; Return to caller
;}
;
;
;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */
;/*                                                                       */
;/*      INT_Setup_Vector                                                 */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This function sets up the specified vector with the new vector   */
;/*      value.  The previous vector value is returned to the caller.     */
;/*                                                                       */
;/* AUTHOR                                                                */
;/*                                                                       */
;/*      William E. Lamie, Accelerated Technology, Inc.                   */
;/*                                                                       */
;/* CALLED BY                                                             */
;/*                                                                       */
;/*      Application                                                      */
;/*      TCC_Register_LISR                   Register LISR for vector     */
;/*                                                                       */
;/* CALLS                                                                 */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* INPUTS                                                                */
;/*                                                                       */
;/*      vector                              Vector number to setup       */
;/*      new                                 Pointer to new assembly      */
;/*                                            language ISR               */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      old vector contents                                              */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*      W. Lamie        07-15-1993      Created initial version 1.0      */
;/*      D. Lamie        07-15-1993      Verified version 1.0             */
;/*                                                                       */
;/*************************************************************************/
        XDEF    _INT_Setup_Vector
_INT_Setup_Vector:
;VOID  *INT_Setup_Vector(INT vector, VOID *new)
;{
;
;VOID    *old_vector;                        /* Old interrupt vector      */
;VOID   **vector_table;                      /* Pointer to vector table   */
;
;    /* Calculate the starting address of the actual vector table.  */
;    vector_table =  (VOID **) vbr;
;
        MOVEC   vbr,A0                      ; Pointer to the vector table
;
;    /* Pickup the old interrupt vector.  */
;    old_vector =  vector_table[vector];
;
        MOVE.L  4(A7),D0                    ; Pickup the vector number
        LSL.L   #2,D0                       ; Adjust for the vector size
        ADDA.L  D0,A0                       ; Add in offset to vector base
        MOVE.L  (A0),D0                     ; Pickup previous vector
;    
;    /* Setup the new interrupt vector.  */
;    vector_table[vector] =  new;
;
        MOVE.L  8(A7),D1                    ; Pickup the new vector pointer
        MOVE.L  D1,(A0)                     ; Store it in the vector table
;    
;    /* Return the old interrupt vector.  */
;    return(old_vector);
;
        RTS                                 ; Return to caller
;}
;
;
;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */
;/*                                                                       */
;/*      INT_Retrieve_Shell                                               */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This function retrieves the pointer to the shell interrupt       */
;/*      service routine.  The shell interrupt service routine calls      */
;/*      the LISR dispatch routine.                                       */
;/*                                                                       */
;/* AUTHOR                                                                */
;/*                                                                       */
;/*      William E. Lamie, Accelerated Technology, Inc.                   */
;/*                                                                       */
;/* CALLED BY                                                             */
;/*                                                                       */
;/*      TCC_Register_LISR                   Register LISR for vector     */
;/*                                                                       */
;/* CALLS                                                                 */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* INPUTS                                                                */
;/*                                                                       */
;/*      vector                              Vector number to setup       */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      shell pointer                                                    */

⌨️ 快捷键说明

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