使用 NASM 的 64 位模式不支持 pop 指令? [英] pop Instruction not supported in 64-bit mode using NASM?

查看:54
本文介绍了使用 NASM 的 64 位模式不支持 pop 指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 NASM 开发更深入的 hello world 以下本教程(第 4 节).本教程主要教您如何处理命令行输入.
这是有问题的代码片段:

I'm working on a more indepth hello world using NASM following this tutorial (section 4). This tutorial essentially teaches you how to handle command line input.
This is the snippet of the code in question:

section .text
        global _start

_start:
        pop     ebx     ; arg count
        pop     ebx     ; arg[0] the program name
        pop     ebx     ; arg[1-n] the remainder of the args
                        ; must each be indiviually popped

代码在编译过程中出错,error:指令在64位模式下不支持,参考上面的3条pop指令.查看文档后 似乎此代码仅适用于 32 位系统.

The code errors out during compilation with error: instruction not supported in 64-bit mode referring to the 3 pop instructions above. Upon viewing the docs it seems that this code only works for 32-bit systems.

是否有 64 位 pop 指令?有没有人有使用 pop 的 64 位教程,我可以看看?

Is there a 64-bit pop instruction? Does anyone have a 64 bit tutorial using pop that I can look at?

推荐答案

是的,64 位 pop 指令是... POP.:-) 不过你需要对 64 位寄存器使用它(比如 rbx).

Yes, the 64-bit pop instruction is... POP. :-) You need to use it against 64-bit registers though (like rbx).

这篇关于使用 NASM 的 64 位模式不支持 pop 指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆