x86 Assembly pushl/popl don't work with “Error: suffix or operands invalid”

后端 未结 5 726
逝去的感伤
逝去的感伤 2020-11-29 01:45

I\'m a newbie to assembly programming, working through Programming Ground Up on an Ubuntu x86_64 desktop with GNU assembler v2.20.1.

I\'ve been able to assemble/link

5条回答
  •  萌比男神i
    2020-11-29 02:42

    I recently started following these examples too, I found the following worked:

    1. Add .code32 to the top of your assembly code
    2. Assemble with the --32 flag
    3. Link with the -m elf_i386 flag

    You can see my example here

提交回复
热议问题