Assembly ASM&x27;sall';单参数命令?
sall指令,格式为Assembly ASM&x27;sall';单参数命令?,assembly,Assembly,sall指令,格式为 sall Src,Dest 转换为Src向左移动Dest Dest=Dest<<Src 我假设它的移位-8(%ebp)向左移动,但移动多少?如以下所述: 指: Multiply r/m32 by 2, once. 您的汇编器似乎不需要,1,因为它很容易推断 我只是在这里做了一个快速测试,看看这个: .globl f f: sall -8(%ebp) sall $1, -8(%ebp) 组装和拆卸: $ otool -tV exam
sall Src,Dest
转换为Src向左移动Dest
Dest=Dest<<Src
我假设它的移位-8(%ebp)向左移动,但移动多少?如以下所述:
指:
Multiply r/m32 by 2, once.
您的汇编器似乎不需要,1
,因为它很容易推断
我只是在这里做了一个快速测试,看看这个:
.globl f
f:
sall -8(%ebp)
sall $1, -8(%ebp)
组装和拆卸:
$ otool -tV example.o
example.o:
(__TEXT,__text) section
f:
0000000000000000 shll -0x8(%ebp)
0000000000000004 shll -0x8(%ebp)
$ otool -t example.o
example.o:
(__TEXT,__text) section
0000000000000000 67 d1 65 f8 67 d1 65 f8
请注意,两个操作码的输出完全相同
.globl f
f:
sall -8(%ebp)
sall $1, -8(%ebp)
$ otool -tV example.o
example.o:
(__TEXT,__text) section
f:
0000000000000000 shll -0x8(%ebp)
0000000000000004 shll -0x8(%ebp)
$ otool -t example.o
example.o:
(__TEXT,__text) section
0000000000000000 67 d1 65 f8 67 d1 65 f8