_nosay 发表于 2016-06-12 21:44

"push %ds\n\t" ?

hi ~
Error: operand type mismatch for `push'

linux系统,64位,为萨?

Godbach 发表于 2016-06-12 21:51

回复 1# _nosay

pushl


   

_nosay 发表于 2016-06-12 21:56

回复 2# Godbach

"pushl %eax\n\t":
Error: invalid instruction suffix for `push',

"pushw %ds\n\t":
Error: operand type mismatch for `push'

Godbach 发表于 2016-06-12 22:02

回复 3# _nosay


"pushl %%eax\n\t"

   

_nosay 发表于 2016-06-12 22:04

回复 4# Godbach

Error: bad register name `%%eax'

_nosay 发表于 2016-06-12 22:12

回复 4# Godbach

__asm__(
      "mov %ax, %ds\n\t"         ; 16位通用寄存器→ds,可以
      "mov %es:100, %ds\n\t"   ; 内存→ds,可以
      "push %ds\n\t"               ; 栈→ds,报错
);

nswcfd 发表于 2016-06-13 11:53

换成gs和fs是好用的 :lol

nswcfd 发表于 2016-06-13 12:04

> 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

nswcfd 发表于 2016-06-13 12:09

_nosay 发表于 2016-06-13 13:06

本帖最后由 _nosay 于 2016-06-13 13:26 编辑

回复 9# nswcfd

:em09:
页: [1] 2
查看完整版本: "push %ds\n\t" ?