Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly 左移将如何工作_Assembly_X86_Intel - Fatal编程技术网

Assembly 左移将如何工作

Assembly 左移将如何工作,assembly,x86,intel,Assembly,X86,Intel,我的问题是,除了左移位计数值中的1之外,任何其他值都给出了无效的指令操作数。在8086中,可变位数的位移位是通过shl reg,cl 允许从80286开始使用Imm8换档。有关最多80486的允许寻址模式,请参阅 假设您打算使用80386+,您很可能应该向汇编程序提供一个处理器指令;例如在标题中放置.386 :CPU 80386 :.386 .model small .stack 100h .data .code main proc mov ax,2 shl ax,1 shl ax,2

我的问题是,除了左移位计数值中的1之外,任何其他值都给出了无效的指令操作数。在8086中,可变位数的位移位是通过
shl reg,cl

允许从80286开始使用Imm8换档。有关最多80486的允许寻址模式,请参阅

假设您打算使用80386+,您很可能应该向汇编程序提供一个处理器指令;例如在标题中放置
.386

CPU 80386

.386

.model small
.stack 100h
.data
.code

main proc 

mov ax,2
shl ax,1
shl ax,2

int 21h

mov ah,4ch
int 21h

main endp 
end main