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

📄 compiler.inc

📁 Turbo Pascal 6.0编译器源码
💻 INC
📖 第 1 页 / 共 2 页
字号:
_FlushText      equ     424
_BufferText     equ     428
_FRealExt       equ     432
_FExtReal       equ     436
_RAdd           equ     440
_RSub           equ     444
_RMul           equ     448
_RDiv           equ     452
_RCmp           equ     456
_RFloat         equ     460
_RTrunc         equ     464
_RRound         equ     468
_RSqr           equ     472
_WriteReal      equ     476
_ReadReal       equ     480
_StrReal        equ     484
_ValReal        equ     488
_RInt           equ     492
_RFrac          equ     496
_RSqrt          equ     500
_RSin           equ     504
_RCos           equ     508
_RLn            equ     512
_RExp           equ     516
_RArcTan        equ     520
_RandReal       equ     524
_InitEM86       equ     528
_InitEM87       equ     532
_Construct      equ     536
_Destruct       equ     540
_CopyObject     equ     544
_MethodCheck    equ     548
fnNeed8087      equ     8000h
fnImmediate     equ     4000h

_Void		equ	72h
_File		equ	78h
_EmptySet	equ	8ch
_Pointer        equ     96h
_String         equ     0a0h
_Extended       equ     0c0h
_Real           equ     0c6h
_Byte		equ	0deh
_Integer	equ	0f0h
_Word		equ	102h
_Longint        equ     114h
_Boolean        equ     130h
_Char           equ     14ch

_OvrCodeList    equ     (word ptr 0)
_OvrHeapSize    equ     (word ptr 2)
_OvrDebugPtr    equ     (dword ptr 4)
_OvrHeapOrg     equ     (word ptr 8)
_OvrHeapPtr     equ     (word ptr 10)
_OvrHeapEnd     equ     (word ptr 12)
_OvrLoadList    equ     (word ptr 14)
_OvrDosHandle   equ     (word ptr 16)
_OvrEmsHandle   equ     (word ptr 18)
_HeapOrg        equ     (dword ptr 20)
_HeapPtr        equ     (dword ptr 24)
_HeapEnd        equ     (dword ptr 28)
_FreeList       equ     (dword ptr 32)
_FreeZero       equ     (dword ptr 36)
_HeapError      equ     (dword ptr 40)
_ExitProc       equ     (dword ptr 44)
_ExitCode       equ     (word ptr 48)
_ErrorAddr      equ     (dword ptr 50)
_PrefixSeg      equ     (word ptr 54)
_StackLimit     equ     (word ptr 56)
_InOutRes       equ     (word ptr 58)
_RandSeed       equ     (dword ptr 60)
_FileMode       equ     (byte ptr 64)
_Test8087       equ     (byte ptr 65)

_Input          equ     0
_Output         equ     100h


fHandle         equ     (word ptr 0)
fMode           equ     (word ptr 2)
fBufSize        equ     (word ptr 4)
fPrivate        equ     (word ptr 6)
fBufPos         equ     (word ptr 8)
fBufEnd         equ     (word ptr 10)
fBufPtr         equ     (dword ptr 12)
fOpenProc       equ     (dword ptr 16)
fInOutProc      equ     (dword ptr 20)
fFlushProc      equ     (dword ptr 24)
fCloseProc      equ     (dword ptr 28)
fUserData       equ     (byte ptr 32)
fName           equ     (byte ptr 48)
fBuffer         equ     (byte ptr 128)
fRecSize        equ     256

fmClosed        equ     0d7b0h
fmInput         equ     0d7b1h
fmOutput        equ     0d7b2h
fmInOut         equ     0d7b3h

ovSignature     equ     (word ptr 0)
ovSaveReturn    equ     (word ptr 2)
ovFilePos       equ     (dword ptr 4)
ovCodeSize      equ     (word ptr 8)
ovFixupSize     equ     (word ptr 10)
ovJumpCount     equ     (word ptr 12)
ovLink          equ     (word ptr 14)
ovSegment       equ     (word ptr 16)
ovRetryCount    equ     (word ptr 18)
ovNext          equ     (word ptr 20)
ovEmsPage       equ     (word ptr 22)
ovEmsOffset     equ     (word ptr 24)
ovUserData      equ     (byte ptr 26)
ovVectors       equ     (byte ptr 32)
ovRecSize       equ     32

TExpr   struc
	exType          dd      ?
	exCode          dw      ?
	exLocation      db      ?
	exModifier      db      ?
	exRegsUsed      db      ?
	exMisc          db      ?
	exValue         dt      ?
	exOffset        equ     (word ptr exValue)
	exMap           equ     (word ptr exValue+2)
	exSegment       equ     (word ptr exValue+4)
	exOwner		equ	(dword ptr exValue+6)
	exChain1	equ	(word ptr exValue)
	exChain2	equ	(word ptr exValue+2)
	ends

elMemory        equ     0
elRegister      equ     1
elImmediate     equ     2
elAddress       equ     3
elCondition     equ     4
elPushed	equ	5
elStack		equ     6
elCall		equ	7

emSigned        equ     1
emUnsigned      equ     2
emX             equ     4
emXX            equ     8
emBoolean       equ     0
emByte          equ     emUnsigned
emShortint      equ     emSigned
emInteger       equ     emSigned+emX
emWord          equ     emUnsigned+emX
emLongint       equ     emSigned+emX+emXX

emSingle        equ     0
emExtended      equ     2
emDouble        equ     4
emComp          equ     8

emReal          equ     4

emNotVirtual	equ	1
emNewConstruct	equ	2
emDisposeDestr	equ	4

erAX            equ     1
erCX            equ     2
erDX            equ     4
erBX            equ     8
erAll           equ     erAX+erCX+erDX+erBX

efDS            equ     1
efSS            equ     2
efCS            equ     4
efES            equ     8
efBP            equ     10h
efDI            equ     20h
efConst         equ     40h
efSeg           equ     80h
efReadOnly      equ     80h

lvAX            equ     0
lvCX            equ     1
lvDX            equ     2
lvBX            equ     3
lvSI		equ	6
lvDI		equ	7
lrR1            equ     0
lrR2            equ     1

cdBelow		equ	72h
cdNotBelow	equ	73h
cdEqual		equ	74h
cdNotEqual	equ	75h
cdNotAfter	equ	76h
cdAfter		equ	77h
cdLess		equ	7ch
cdNotLess	equ	7dh
cdNotGreater	equ	7eh
cdGreater	equ	7fh
cdAlways	equ	0ebh

t_Ident         equ     1
t_Constant	equ     2
tPlus           equ     3
tMinus          equ     4
tTimes          equ     5
tSlash          equ     6
tEqual          equ     7
tNotEqual       equ     8
tGreater        equ     9
tLess           equ     10
tGEq            equ     11
tLEq            equ     12
tOParen         equ     13
tCParen         equ     14
tOBracket	equ     15
tCBracket	equ     16
tPoint		equ     17
tComma          equ     18
tColon          equ     19
tSemicolon      equ     20
tCaret          equ     21
tAssign         equ     22
tRange          equ     23
tAt             equ     24
tInlineSlash    equ     25
tConstEqual     equ     26

tAnd		equ	28
tArray		equ	29
tBegin		equ	30
tCase		equ	31
tConst		equ	32
tConstructor	equ	33
tDestructor	equ	34
tDiv		equ	35
tDo		equ	36
tDownto		equ	37
tElse		equ	38
tEnd		equ	39
tAsm		equ	40
tFile           equ     41
tFor		equ	42

tFunction	equ	44
tGoto		equ	45
tIf		equ	46
tImplementation	equ	47
tIn		equ	48
tInline		equ	49
tInterface	equ	50

tLabel		equ	52
tMod		equ	53
tNil		equ	54
tNot		equ	55
tObject		equ	56
tOf		equ	57
tOr		equ	58
tPacked		equ	59
tProcedure	equ	60
tProgram	equ	61
tRecord		equ	62
tRepeat		equ	63
tSet		equ	64
tShl		equ	65
tShr		equ	66
tString         equ     67
tThen		equ	68
tType		equ	69
tTo		equ	70
tUnit		equ	71
tUntil		equ	72
tUses		equ	73
tVar		equ	74

tWhile		equ	76
tWith		equ	77
tXor		equ	78
t_Label		equ	79
t_Const		equ	80
t_Type          equ     81
t_Var           equ     82
t_Proc		equ	83
t_StdProc	equ	84
t_StdFun	equ	85
t_New		equ	86
t_Port		equ	87
t_Mem		equ	88
t_Unit		equ	89
t_@Seg		equ	90
t_@Loc		equ	91
t_StdType	equ	92
t_Reg		equ	93

tAbsolute	equ	100
tAssembler	equ	101
tExternal	equ	102
tFar		equ	103
tForward	equ	104
tInterrupt	equ	105
tNear		equ	106
tVirtual	equ	107
tPrivate	equ	108

t_Private	equ	80h

opPlus		equ	0
opMinus		equ	1
opTimes		equ	2
opDiv		equ	3
opMod		equ	4
opShl		equ	5
opShr		equ	6
opAnd		equ	7
opOr		equ	8
opXor		equ	9
opEqual		equ	10
opNotEqual	equ	11
opGreater	equ	12
opLess		equ	13
opGEq		equ	14
opLEq		equ	15
opSlash		equ	16

coIOChk         equ     1
coRangeChk      equ     2
coStackChk      equ     4
coExtSyntax     equ     8
coVarStringChk  equ     10h
coForceFarCalls equ     20h
coBooleanEval   equ     40h
co8087          equ     80h
coDebugInfo     equ     100h
coLocalSymbols  equ     200h
coEmulation     equ     400h
coOverlayCode   equ     800h
coWordAlign     equ     1000h
co286Code       equ     2000h
coWinFrame      equ     4000h
coGlobal	equ	8000h

cfUseUnits	equ	1
cfDisk		equ	2
cfBuild		equ	4
cfMake		equ	8
cfForceUnit	equ	20h
cfDebugging     equ     40h

cfLinkMap	equ	3
cfSegmentsMap	equ	1
cfPublicsMap	equ	2
cfDetailedMap	equ	3
cfExtDebugger	equ	4
cfIntDebugger	equ	8
cfDiskBuffer	equ	10h

psNoProgram     equ     0
psCompiled      equ     1
psRunning       equ     2
psTerminated    equ     3

plDisk          equ     1
plMemory        equ     2

TFileStack	struc
	fsTextPos	dw	?
	fsLineNumber	dw	?
	fsFilePos	dd	?
	fsFileName	dw	?
	fsFileHandle	dw	?
	fsLineLength	dw	?
	fsNameEntry	dw	?
	fsCurrentLine	db	128 dup(?)
	fsNestLevel	dw	?
	fsName		db	80 dup(?)
	ends

psMainProgram		equ	-1
psInterface		equ	1
psImplementation	equ	2

fePas		equ	1
feExe		equ	2
feTpu		equ	3
feObj		equ	4
feMap		equ	5
feOvr		equ	6
feForceExt	equ	80h

fdOutputDir	equ	2
fdIncludeDir	equ	3
fdUnitDir	equ	4
fdObjectDir	equ	5
fdNoEditor	equ	80h

TWithChain	struc
	wcType		db	?
	wcFlags		db	?
	wcOffset	dw	?
	wcMap		dw	?
	wcSegment	dw	?
	wcOwner		dd	?
	wcNext		dw	?
	ends

wfNoTempVar	equ	1
wfTempVar	equ	2

THeapRecord	struc
	hrAddress	dd	?
	hrLimit		dw	?
	hrError		dw	?
	ends

	.data?

	extrn	InitOptions:word
	extrn	InitDefines:word
	extrn	SourceBufPtr:word
	extrn	SourceBufEnd:word
	extrn	ErrorNum:word
	extrn	ErrorPar:word
	extrn	ErrorPos:word
	extrn	LibraryUnits:word
	extrn	FileStackPtr:word
	extrn	SaveFileStack:word
	extrn	TempBufPtr:word
	extrn	TpuListPtr:word
	extrn	ErrorHandler:word
	extrn	ErrorSP:word
	extrn	ErrorBP:word
	extrn	ObjectFileSize:word
	extrn	ObjectFileSeg:word
	extrn	ProgramLocation:word
	extrn	CodeSize:dword
	extrn	DataSize:word
	extrn	TotalLines:dword
	extrn	FirstHeapRec:word
	extrn	EndHeapRec:word
	extrn	ExactAlloc:byte
	extrn	FirstUnit:word
	extrn	UsedUnit:word
	extrn	CurDepth:word
	extrn	SymbolType:dword
	extrn   CompilerOptions:word
	extrn	ParamsSize:word
	extrn	ParamsBottom:word
	extrn	ProcResult:word
	extrn	LocalsSize:word
	extrn	LocalsBottom:word
	extrn	TempLocalsSize:word
	extrn	WithChain:word
	extrn	LabelChain:word
	extrn	LastGoal:word
	extrn   ExitChain:word
	extrn   FailChain:word
	extrn	FirstLineNumber:word
	extrn	LastLineNumber:word
	extrn	CurOwner:word
	extrn   CurProc:word
	extrn	CurScope:word
	extrn	InStmtPart:byte
	extrn	FileHandle:word
	extrn	ExeHandle:word
	extrn	DataStart:word
	extrn	DebugInfoSize:dword
	extrn	StackStart:word
	extrn   DataSegment:dword
	extrn   CompilerFlags:word
	extrn	UnitName:word
	extrn	StackSize:word
	extrn	MinHeapSize:word
	extrn	MaxHeapSize:word
	extrn	GlobalOptions:word
	extrn	SavedDepth:word
	extrn	SavedDepth2:word
	extrn	DefinesPtr:word
	extrn	TextPos:word
	extrn	SaveDefinesPtr:word
	extrn	UnitNameLen:word
	extrn	NextUnit:word
	extrn	PrevUnit:word
	extrn	InterfaceEnd:word
	extrn	CompilingSystem:byte
	extrn   SystemUnit:word
	extrn	CurrentToken:byte
	extrn	SlashToken:byte
	extrn	EqualToken:byte
	extrn	PrivateFlag:byte
	extrn	ProgramSection:byte
	extrn	DefUnitFlags:word
	extrn	IndexModifier:byte
	extrn	SymbolHash:byte
	extrn   CurrentSymbol:dword
	extrn	CurrentHash:word
	extrn	CurrentWith:word
	extrn	CurrentOwner:dword
	extrn	VarsSize:word
	extrn	LastTraceTable:word
	extrn	CodeSectStart:word
	extrn	ConstSectStart:word
	extrn	LastCodeFixup:word
	extrn	LastConstFixup:word
	extrn	DataSectStart:word
	extrn	ConstSectStart2:word
	extrn	Dictionary:dword
	extrn	ProcMap:dword
	extrn	CodeMap:dword
	extrn	ConstMap:dword
	extrn	DataMap:dword
	extrn	UnitList:dword
	extrn	SourceList:dword
	extrn	TraceTable:dword
	extrn	TempDict:dword
	extrn	CompiledCode:dword
	extrn	CompiledConst:dword
	extrn	CodeFixups:dword
	extrn	ConstFixups:dword
	extrn	StmtPart:dword
	extrn	FileNameBuf:byte
	extrn	ExeName:byte
	extrn	IdentBuf:byte
	extrn	SymbolValue:byte
	extrn	Directories:word
	extrn	TempBuffer:byte
	extrn	TpuList:byte
	extrn	DefinesBuf:byte
	extrn	FileStack:TFileStack
	extrn	CompMemPtr:word
	extrn	CompMemTop:word
	extrn	SourceBuffer:word
	extrn	ProgramSegment:word
	extrn	DebuggerPSP:word
	extrn	SourceCount:word
	extrn	Use8087:byte

	locals	@@

⌨️ 快捷键说明

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