Nasm 装配关系运算符

发布于 2024-10-08 00:20:28 字数 83 浏览 0 评论 0原文

我想要像 1==1 这样的关系表达式,如果 true 则给出 1,如果 false 则给出 0。在 nasm 汇编中是否有一种简单的方法可以做到这一点?

I would like relational expressions like 1==1 to give 1 if true and 0 if false. Is there a simple way to do this in nasm assembly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

黑寡妇 2024-10-15 00:20:29

如果您参考 x86 指令集,那么您可能需要 SETcc 指令集: http://faydoc .tripod.com/cpu/setnz.htm

If you are reffering to x86 instruction set, then you probably need SETcc set of instructions: http://faydoc.tripod.com/cpu/setnz.htm

云仙小弟 2024-10-15 00:20:28

此处列出了 NASM 提供的算术运算符,按优先级升序排列:|、^、&、<<和>>、+ 和−、*、/、//、% 和%%、+、−、~、!和赛格。
所以NASM中没有==运算符。
您可以使用 CMP 指令比较两个操作数。

The arithmetic operators provided by NASM are listed here, in increasing order of precedence: |, ^, &, << and >>, + and −, *, /, //, % and %%,+, −, ~, ! and SEG.
So there is no == operator in NASM.
You can compare two operands by using CMP instruction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文