xor

어셈블리2018. 6. 14. 15:50

// operator : xor : 배타적 논리의 합


# include <stdio.h>


int main(void)

{

unsigned int xorV = 0X0;

unsigned int v1 = 0x13; //  19 : 0001 0011

unsigned int v2 = 0x7;  //   7 : 0000 0111

char* prompt = "xor => %d\n";

//-------------------------------

//                      0001 0100 => 20

__asm

{

mov eax, dword ptr[v1]; // eax = v1

xor eax, dword ptr[v2]; // eax ^=v2

mov dword ptr[xorV], eax;

push         dword ptr[xorV];

push         dword ptr[prompt];

call         dword ptr[printf];

pop ebx;

pop ebx;

}

}


어셈2.xlsx


'어셈블리' 카테고리의 다른 글

정올_문제_  (2) 2018.06.22
정올 어셈블 문제 - 배열관련 - 아직 완변하지 않음  (0) 2018.06.14
어셈블리 (push / pop)  (0) 2018.06.14
2018_05_30_키트리_침해대응  (0) 2018.05.29
2018_05_30_01  (0) 2018.05.29