[英]nasm equivalent to set instruction
Does anyone know if nasm has an equivalent to the "set" instruction I am accustomed to using it so set bits in eax based on the result of a cmp but nasm doesn't seem to recognize it just wondering if there is an alternative to using xor and shifts to figuring out the results of a cmp. 有谁知道nasm是否等效于我习惯使用的“ set”指令,因此根据cmp的结果在eax中设置位,但是nasm似乎不认识它,只是想知道是否有替代方法进行异或运算,然后求出cmp的结果。 I am trying to do something like the following 我正在尝试做以下事情
cmp eax,ecx
setl al
movzbl al,eax
Thanks in advance 提前致谢
This assembles just fine with NASM 2.10 from Mar 12 2012: 从2012年3月12日起,这与NASM 2.10配合得很好:
; file: set.asm
bits 16
cmp ecx, eax
setl al
movzx eax, al
I assemble it as nasm -f bin set.asm
. 我将其组装为nasm -f bin set.asm
。
EDIT : I have reversed the order of operands everywhere as it seems like you were writing your code with the AT&T syntax in mind (not applicable to NASM), where the operands are in the reverse order. 编辑 :我已经在所有地方都颠倒了操作数的顺序,因为好像您在编写代码时要牢记AT&T语法(不适用于NASM),其中操作数的顺序相反。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.