?? exaid.asm
字號:
page 49,132
TITLE exAId - Array Id Executors
;***
;exaid.asm - executors for simple id references.
;
; Copyright <C> 1986, Microsoft Corporation
;
;Purpose:
; This module contains all exAId executors and all exAVtRf executors.
;
; In general, these executors are very speed critical.
;
;
;****************************************************************************
.xlist
include version.inc
IncludeOnce architec
IncludeOnce array
IncludeOnce context
IncludeOnce executor
IncludeOnce exint
IncludeOnce extort
IncludeOnce opid
IncludeOnce pcode
IncludeOnce qbimsgs
IncludeOnce rtinterp
IncludeOnce variable
.list
assumes cs, CODE
assumes es, NOTHING
assumes ss, DATA
sBegin CODE
subttl I2 Load Executors
page
;Indirect
MakeExe exAIdIILd2,opAIdLd,ET_Imp
SkipExHeader
MakeExe exAIdEILdI2,opAIdLd,ET_I2
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
GetpFrame
mov bx,[pFrame] ;ds:bx = pointer to array descriptor
cmp cl,[bx].AD_cDims ;Correct number of indices?
jz ALdI2
jmp IndexCountErr
;Common
MakeExe exAIdECLdI2,opAIdLd,ET_I2
SkipExHeader
MakeExe exAIdICLd2,opAIdLd,ET_Imp
LODSWTX ;Load argument count
xchg ax,cx
LODSWTX ;Get oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov dx,[pVarBx].ACOM_oValue ;Offset into common block
test byte ptr [pVarBx-VAR_value].VAR_fStat,FV_STATIC
;Is the array $STATIC?
mov bx,[pVarBx].ACOM_oCommon ;oCommon
jz @F
add bx,COM_bdType - COM_bdValue ;Adjust to point to type table
@@:
add bx,[grs.GRS_bdtComBlk.BD_pb] ;pCommon
mov bx,[bx].COM_bdValue.BD_pb ;Common block
add bx,dx ;Offset in block
jmp short ALdI2
;Frame
MakeExe exAIdIFLd2,opAIdLd,ET_Imp
SkipExHeader
MakeExe exAIdEFLdI2,opAIdLd,ET_I2
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov bx,[pVarBx+AFRAME_oFrame]
add bx,bp ;ss:bx = pointer to array descriptor
jmp short ALdI2
;Public
;Static
MakeExe exAIdESLdI2,opAIdLd,ET_I2
SkipExHeader
MakeExe exAIdISLd2,opAIdLd,ET_Imp
LODSWTX ;Load argument count
xchg ax,cx
LODSWTX ;Load operand
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
ALdI2S:
lea bx,[pVarBx].ASTAT_ad ;ds:bx = array descriptor address
ALdI2:
call ResolveArray ;resolve to segment and offset in dx:bx
GETSEG ds,dx,di,<SPEED,LOAD> ; Move to array element segment
push [bx] ;Push the I2
mov ax,ss
mov ds,ax ;Restore the data segment
DispMac
;Optimized I2 load/store executors for 1 index
;Frame load
MakeExe exA1IdIFLdI2,opAIdLd,ET_Imp
SkipExHeader
MakeExe exA1IdEFLdI2,opAIdLd,ET_I2
inc si
inc si ;Skip cDims
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov bx,[pVarBx+AFRAME_oFrame]
add bx,bp ;bx = pointer to array descriptor
mov dx,ds ;Save psVariableTable
jmp short A1LdI2
;Static load
MakeExe exA1IdESLdI2,opAIdLd,ET_I2
SkipExHeader
MakeExe exA1IdISLdI2,opAIdLd,ET_Imp
inc si
inc si ;Skip count ot indices
LODSWTX ;Load operand
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
lea bx,[pVarBx].ASTAT_ad ;ds:bx = array descriptor address
mov dx,ds ;Save psVariableTable
A1LdI2:
mov cx,[bx].AD_fhd.FHD_hData
jcxz RangeErr ; Brif array not allocated
pop ax ;Get index
sub ax,[bx].AD_tDM.DM_iLbound ;Subtract lower bound
jl RangeErr
cmp ax,[bx].AD_tDM.DM_cElements ;Test for range
jge RangeErr
shl ax,1
add ax,[bx].AD_fhd.FHD_oData ;Add base offset
GETSEG ds,cx,bx,<SPEED,LOAD> ; Move to array element segment
xchg bx,ax
push [bx] ;Push the I2
mov ds,dx ;Restore module var table
DispMac
IndexCountErr:
RangeErr:
mov al,ER_SOR ;Subscript out of range
call RtErrorCODE ;generate error, don't return
;Frame store
MakeExe exA1IdIFStI2,opAIdSt,ET_Imp
SkipExHeader
MakeExe exA1IdEFStI2,opAIdSt,ET_I2
inc si
inc si ;Skip count ot indices
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov bx,[pVarBx+AFRAME_oFrame]
add bx,bp ;bx = pointer to array descriptor
mov dx,ds ;Save psVariableTable
jmp short A1StI2
;Static store
MakeExe exA1IdESStI2,opAIdSt,ET_I2
SkipExHeader
MakeExe exA1IdISStI2,opAIdSt,ET_Imp
inc si
inc si ;Skip count ot indices
LODSWTX ;Load operand
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
lea bx,[pVarBx].ASTAT_ad ;ds:bx = array descriptor address
mov dx,ds ;Save psVariableTable
A1StI2:
mov cx,[bx].AD_fhd.FHD_hData
jcxz RangeErr ; Brif array not allocated
pop ax ;Get index
sub ax,[bx].AD_tDM.DM_iLbound ;Subtract lower bound
jl RangeErr
cmp ax,[bx].AD_tDM.DM_cElements ;Test for range
jge RangeErr
shl ax,1
add ax,[bx].AD_fhd.FHD_oData ;Add base offset
GETSEG ds,cx,bx,<SPEED,LOAD> ; Move to array element segment
xchg bx,ax
pop [bx] ;Store the I2
mov ds,dx ;Restore module var table
DispMac ; and dispatch next executor
subttl I2 Store Executors
page
;Common
MakeExe exAIdICSt2,opAIdSt,ET_Imp
SkipExHeader
MakeExe exAIdECStI2,opAIdSt,ET_I2
LODSWTX ;Load argument count
xchg ax,cx
LODSWTX ;Get oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov dx,[pVarBx].ACOM_oValue ;Offset into common block
test byte ptr [pVarBx-VAR_value].VAR_fStat,FV_STATIC
;Is the array $STATIC?
mov bx,[pVarBx].ACOM_oCommon ;oCommon
jz @F
add bx,COM_bdType - COM_bdValue ;Adjust to point to type table
@@:
add bx,[grs.GRS_bdtComBlk.BD_pb] ;pCommon
mov bx,[bx].COM_bdValue.BD_pb ;Common block
add bx,dx ;Offset in block
jmp short AStI2
;Indirect
MakeExe exAIdIISt2,opAIdSt,ET_Imp
SkipExHeader
MakeExe exAIdEIStI2,opAIdSt,ET_I2
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
GetpFrame
mov bx,[pFrame] ;bx = pointer to array descriptor
cmp cl,[bx].AD_cDims ;Correct number of indices?
jz AStI2
jmp IndexCountErr
;Frame
MakeExe exAIdEFStI2,opAIdSt,ET_I2
SkipExHeader
MakeExe exAIdIFSt2,opAIdSt,ET_Imp
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov bx,[pVarBx+AFRAME_oFrame]
add bx,bp ;bx = pointer to array descriptor
jmp short AStI2
;Public
;Static
MakeExe exAIdESStI2,opAIdSt,ET_I2
SkipExHeader
MakeExe exAIdISSt2,opAIdSt,ET_Imp
LODSWTX ;Load argument count
xchg ax,cx
LODSWTX ;Load operand
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
AStI2S:
lea bx,[pVarBx].ASTAT_ad ; ds:bx = array descriptor address
AStI2:
call ResolveArray ;resolve to segment and offset in dx:bx
GETSEG ds,dx,di,<SPEED,LOAD> ; Move to array element segment
pop [bx] ;Pop the I2 to the variable value
mov ax,ss
mov ds,ax ;Restore the data segment
DispMac
subttl I4 Load Executors
page
;Indirect
MakeExe exAIdEILdI4,opAIdLd,ET_I4
SkipExHeader
MakeExe exAIdIILd4,opAIdLd,ET_Imp
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
GetpFrame
mov bx,[pFrame] ;bx = pointer to array descriptor
cmp cl,[bx].AD_cDims ;Correct number of indices?
jz ALd4
jmp IndexCountErr
;Common
MakeExe exAIdECLdI4,opAIdLd,ET_I4
SkipExHeader
MakeExe exAIdICLd4,opAIdLd,ET_Imp
LODSWTX ;Load argument count
xchg ax,cx
LODSWTX ;Get oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov dx,[pVarBx].ACOM_oValue ;Offset into common block
test byte ptr [pVarBx-VAR_value].VAR_fStat,FV_STATIC
;Is the array $STATIC?
mov bx,[pVarBx].ACOM_oCommon ;oCommon
jz @F
add bx,COM_bdType - COM_bdValue ;Adjust to point to type table
@@:
add bx,[grs.GRS_bdtComBlk.BD_pb] ;pCommon
mov bx,[bx].COM_bdValue.BD_pb ;Common block
add bx,dx ;Offset in block
jmp short ALd4
;Frame
MakeExe exAIdEFLdI4,opAIdLd,ET_I4
SkipExHeader
MakeExe exAIdIFLd4,opAIdLd,ET_Imp
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov bx,[pVarBx+AFRAME_oFrame]
add bx,bp ;bx = pointer to array descriptor
jmp short ALd4
;Public
;Static
MakeExe exAIdESLdI4,opAIdLd,ET_I4
SkipExHeader
MakeExe exAIdISLd4,opAIdLd,ET_Imp
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;Operand
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
ALd4S:
lea bx,[pVarBx].ASTAT_ad ; ds:bx = array descriptor address
ALd4:
call ResolveArray ;resolve to segment and offset in dx:bx
GETSEG ds,dx,di,<SPEED,LOAD> ; Move to array element segment
SLoad4X:
push [bx+2] ;Push second word
push [bx] ;Push first word
mov ax,ss
mov ds,ax ;Restore the data segment
DispMac
;Added with [15]
subttl R4 Load Executors
page
;Indirect
MakeExe exAIdEILdR4,opAIdLd,ET_R4
SkipExHeader
MakeExe exAIdIILdR4,opAIdLd,ET_Imp
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
GetpFrame
mov bx,[pFrame] ;bx = pointer to array descriptor
cmp cl,[bx].AD_cDims ;Correct number of indices?
jz ALdR4
jmp IndexCountErr
;Common
MakeExe exAIdECLdR4,opAIdLd,ET_R4
SkipExHeader
MakeExe exAIdICLdR4,opAIdLd,ET_Imp
LODSWTX ;Load argument count
xchg ax,cx
LODSWTX ;Get oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov dx,[pVarBx].ACOM_oValue ;Offset into common block
test byte ptr [pVarBx-VAR_value].VAR_fStat,FV_STATIC
;Is the array $STATIC?
mov bx,[pVarBx].ACOM_oCommon ;oCommon
jz @F
add bx,COM_bdType - COM_bdValue ;Adjust to point to type table
@@:
add bx,[grs.GRS_bdtComBlk.BD_pb] ;pCommon
mov bx,[bx].COM_bdValue.BD_pb ;Common block
add bx,dx ;Offset in block
jmp short ALdR4
;Frame
MakeExe exAIdEFLdR4,opAIdLd,ET_R4
SkipExHeader
MakeExe exAIdIFLdR4,opAIdLd,ET_Imp
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;oVar
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
mov bx,[pVarBx+AFRAME_oFrame]
add bx,bp ;bx = pointer to array descriptor
jmp short ALdR4
;Public
;Static
MakeExe exAIdESLdR4,opAIdLd,ET_R4
SkipExHeader
MakeExe exAIdISLdR4,opAIdLd,ET_Imp
LODSWTX ;Index argument count
xchg ax,cx
LODSWTX ;Operand
xchg ax,bx ; BX = oVar
DbChk oVar,bx ; Check for valid oVar
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -