【发布时间】:2016-06-12 18:01:52
【问题描述】:
正如标题所说。 我这样做的方法:
; eax holds 32bit integer
sal rax, 32
sar rax, 32
;after operation int is converted (rax holds the same value on 64 bits)
有没有更优雅/更好/更快的方法来做到这一点?
【问题讨论】:
-
@PeterCodes 我认为您的答案是有效的答案。我想您可以将其升级为答案,然后可以接受。你会得到加分:)
-
完全同意。 @Peter Cordes,感谢您在过去几天提供的所有帮助。这一切都是无价的。你知识渊博。
-
@JoeyRoosing:我之前没有时间写一个完整的答案。我决定不将其发布为 2 行答案。我希望其他人可能会花时间将我的评论写成一个很好的答案,所以我不必这样做。
标签: assembly int type-conversion x86-64