请问我这个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)
请问那是对的吗?
请有人帮我保存并从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) 请问如何将这个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)
非常感谢