小编Ale*_*xis的帖子

将GCC内联汇编程序转换为delphi内联汇编程序

请问我这个GCC内联汇编程序代码

int   src = 0;
dword n;
__asm(
            "sar %%cl,%%edx"
            : "=d" (n) // saves in eax,edx
            : "c" (src), "d" (n) // the inputs
            );
Run Code Online (Sandbox Code Playgroud)

我的delphi尝试是:

asm
mov ecx, &src
mov edx, &n
sar cl,edx
mov eax,edx
end;
Run Code Online (Sandbox Code Playgroud)

请问那是对的吗?

delphi gcc

7
推荐指数
1
解决办法
522
查看次数

delphi保存并加载动态数组

请有人帮我保存并从Stream加载其动态数组

const
      iGlobHolderCount = 100;

    type
      TFiLeSpec = record
        iSize: Integer;
      end;

      TFileSpecLst = array of TFiLeSpec;

      TFiLeSpecList = record
        iMin: Integer;
        iMax: Integer;
        iCount: Integer;
        FileSpecLst: TFileSpecLst;
      end;


var
FFileSpec: array of TFiLeSpec;

FFileSpecList: array [1 .. iGlobHolderCount] of TFiLeSpecList;
Run Code Online (Sandbox Code Playgroud)

arrays delphi

3
推荐指数
2
解决办法
7818
查看次数

将C++内联汇编程序函数转换为delphi内联汇编程序函数

请问如何将这个C++函数转换为Delphi:

int To_Asm_Fnc(dword Amem, dword Al, dword Ac) {
int b = 0;
    asm ("push %%ecx; \
             call %%eax; \
             pop  %%ecx;"
         : "=Al" (b) /* output value */
         : "Al" (mem), "Ac" (Al), "d" (Ac) /* input value */
         );
    return b;
}
Run Code Online (Sandbox Code Playgroud)

这是我的德尔福尝试

Function To_Asm_Fnc(Amem,Al,Ac:dword):Integer;
var
b:Integer;
begin
Result:=0;
b:=0;
//*******
{ i really didn't get it as in the c++ code }
//*******
Result:=b;
end;
Run Code Online (Sandbox Code Playgroud)

非常感谢

c c++ delphi assembly

-3
推荐指数
1
解决办法
564
查看次数

标签 统计

delphi ×3

arrays ×1

assembly ×1

c ×1

c++ ×1

gcc ×1