我正在嘗試將過程encrypt_chars轉換爲彙編程序。我在for循環中已經有一些x86程序集,但是我試圖將剩下的程序轉換爲彙編程序。我會很感激,如果你能幫助我如何將C++中的循環轉換爲彙編器?
void encrypt_chars (int length, char EKey)
{ char temp_char; // char temporary store
for (int i = 0; i < length; i++) // encrypt characters one at a time
{
temp_char = OChars [i]; //
__asm { //
push eax // save register values on stack to be safe
push ecx //
//
movzx ecx,temp_char // set up registers (Nb this isn't StdCall or Cdecl)
lea eax,EKey //
call encrypt12 // encrypt the character
mov temp_char,al //
//
pop ecx // restore original register values from stack
pop eax //
}
EChars [i] = temp_char; // Store encrypted char in the encrypted chars array
}
將C++轉換爲彙編程序的最佳方式是使用C++編譯器。 –
好吧,我目前正在使用visual studio。有關如何這樣做的任何建議? – Cube3
@MikeVine我在問另外一個問題。我在問如何將for循環轉換爲彙編程序。 – Cube3