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

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

问题描述

我正在使用NASM 本教程(第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: instruction not supported in 64-bit mode进行编译时,代码出错,请参阅上面的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天全站免登陆