在x86汇编语言中,是否有任何有效的方法将字节转换为二进制数字字符串(表示为0和1的字节数组)?据我所知,x86汇编中没有任何'toString'函数,就像大多数高级编程语言一样。将字节转换为x86汇编语言的字符串
.stack 2048
.data
theString byte 0, 0, 0, 0, 0, 0, 0, 0 ;store eax as a binary string here.
ExitProcess proto, exitcode:dword
.code
start:
mov eax, 3;
;now I need to convert eax to a binary string somehow (i. e., a byte array of 0s and 1s)
invoke ExitProcess, 0
end start
至少它能够获得从寄存器的第一位x86汇编语言:http://stackoverflow.com/questions/15238467/get-the-first -eax-register-in-x86-assembly-language –
如果你的意思是转换eg值13到字符串“1101”,然后看到我的答案http://stackoverflow.com/questions/15786970/mips-decimal-to-binary-conversion-code-is-working-but-result-must-be- revers-ho/15787423#它可以在x86环境和'SHL' /'JC'组合上相当高效地完成。 – Michael
@Michael该问题讨论了MIPS程序集而不是x86程序集。 –