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

📄 exmisc.asm

📁 [随书类]Dos6.0源代码
💻 ASM
📖 第 1 页 / 共 2 页
字号:
MakeBol	22
	SkipExHeader
MakeBol	21
	SkipExHeader
MakeBol	20
	SkipExHeader
MakeBol	19
	SkipExHeader
MakeBol	18
	SkipExHeader
MakeBol	17
	SkipExHeader
MakeBol	24
	SkipExHeader
MakeBol	16
	cmp	BosFlags,0
	jnz	BosException1
	DbCheckBos

MakeBol	15
	SkipExHeader
MakeBol	14
	SkipExHeader
MakeBol	13
	SkipExHeader
MakeBol	12
	SkipExHeader
MakeBol	11
	SkipExHeader
MakeBol	10
	SkipExHeader
MakeBol	9
	SkipExHeader
MakeBol	8
	cmp	BosFlags,0
	jnz	BosException
	DbCheckBos

NotBosDebug:
	sub	bx,bx			;offset into table of exception handlers
	mov	ax, 1
BosExLoop:
	test	cx, ax
	jnz	GotExc
BosContLoop:				;possible reentry point from DoFBosEvent
	DbAssertRel ax,nz,0,CODE,<exmisc: ax = 0 in BosException handling loop>
	inc	bx			;advance to next exception handler
	inc	bx
	shl	ax,1			;check next bit from BosFlags
	jmp	BosExLoop

GotExc:
	call	ExDispTbl[bx]		; call handler if bit was set
	SkipExHeader			;fall into exBos
MakeExe exBos,opBos
	cmp	BosFlags,0
BosException1:				
	jnz	BosException
	DbCheckBos	

MakeExe exBolLab,opBolLab
	add	si,4			;skip operands
	cmp	BosFlags,0
	jnz	BosException
	DbCheckBos


MakeExe exBreakPoint,opBreakPoint
	or	[debugFlags],DEBUG_STOP ;tell UserInterface() we've hit a
	or	[BosFlags],FBOSDEBUG	; breakpoint
	;fall into BosException code
BosExcpt:
BosException:
	mov	cx,BosFlags		;Load flags
	DbAssertRel cx,b,FBOSDEBUG*2,CODE,<invalid BosFlags at BosException>
	cmp	cx,FBOSDEBUG
	DJMP	jne NotBosDebug
;Come here if FBOSDEBUG is only bit set at opBol
; Optimization for fast WatchPoints.
	cmp	[debugFlags],DEBUG_WATCH
NotBosDebugJne:
	DJMP	jne NotBosDebug		;brif need to do more than just Watch
	cmp	[fDebugScr],FALSE
	DJMP	jne NotBosDebug
	mov	[grs.GRS_otxCur],si
	call	DebugWatch
	mov	si,[grs.GRS_otxCur]	;get value as updated by DebugWatch
	RestorePcodeVar 		;es->cur txt tbl, di->cur var tbl
	DispMac 			;and resume execution


MakeExe exBolInclude,opBolInclude
	inc	si			;skip $INCLUDE nesting depth operand
	inc	si
	SkipExHeader			;this one need not be super fast
MakeBol	7
	SkipExHeader
MakeBol	6
	SkipExHeader
MakeBol	5
	SkipExHeader
MakeBol	4
	SkipExHeader
MakeBol	3
	SkipExHeader
MakeBol	2
	SkipExHeader
MakeBol	1
	SkipExHeader
MakeBol	0
	cmp	BosFlags,0
BosExcpt2:				
	jnz	BosExcpt
	DbCheckBos



MakeExe exBolIncludeSp,opBolIncludeSp
	inc	si			;skip $INCLUDE nesting depth operand
	inc	si
	SkipExHeader			;this one need not be super fast
MakeExe exBosSp,opBosSp
	SkipExHeader			;this one need not be super fast
MakeExe exBolSp,opBolSp
	inc	si			;skip operand
	inc	si
	cmp	BosFlags,0
	jnz	BosExcpt2		
	DbCheckBos

MakeExe exBolLabSp,opBolLabSp
	add	si,6			;skip operands
	cmp	BosFlags,0
BosExcpt1:
	jnz	BosExcpt2		
	DbCheckBos


;*******************************************************************************
;DoFBosDebug - handle BOS flag FBOSDEBUG
;Purpose:
;	This routine is invoked when a runtime error occurs in a module for
;	which there is no active error handler. [debugFlags] should already
;	be set up at this point, so we just have to transfer control to
;	UserInterface().
;	NOTE: since FBOSDEBUG is the last bit checked, we don't need to return
;	      to BosException
;
;Input:
;	ax contains the FBOSDEBUG bit
;
;*******************************************************************************
DoFBosDebug:
	xor	[BosFlags], ax		; turn off bit.
	pop	ax			; Throw away the return address.
	jmp	StopGrsContext		;save si in grs, call UserInterface()

;*******************************************************************************
;DoFBosResetStk - handle BOS flag FBOSRESETSTK
;Purpose:
;	This routine causes the stack pointers to be reset to their
;	[re]initialization values.
;
;Preserves:
;	si
;*******************************************************************************
DoFBosResetStk:
PUBLIC DoFBosResetStk			;called from exEndProg if bit is set
	pop	[tempWord]		;altering stack so save retval
	and	[BosFlags],NOT FBOSRESETSTK		
					; turn off bit. Can't expect ax set up
					;  as this is called from exEndProg too
	mov	ax,sp
	push	ax			;points to bottom of range that could
					;  have owners
	mov	bp,[b$mainframe]
	push	bp			;points to top of range that could have
					;  owners
	call	B$ClearRange		;release any owners found in given range
	test	[conFlags],F_CON_ResetStkSize
	jz	StackSize_Okay		;brif don't want to reset stack size

	and	[conFlags],NOT F_CON_ResetStkSize
	call	B$StackReset		;Reset the stack to initial location
	mov	[b$mainframe],sp
	mov	bp,sp
StackSize_Okay:
	mov	word ptr [bp],0		;reinitialize end of bp chain
	mov	word ptr [bp-2],0	
	mov	sp,bp

	mov	[b$curframe],bp

	GETRS_SEG es,bx,<SIZE,LOAD>	;[14] es == Rs table seg, trashes bx
	mov	bx,[grs.GRS_oMrsCur]	
	RS_BASE add,bx			
	mov	cx,PTRRS[bx.MRS_cbFrameTemp] 
	add	cx,PTRRS[bx.MRS_cbFrameVars] 
	sub	sp,cx			;make room for module level frame stuff
	DbAssertTst   sp,z,1,CODE,<DoFBosResetStk: SP contains an odd number>
	push	ss			
	pop	es
	mov	di,sp
	mov	al,0
	rep	stosb			;initialize module frame vars
	call	GetEsDi
	mov	[b$cNonQBIFrames],0	;reset count of non-QBI frames on stack
	jmp	[tempWord]		;stack reset - - return to BOS/BOL code

;***
;exLab,exLabSp,exInclude,ex_Static,ex_Dynamic,ex_Include,exReParse
;Purpose:
;	These executors have no work other than to skip their operands.
;Input:
;Output:
;Modifies:
;*******************************************************************************
MakeExe exLab,opLab
	add	si,4			;skip operands (link, oNam)
	DispMac

MakeExe exStDefType,opStDefType
	SkipExHeader			;skip operands (link,I4mask)
MakeExe exLabSp,opLabSp
	add	si,6			;skip operands (link, oNam, cSpaces)
	DispMac

MakeExe exReParse,opReParse
	DbHalt	CODE,<exReParse executed ...>

MakeExe ex_Static,op_Static
	SkipExHeader
MakeExe ex_Dynamic,op_Dynamic
	SkipExHeader
MakeExe ex_Include,op_Include
	SkipExHeader
MakeExe exStDeclare,opStDeclare
	SkipExHeader
MakeExe exStData,opStData
	SkipExHeader
MakeExe exStRem,opStRem
	SkipExHeader
MakeExe exQuoteRem,opQuoteRem
SkipNAtrs:				;this is pretty speed critical, due to
					;  the REM executors
	LODSWTX 			;fetch cntEos
	inc	ax			;cntEos could be odd - - round up if so
	and	ax,not 1
	add	si,ax			;skip to next pcode and dispatch
	DispMac

;***
;exShared, exStatic, exVtRfxx, exAsType<Fixed|Exp|>
;Purpose:
;	These are executors requiring absolutely no work, and are
;	not speed critical.
;Input:
;Output:
;Modifies:
;*************************************************************************

MakeExe exAsTypeFixed,opAsTypeFixed	
	inc	si			
	inc	si			
	SkipExHeader			
MakeExe exAsType,opAsType
	SkipExHeader
MakeExe exAsTypeExp,opAsTypeExp
	inc	si
	inc	si
	SkipExHeader
MakeExe exVtRfI4,opVtRf,ET_I4
	SkipExHeader
MakeExe exVtRfR4,opVtRf,ET_R4
	SkipExHeader
MakeExe exVtRfR8,opVtRf,ET_R8
	SkipExHeader
MakeExe exVtRfSD,opVtRf,ET_SD
	SkipExHeader
MakeExe exVtRfI2,opVtRf,ET_I2
	SkipExHeader
MakeExe exVtRfImp,opVtRf,ET_Imp
	inc	si			;skip operand
	inc	si
	SkipExHeader
MakeExe	exNoType,opNoType
	SkipExHeader
MakeExe	exStConst,opStConst
	SkipExHeader
MakeExe exShared,opShared
	SkipExHeader			
MakeExe exNop0,opNoList0		
	SkipExHeader			;Fall through to exLParen

;***
;exLParen - left paren executor
;Purpose:
;	exLParen is present for listability.  No execution time work is
;	performed.
;****
MakeExe exLParen,opLParen
	DispMac 			;speed critical - dispatch immediately

subttl	Executors for non-release code only
page

; exInvalid - Called only when an error occured in the scanner
;
;   Several of the executor maps in the scanner have slots needed for
; filler only.	If for some reason, one of these is referenced, the
; executor exInvalid will be written to the execute state code.
;

MakeExe exInvalid,opEot 	    ;[?] opcode is arbitrary
	DbHalt	CODE, <exInvalid has been encountered>

sEnd	CODE

sBegin	UI
assumes	CS,UI
;***
;B$EnsShowOutputScr - ensure the output screen is active
;Purpose:
;	Called from the runtime at the point where an event handler is
;	about to be invoked; this is to ensure that an event handler doesn't
;	end up printing output to our debug screen.
;****
extrn	EnsShowOutSaveRs:near
cProc	B$EnsShowOutputScr,<PUBLIC,FAR,NODATA>,<ES,BX>
cBegin
	cCall	EnsShowOutSaveRs
cEnd
sEnd	UI

	end

⌨️ 快捷键说明

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