Delphi Tips 
-----------------------------

0025  D1   D2   D3   D4   D5   D6   D7   3.1   95   98    作成: 1999/02/08 osamu rev 1.1
   B1   B3   B4   B5   B6   B7   NT3   NT4   2K   XP  更新: 1999/02/08 osamu 編集
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   }
);

参照: [Delphi-ML:13257] <メモリ>

[新規作成] [最新の情報に更新]

How To
Lounge
KeyWords


Tips
Delphi
Home
Osamu Takeuchi osamu@big.or.jp