在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程序集。 –