小编Rya*_*lor的帖子

使用__asm不正确的操作数类型错误

不正确的操作数类型是什么意思?

我正在尝试将一些c ++代码转换为汇编程序

     temp_char = OChar[i]         //temp_char is a character and OChar is array and i is the index
Run Code Online (Sandbox Code Playgroud)

我试过了

     mov eax, i
     mov temp_char, [eax+OChar]
Run Code Online (Sandbox Code Playgroud)

并且

     mov eax, i
     movsx temp_char, [eax+OChar]
Run Code Online (Sandbox Code Playgroud)

任何人都可以解释我如何避免不正确的操作数类型?

这是完整的代码

                  char temp_char;                       
                   int i;

   __asm{       

            mov i,0
            jmp checkend

     startfor:      mov eax,i   
            add eax,1
            mov i,eax



   checkend:        cmp i,length    
            jge endloop     
            movsx   temp_char, [eax+OChars] 

            //encryption of string//
            push eax                
            and eax,0xAA            
            not al                  
            mov edx,eax             
            pop eax                 
            and eax,0x55            

            xor ecx,edx             
            xor ecx,eax             
            rol cl,2 …
Run Code Online (Sandbox Code Playgroud)

c++ assembly

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

标签 统计

assembly ×1

c++ ×1