小编yhc*_*boy的帖子

基指针和堆栈指针

鉴于这段代码:

       swap:

            push ebp ; back up the base pointer,
            mov ebp, esp
            ; push the context of the registers on the stack

            push eax
            push ebx
            push ecx
            push edx

            mov eax, [ebp+8] ; address of the first parameter
            mov ebx, [ebp+12] ; address of the second parameter
            mov dl, [eax]
            mov cl, [ebx]

            mov [eax], cl

            mov [ebx], dl

            ; restore the context of the registers from the stack

            pop edx
            pop ecx  
            pop ebx
            pop eax
            ; …
Run Code Online (Sandbox Code Playgroud)

x86 assembly nasm stack-pointer

34
推荐指数
2
解决办法
2万
查看次数

使用运行时已知的类型创建委托

如何创建仅在运行时已知类型的委托?

我想做以下事情:

Type type1 = someObject.getType();
Type type2 = someOtherObject.getType();   

var getter = (Func<type1, type2>)Delegate.CreateDelegate(
    typeof(Func<,>).MakeGenericType(type1, type2), someMethodInfo);
Run Code Online (Sandbox Code Playgroud)

我怎样才能达到类似的效果?

.net c# delegates

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

标签 统计

.net ×1

assembly ×1

c# ×1

delegates ×1

nasm ×1

stack-pointer ×1

x86 ×1