在x86汇编操作数大小冲突? [英] Operand size conflict in x86 Assembly?
问题描述
我是谁试图首次装配一个新手程序员。对不起提前如果这是一个令人难以置信的跛脚的问题。
I'm a novice programmer who is attempting assembly for the first time. Sorry in advance if this is an incredibly lame question.
我保存在EAX寄存器一个人物,但我需要将其移动到我的DL寄存器。当我尝试:MOV DL,EAX我得到一个错误C2443:操作数大小冲突。我知道EAX寄存器是32位,而DL是8位...我是对的东西?我该如何去解决这一点。
I have a character stored in the EAX register, but I need to move it to my DL register. When I try: mov dl, eax I get an error C2443: operand size conflict. I know that the eax register is 32 bit while the dl is 8 bit... am I on to something?? How do I go about solving this.
推荐答案
你想要的可能是:
movzx edx, al
这将复制A1至DL和零填充EDX的其余部分。这单指令相当于这两个指令:
This will copy al to dl and zero fill the rest of edx. This single instruction is equivalent these two instructions:
xor edx, edx
mov dl, al
这篇关于在x86汇编操作数大小冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!