📄 context.inc
字号:
FG_WatchActive EQU 01H ;set if watch pcode is active
FG_RetDir EQU 02H ;1 return address to direct-mode buffer
;exists on the stack. Entry of direct-
;mode stmts when this is true causes
;FG_RetDirBad to be set.
FG_AllSsExecute EQU 04H ;set if all text tables are
;in SS_EXECUTE
FG_OtxInDir EQU 08H ; Set if the mose recently scanned
; direct mode statement contained
; an otx reference. If this flag
; is set at the same time as
; FG_RetDir, then any edit is a
; CantCont.
;GRS_flagsDir enumerations
FDIR_cleared EQU 01H
FDIR_new EQU 02H
;bits for mask passed to ForEach[CP]:
;
FE_PcodeMrs EQU 01h ;TRUE if mrs's containing pcode are to be visited
FE_TextMrs EQU 02h ;TRUE if FM_TEXT and FM_TEXTFILE mrs's are to be
; visited (i.e. command window's mrs, docuemnt files)
FE_CallMrs EQU 04h ;TRUE if pFunc is to be called for mrs's text table
; BEFORE it is called for prs's text tables.
FE_PcodePrs EQU 08h ;TRUE if prs's with text tables (SUBs/FUNCTIONs)
; are to be visited
FE_NoPcodePrs EQU 10h ;TRUE if DEF FN and DECLARE prs's are to be visited
FE_FarCall EQU 20h ;TRUE if function to be called is FAR
FE_SaveRs EQU 40h ;TRUE if ForEach is to restore caller's oRsCur on exit
FE_CallMrsAfter EQU 80h ;TRUE if pFunc is to be called for mrs's text table
; AFTER it is called for prs's text tables.
;***
;GETRS_SEG, RS_BASE, SETSEG_EQ_SS, [B]PTRRS
;
;Purpose:
; Macros to allow the global Rs table to be a near or far table
; for different products built off QB shared sources.
; Added as revision [6].
; GETRS_SEG:
; Same as GETBDL_SEG, but optimized to fetch the segment of
; this particular table. If the Rs table is near, does nothing.
; RS_BASE:
; Used to perform some primitive operation (add, sub, mov)
; using the base pointer of the Rs table; if the Rs table is
; far, does nothing (as the offset to start of table is always
; zero in that case).
; If the Rs table is far and FV_LMEM == TRUE, then this
; macro must zero the arg if the operation is 'mov'.
; (or else "RS_BASE mov,..." does nothing when it is
; expected to get the Rs table base.)
;
; SETSEG_EQ_SS:
; Used to set a given seg address equal to SS, only in the
; case where the global Rs table is far; does nothing if
; the table is near.
; [B]PTRRS:
; Text macros, similar to [B]PTRTX and [B]PTRVAR, used to
; provide an es seg override for versions with the Rs table far.
;**************************************************************************
GETRS_SEG MACRO reg,temp,opt ;
ENDM ;
RS_BASE MACRO op,arg,reg ;
op arg,grs.GRS_bdRs.BD_pb ;
ENDM ;
SETSEG_EQ_SS MACRO reg ;
ENDM ;
PTRRS EQU word ptr ;
BPTRRS EQU byte ptr ;
sBegin DATA
;**======================================================================**
;** External references to static context structures
;**
;** Since all of these are defined in context.c, we don't have to put
;** them under any switch
;**======================================================================**
EXTRN grs:byte ;global register set
EXTRN mrsCur:byte ;module resister set for the active module
EXTRN prsCur:byte ;procedure resister set for the active proc
EXTRN txdCur:byte ;current text table (from prs or mrs)
;**======================================================================**
;** Fundamental global state variables
;**======================================================================**
EXTRN b$mainframe:word ;initial value of BP after runtime
; inititalization. Only changes when
; the stack moves; used to reset the
; stack
EXTRN b$curframe:word ;always equal to BP, except in runtime
; support code or in U.I. code. BP is
; modified by runtime entry points and
; by non-BASIC procedures, so this is
; used to restore BP after runtime error
EXTRN b$pend:word ;points to the last (bottom) word in
; the stack. Modified only by the
; runtime, on initialization & when the
; stack moves. Used by CLEAR to reset
; the stack.
EXTRN b$pendchk:word ;Set to b$pend plus a fudge factor
; used to check to see if sufficient
; stack space remains at CALL time,
; GOSUB time, others that push a
; frame, and by U.I. recursive routines.
; Reset by the runtime when the stack
; moves.
EXTRN fNonQBI_Active:word ;Set TRUE whenever non-QBI code is
; active. Used to determine whether
; we can CONTinue, and for special
; code to blast stack back to last
; QBI frame when we STOP or ctl-Break
; with this flag set.
; Note that when 'set' this flag serves
; double duty as it contains the value
; of BP for the most recent QBI frame.
EXTRN bcurlevel_QBI:word ;Only meaningful when fNonQBI_Active
; is non-zero. Contains the value of
; b$curlevel which must be restored
; whenever we blast the stack back to
; the most recent QBI frame.
EXTRN b$cNonQBIFrames:word ;Set 0 by [re]init code. Incremented
; whenever non-QBI code is made active,
; decremented control is returned from
; such code to QBI. Used because we
; currently don't allow the user to
; Edit and then Continue when non-QBI
; frames are on the stack.
EXTRN b$curlevel:word ;A count of procedure call invocations
; used to determine which string
; temps should be released when a
; runtime error occurs. Reset by
; runtime for CLEAR/NEW/runtime
; initialization.
EXTRN pGosubLast:word ;Pointer to last GOSUB frame on the
; stack. 0 if no GOSUB's are active.
; Note that when non-zero, should
; always be the same as SP at BOS.
; Reset to 0 whenever the stack is
; reset; modified by GOSUB & RETURN
; executors.
ife CONTEXT_ASM
EXTRN oRsDupErr:word ;Error indicator set by PrsMake and
; MrsMake for LoadFile
endif ;CONTEXT_ASM
sEnd DATA
;**======================================================================**
;**== External Interface to Context Mgr Component ==**
;**======================================================================**
ife CONTEXT_ASM ;don't include these in context.asm
sBegin RARE
EXTRN InitContext:NEAR
sEnd RARE
sBegin CODE
EXTRN RsActivateCODE:NEAR
sEnd CODE
endif ;ife CONTEXT_ASM
sBegin CP
ife CONTEXT_ASM ;don't include these in context.asm
EXTRN MrsMake:FAR
EXTRN MrsDeActivate:NEAR
EXTRN RsActivate:FAR
EXTRN RsActivateCP:NEAR
EXTRN MrsActivate:FAR
EXTRN MrsActivateCP:NEAR
EXTRN MrsDiscard:FAR
EXTRN MrsFind:FAR
EXTRN PrsFind:FAR
EXTRN PrsRef:NEAR
EXTRN PrsMake:FAR
EXTRN PrsDefine:FAR
EXTRN PrsDeActivate:NEAR
EXTRN PrsDeActivateFar:FAR
EXTRN PrsActivate:FAR
EXTRN PrsActivateCP:NEAR
EXTRN NextPrsInMrs:FAR
EXTRN NextTextPrsInMrs:FAR
EXTRN GetNextPrsInMrs:NEAR
EXTRN GetNextPrs:NEAR
EXTRN NextMrsFile:FAR
EXTRN NextMrsFile_All:FAR
EXTRN PrsDiscard:FAR
EXTRN PrsDiscard1:NEAR
EXTRN PrsFree:FAR
EXTRN FreeAllUnrefdPrs:FAR
EXTRN FieldsOfPrs:NEAR
EXTRN FieldsOfPrsFar:FAR
EXTRN SetPrsField:NEAR
EXTRN OMrsORs:NEAR
EXTRN PPrsOPrs:NEAR
EXTRN ForEach:FAR
EXTRN ForEachCP:NEAR
EXTRN ForEachTxtTbl:NEAR
EXTRN ForEachTxtTblInMrs:NEAR
EXTRN ForEachPrsInPlaceCP:NEAR
EXTRN ForEachPrsInPlaceCPSav:NEAR
EXTRN OTypeOfTypeCharFar:FAR
EXTRN ValidORs:NEAR
endif ;ife CONTEXT_ASM
ife CONMISC_ASM ;don't include these in conmisc.asm
EXTRN NewStmt:FAR
EXTRN RunInit:FAR
EXTRN ContReinit:FAR
EXTRN ContReinitStat:FAR
EXTRN ClearStmt:FAR
EXTRN CantCont:FAR
EXTRN VarDealloc:NEAR
EXTRN AdjustITable:FAR
EXTRN ResetData:NEAR
EXTRN NextQBI_Frame:FAR
EXTRN ActiveORs_Frame:FAR
EXTRN FindORsFrame:NEAR
endif
ife RSALPHA_ASM
EXTRN AlphaBuildORs:FAR
EXTRN ORsOfAlpha:FAR
EXTRN NextAlphaPrs:FAR
EXTRN AlphaORsFree:FAR
endif ;RSALPHA_ASM
sEnd CP
sBegin SCAN
ife CONTEXT_ASM ; don't include these in context.asm
EXTRN PPrsOPrsSCAN:NEAR
endif ; ife CONTEXT_ASM
ife CONMISC_ASM ; don't include these in conmisc.asm
EXTRN FCanCont:NEAR
endif ; ife CONMISC_ASM
sEnd SCAN
;**======================================================================**
;**== Non-RELEASE and DEBUG routines, in condebug.c ==**
;**======================================================================**
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -