小编Dmi*_*try的帖子

汇编程序打包数据

我需要写一个用于在最小单元格内存中写入3个字母单词的置信码来说明这个图片,它说明了我需要的东西:

在此输入图像描述

我开始编写代码了:

    mov eax, dword ptr str[0]
    bsr cl, eax
    inc cl
    shl eax, cl
    push eax
    //
    mov eax, dword ptr str[1]
    pop ebx
    or eax, ebx
    push eax // unshifted
    //
    mov eax, dword ptr str[2]
    bsr cl, eax
    inc cl
    pop ebx
    shl ebx, cl
    or eax, ebx
    mov result, ebx
Run Code Online (Sandbox Code Playgroud)

但我得到-934608896(否定后
为00110111101101010000000000000000 )而不是1304526(0100111110011111001110)

x86 assembly inline-assembly

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

标签 统计

assembly ×1

inline-assembly ×1

x86 ×1