"push %ds\n\t" ?
hi ~Error: operand type mismatch for `push'
linux系统,64位,为萨? 回复 1# _nosay
pushl
回复 2# Godbach
"pushl %eax\n\t":
Error: invalid instruction suffix for `push',
"pushw %ds\n\t":
Error: operand type mismatch for `push' 回复 3# _nosay
"pushl %%eax\n\t"
回复 4# Godbach
Error: bad register name `%%eax' 回复 4# Godbach
__asm__(
"mov %ax, %ds\n\t" ; 16位通用寄存器→ds,可以
"mov %es:100, %ds\n\t" ; 内存→ds,可以
"push %ds\n\t" ; 栈→ds,报错
); 换成gs和fs是好用的 :lol > echo 'asm("push %cs");' | gcc -xc - -m32
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
> echo 'asm("push %cs");' | gcc -xc - -m64
/tmp/cclHKf4W.s: Assembler messages:
/tmp/cclHKf4W.s:3: Error: suffix or operands invalid for `push 本帖最后由 _nosay 于 2016-06-13 13:26 编辑
回复 9# nswcfd
:em09:
页:
[1]
2