x86_64的ASM - 最大字节的指令? [英] x86_64 ASM - maximum bytes for an instruction?

查看:278
本文介绍了x86_64的ASM - 最大字节的指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是字节的最大数量的完整指令将需要64 ASM code?

What is the maximum number of bytes a complete instruction would require in x64 asm code?

喜欢的东西跳转到地址可能占用多达9个字节,我想: FF 00 00 00 00 11 12 3F 1F ,但我不知道这是个字节的最大数量的x64指令可以使用

Something like a jump to address might occupy up to 9 bytes I suppose: FF 00 00 00 00 11 12 3F 1F but I don't know if that's the maximum number of bytes a x64 instruction can use

推荐答案

x86指令集(16,32或64位,所有变体/模式)是保证适合15个字节。任何超出,这将使无效运算code。你不能做到这一点,而无需使用多余的prefixes(如多个0x66或0x67 preFIX,例如)。

x86 instruction set (16, 32 or 64 bit, all variants/modes) is guaranteed to fit in 15 bytes. Anything beyond that will give an "invalid opcode". You can't achieve that without using redundant prefixes (e.g. multiple 0x66 or 0x67 prefix, for example).

唯一的指令,实际上需要64位作为一个数据项是负载不变登记(英特尔语法: MOV寄存器,12345678ABCDEF00h ,AT& T公司的语法: MOV $ 12345678ABCDEF00,%寄存器) - 所以,如果你想向前跳超过31位/后退,这将是一个移动目标位置到寄存器中,然后调用/跳转到寄存器。这实际上节省了时间最长的一个,几乎所有指令四个字节。

The only instruction that actually takes 64-bits as a data item is the load constant to register (Intel syntax: mov reg, 12345678ABCDEF00h, at&t syntax: mov $12345678ABCDEF00, %reg) - so if you wanted to jump more than 31 bits forward/backward, it would be a move of the target location into a register, and then call/jump to the register. This fact saves four bytes on almost all instructions for the longest one.

这篇关于x86_64的ASM - 最大字节的指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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