dhdw001.asm

来自「嵌入式RMON,RMON为Remote monitor的缩写,基于SNMP为网络」· 汇编 代码 · 共 80 行

ASM
80
字号
;************************************************************************
;* MODULE INFORMATION*
;**********************
;*     FILE     NAME:       dhdw001.asm
;*     SYSTEM   NAME:       devlib
;*     ORIGINAL AUTHOR(S):  Paul Lemmers
;*     VERSION  NUMBER:     
;*     CREATION DATE:       1990/8/14
;*
;* DESCRIPTION: 
;*              
;************************************************************************
;* CHANGES INFORMATION **
;************************
;* REVISION:    $Revision:   1.2  $
;* WORKFILE:    $Workfile:   dhdw001.asm  $
;* LOGINFO:     $Log:   D:/CPROG/MYDEV/DEVLIB/VCS/DHDW001.ASV  $
;*              
;*                 Rev 1.2   18 Dec 1990 14:04:10   PAUL
;*              Ahum, adapted to _fastcall naming
;*              
;*                 Rev 1.1   17 Dec 1990 14:10:58   PAUL
;*              _fastcall implementation
;*              
;*                 Rev 1.0   14 Aug 1990 14:32:44   PAUL
;*              Initial revision.
;************************************************************************/
; 
	INCLUDE	cdev.inc


_TEXT	SEGMENT
	PUBLIC	@dev_disable, @dev_restore_int
;************************************************************************
;* NAME:        dev_disable
;* SYNOPSIS:    USHORT _fastcall dev_disable(void);
;* DESCRIPTION: Disables the interrupts with a cli instruction.
;* CALL REGISTERS:
;*              none
;* UNMODIFIED REGISTERS:
;*              ds bp si di
;* RETURNS:     ax = old flags register
;************************************************************************
@dev_disable	PROC	NEAR

	pushf
	pop	ax
	cli			; disable interrupts

	RET
@dev_disable	ENDP

;************************************************************************
;* NAME:        dev_disable
;* SYNOPSIS:    USHORT _fastcall dev_restore_int(USHORT flags)
;*              USHORT  flags;    Flags as returned by dev_disable().
;* DESCRIPTION: Restores the interrupts status with a sti instruction
;*              if flags indicates that it was enabled.
;* CALL REGISTERS:
;*              ax    flags
;* UNMODIFIED REGISTERS:
;*              ds bp si di
;* RETURNS:     ax = new flags register
;************************************************************************
	flags = 4
@dev_restore_int PROC	NEAR

	and	ax,200h		; IF(flag) AND flags from parm
	jz	L$00		; jump if IF was not set (disabled)
	sti			; enable interrupts
L$00:	pushf
	pop	ax

	RET
@dev_restore_int ENDP

_TEXT	ENDS

	END

⌨️ 快捷键说明

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