📄 pcode.h
字号:
/****************************************************************************
*
* Open Watcom Project
*
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
*
* This file contains Original Code and/or Modifications of Original
* Code as defined in and that are subject to the Sybase Open Watcom
* Public License version 1.0 (the 'License'). You may not use this file
* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
* provided with the Original Code and Modifications, and is also
* available at www.sybase.com/developer/opensource.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
* NON-INFRINGEMENT. Please see the License for the specific language
* governing rights and limitations under the License.
*
* ========================================================================
*
* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
* DESCRIBE IT HERE!
*
****************************************************************************/
/*
;
; P-Code Interpreter
;
; Layout of stack frame upon entry to a function
;
; ParmN
; .
; .
; .
; Parm 2 8[BP]
; Parm 1 6[BP]
; CS of ret address
; IP of ret address
; CS from far call, saved BP <------ BP points here
; IP from far call, PARM_AX
; PARM_BX
; PARM_CX
; PARM_DX
; saved ES
; saved DS
; saved DI
; saved SI
; saved CX
; saved BX
; saved DX
; icall_seg
; icall_off
; locals 10[DI][BP]
; locals 8[DI][BP]
; locals CX 6[DI][BP]
; locals BX 4[DI][BP]
; locals DX 2[DI][BP]
; locals AX 0[DI][BP]
;
*/
#if defined(_DEBUG_)
#define pcode(p,n) #p
static char *P_Codes[] = {
#elif defined(_PARMS_)
#define pcode(p,n) n
static unsigned char P_Parms[] = {
#else
#define pcode(p,n) p
enum pcodes {
#endif
pcode(PushIP6,0) // push integer parm at offset 6 from BP
, pcode(PushIP8,0) // ... 8
, pcode(PushIP10,0) // ... 10
, pcode(PushIP12,0) // ... 12
, pcode(PushIP14,0) // ... 14
, pcode(PushIP16,0) // ... 16
, pcode(PushIP18,0) // ... 18
, pcode(PushIP20,0) // ... 20
, pcode(PushIPn,1) // ... n
, pcode(PushLP6,0) // push long parm at offset 6 from BP
, pcode(PushLP8,0) // ... 8
, pcode(PushLP10,0) // ... 10
, pcode(PushLP12,0) // ... 12
, pcode(PushLP14,0) // ... 14
, pcode(PushLP16,0) // ... 16
, pcode(PushLP18,0) // ... 18
, pcode(PushLP20,0) // ... 20
, pcode(PushLPn,1) // ... n
, pcode(PushIA0,0) // push integer auto at offset 0 from [BP][DI]
, pcode(PushIA2,0) // ... 2
, pcode(PushIA4,0) // ... 4
, pcode(PushIA6,0) // ... 6
, pcode(PushIA8,0) // ... 8
, pcode(PushIA10,0) // ... 10
, pcode(PushIA12,0) // ... 12
, pcode(PushIA14,0) // ... 14
, pcode(PushIA16,0) // ... 16
, pcode(PushIA18,0) // ... 18
, pcode(PushIA20,0) // ... 20
, pcode(PushIAn,1) // ... n
, pcode(PushIAnn,2) // ... 2 byte offset nn
, pcode(PushLA0,0) // push long auto at offset 0 from [BP][DI]
, pcode(PushLA2,0) // ... 2
, pcode(PushLA4,0) // ... 4
, pcode(PushLA6,0) // ... 6
, pcode(PushLA8,0) // ... 8
, pcode(PushLA10,0) // ... 10
, pcode(PushLA12,0) // ... 12
, pcode(PushLA14,0) // ... 14
, pcode(PushLA16,0) // ... 16
, pcode(PushLA18,0) // ... 18
, pcode(PushLA20,0) // ... 20
, pcode(PushLAn,1) // ... n
, pcode(PopIA0,0) // pop integer auto at offset 0 from [BP][DI]
, pcode(PopIA2,0) // ... 2
, pcode(PopIA4,0) // ... 4
, pcode(PopIA6,0) // ... 6
, pcode(PopIA8,0) // ... 8
, pcode(PopIA10,0) // ... 10
, pcode(PopIA12,0) // ... 12
, pcode(PopIA14,0) // ... 14
, pcode(PopIA16,0) // ... 16
, pcode(PopIA18,0) // ... 18
, pcode(PopIA20,0) // ... 20
, pcode(PopIAn,1) // ... n
, pcode(PopIAnn,2) // ... 2 byte offset nn
, pcode(PopLA0,0) // pop long auto at offset 0 from [BP][DI]
, pcode(PopLA2,0) // ... 2
, pcode(PopLA4,0) // ... 4
, pcode(PopLA6,0) // ... 6
, pcode(PopLA8,0) // ... 8
, pcode(PopLA10,0) // ... 10
, pcode(PopLA12,0) // ... 12
, pcode(PopLA14,0) // ... 14
, pcode(PopLA16,0) // ... 16
, pcode(PopLA18,0) // ... 18
, pcode(PopLA20,0) // ... 20
, pcode(PopLAn,1) // ... n
, pcode(PopIP6,0) // pop integer parm at offset 6 from [BP]
, pcode(PopIP8,0) // ... 8
, pcode(PopIP10,0) // ... 10
, pcode(PopIP12,0) // ... 12
, pcode(PopIP14,0) // ... 14
, pcode(PopIP16,0) // ... 16
, pcode(PopIP18,0) // ... 18
, pcode(PopIP20,0) // ... 20
, pcode(PopIPn,1) // ... n
, pcode(PopLP6,0) // pop long parm at offset 6 from [BP]
, pcode(PopLP8,0) // ... 8
, pcode(PopLP10,0) // ... 10
, pcode(PopLP12,0) // ... 12
, pcode(PopLP14,0) // ... 14
, pcode(PopLP16,0) // ... 16
, pcode(PopLP18,0) // ... 18
, pcode(PopLP20,0) // ... 20
, pcode(PopLPn,1) // ... n
, pcode(IPushChar,0) // push signed char pointed at by addr on stack
, pcode(IPushUChar,0) // push unsigned char pointed at by addr on stack
, pcode(IPushInt,0) // push integer pointed at by addr on stack
, pcode(IPushLong,0) // push long pointed at by addr on stack
, pcode(IPushDouble,0) // push double pointed at by addr on stack
, pcode(IPushStruct,2) // push struct
, pcode(IPushBitField,2)// push value of bit field
, pcode(Push0Const,0) // push integer 0
, pcode(Push0LConst,0) // push long integer 0
, pcode(Push1Const,0) // push integer 1
, pcode(Push1LConst,0) // push long integer 1
, pcode(PushBConst,1) // push one byte constant
, pcode(PushWConst,2) // push two byte constant
, pcode(PushLConst,4) // push four byte constant
, pcode(PushParmAddr,1) // push address of parm
, pcode(PushTempAddr,1) // push address of local variable
, pcode(PushGblAddr,4) // push address of global variable
, pcode(DupAddr,0) // duplicate address on stack
, pcode(IPopChar,0) // pop char into addr on stack
, pcode(IPopInt,0) // pop integer into addr on stack
, pcode(IPopLong,0) // pop long into addr on stack
, pcode(IPopDouble,0) // pop double into addr on stack
, pcode(ICopyStruct,2) // copy struct
, pcode(IPopBitField,2) // pop value into bit field
, pcode(AddBOffset,1) // add byte offset to address
, pcode(AddWOffset,2) // add word offset to address
, pcode(PtrSubtract,0) // subtract two pointers
, pcode(HugePtrAdd,0) // add long to huge pointer
, pcode(HugePtrSub,0) // subtract two huge pointers
, pcode(SignExtend,0) // sign extend integer to a long
, pcode(ZeroExtend,0) // zero extend integer to an unsigned long
, pcode(Long2Int,0) // convert long to integer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -