Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

In this video we look at the MOV and LEA instructions.


Something I accidentally forgot to mention on YouTube: If you use MOV as a NOP, be careful not use "MOV EAX, EAX"! The 32 bit MOV will clear the upper half of the 64 bit register, and is not a NOP. Best ones to use are "MOV RAX, RAX" for a three-byte NOP and "MOV AL, AL" for the two-byte NOP.


Also, sorry this video is a little squashed. YT told me it didn't like my aspect ratio, so I squashed the video, then it was fine.

Files

Previews only

Modern x64 Assembly 5: MOV and LEA

Sorry about the squashed vid, YT didn't like the original aspect, so I had to squash along the h axis :( This video is about the MOV and LEA instructions. MOV is the most commonly used instruction of all (that has a lot to do with the fact that x86 uses destructive instructions). MOV is used to copy data from the source operand into to the destination. When the source operand is RAM (a variable for example), the MOV instruction moves the data at the address into the destination. So if you have a variable at the address 25, with the value 7, MOV will move the value 7 into the destination. The LEA instruction is used to load a pointer into a register. It is actually an arithmetic instruction, and does not read RAM at all. When a memory operand is used as the source, the instruction loads the address of the operand, not the value. So the instruction is useful for loading an address into a register, effectively creating a pointer to the address: "LEA RCX, someVariable" makes RCX point to the address of the someVariable variable. So if you have a variable at the address 25, with the value 7, the LEA instruction will move 25 into the destination, not the 7 like MOV. We are not looking at SIB addressing at this point, but these instructions are slightly more useful than what's shown in this vid. Neopolitan Dreams: https://youtu.be/0AV0iCjMrUA Support What's a Creel? on Patreon: https://www.patreon.com/whatsacreel FaceBook: https://www.facebook.com/whatsacreel/ Music Channel: https://www.youtube.com/channel/UC2nWRGqPL6O-Lm8mexWhISQ

Comments

No comments found for this post.