Delphi1.0でHugeポインタを使う
|
Delphi1.0用のHugeポインタルーチンです。
もう過去の遺物かな?
function HpSubOne( pointer:Pointer ):Pointer;
inline(
$58/ { POP AX }
$5A/ { POP DX }
$2d/$01/$00/ { SUB AX,1 }
$73/$03/ { JNB @@ }
$83/$EA/$08 { SUB DX,8 }
); {@@: }
function HpAddOne( pointer:Pointer ):Pointer;
inline(
$58/ { POP AX }
$5A/ { POP DX }
$40/ { INC AX }
$75/$03/ { JNZ @@ }
$83/$C2/$08 { ADD DX,8 }
); {@@: }
function HpAddWord( pointer:Pointer ; offset:Word ):Pointer;
inline(
$59/ { POP CX }
$58/ { POP AX }
$5A/ { POP DX }
$01/$c8/ { ADD AX,CX }
$73/$03/ { JNC @@ }
$83/$C2/$08 { ADD DX,8 }
); {@@: }
function HpSubWord( pointer:Pointer ; offset:Word ):Pointer;
inline(
$59/ { POP CX }
$58/ { POP AX }
$5A/ { POP DX }
$29/$c8/ { SUB AX,CX }
$73/$03/ { JNB @@ }
$83/$EA/$08 { SUB DX,8 }
); {@@: }
function HpAddLong( pointer:Pointer ; offset:LongInt ):Pointer;
inline(
$59/ { POP CX }
$5B/ { POP BX }
$58/ { POP AX }
$5A/ { POP DX }
$01/$c8/ { ADD AX,CX }
$83/$D3/$00/{ ADC BX,0 }
$B1/$03/ { MOV CL,3 }
$D3/$E3/ { SHL BX,CL }
$01/$DA { ADD DX,BX }
);
function HpSubLong( pointer:Pointer ; offset:LongInt ):Pointer;
inline(
$59/ { POP CX }
$5B/ { POP BX }
$58/ { POP AX }
$5A/ { POP DX }
$29/$c8/ { SUB AX,CX }
$83/$D3/$00/{ ADC BX,0 }
$B1/$03/ { MOV CL,3 }
$D3/$E3/ { SHL BX,CL }
$29/$DA { SUB DX,BX }
);
|
|