๋ฐ˜์‘ํ˜•
๐Ÿ‘จ๐Ÿป‍๐Ÿ’ป programming/โ—ฝ ์ปดํ“จํ„ฐ ๊ณตํ•™2024. 6. 26. 11:29[assembly ๋ช…๋ น์–ด] mov, lea

"[ assembly ๋ช…๋ น์–ด ] mov, lea" mov ( move ) - ๋ฐ์ดํ„ฐ๋ฅผ ๋ณต์‚ฌํ•˜๋Š” ๋ช…๋ น์–ด (*์ด๋™์ด ์•„๋‹˜ ์ฃผ์˜) [์˜ˆ์‹œ]1. mov eax, dword ptr [ a ] :  a์˜ ์ฃผ์†Œ๊ฐ€ ๊ฐ€๋ฆฌํ‚ค๋Š” 4๋ฐ”์ดํŠธ(Dword) ๊ฐ’์ด eax์— ์ €์žฅํ•œ๋‹ค. 2. mov eax, [adr]  : adr์ฃผ์†Œ๊ฐ€ ๊ฐ€๋ฆฌํ‚ค๋Š” ๊ฐ’์„ eax์— ์ €์žฅํ•œ๋‹ค.3. mov dword ptr [ a ], 3 : a์— 3 ๊ฐ’์„ ์ €์žฅํ•œ๋‹ค.4. mov eax, [ rbx + 8 ] : rbx์ฃผ์†Œ๊ฐ’์— + 8์„ ํ•œ ์ฃผ์†Œ๋กœ ๊ฐ€์„œ ๊ทธ ์•ˆ์— ์žˆ๋Š” ๊ฐ’์„ eax์— ๋ณต์‚ฌํ•œ๋‹ค.  5. mov [rcx], rax : rcx๋ ˆ์ง€์Šคํ„ฐ๊ฐ€ ์ฐธ์กฐํ•˜๋Š” ์ฃผ์†Œ์˜ ๋ฉ”๋ชจ๋ฆฌ์— rax ๋ ˆ์ง€์Šคํ„ฐ์˜ ๊ฐ’์„ ์ €์žฅํ•œ๋‹ค. Lea  ( Load Effective Address )- ์œ ํšจ..

๋ฐ˜์‘ํ˜•
image