4 MOV vs LEA

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024

Комментарии • 9

  • @marcopinedo2368
    @marcopinedo2368 2 месяца назад

    If I'm wrong, please let me know in the comment. The mov instruction can be used in the next C code:
    int a = 5; // mov eax, 0x5 then mov "stack address", eax
    int b = a; //mov eax, "stack address" then mov "another stack address", eax
    And for lea instruction, the C code would be this:
    int *pB = &b; //lea eax, "stack address of b" then mov "stack address for pointer", eax
    I figured out this because I wrote a simple C code and decompiled it into assembly x86, but not sure since I am a beginner

  • @virajcz7143
    @virajcz7143 Год назад +1

    beautiful

  • @maxscott3349
    @maxscott3349 Год назад

    Does lea actually do the arithmetic faster than a couple of bitshifts and additions?

  • @iamtimsson
    @iamtimsson 8 месяцев назад

    i man okay but isn't it
    operation destination, source
    so like
    move edx, eax
    edx is now eax?

    • @DartrIxBTD
      @DartrIxBTD 5 месяцев назад

      Hey there! Hope i am not too late...
      The video uses AT&T syntax (another way to write assembly), which follows the following syntax: operation source, destination - mov $10, %eax ( the $ and % is part of the AT&T syntax)
      In intel syntax (mostly used on nasm and the windows world) the syntax is operation destination, source - mov eax, 10.

  • @topazavraham817
    @topazavraham817 Год назад

    Thanks

  • @lilyhigh3900
    @lilyhigh3900 Год назад +2

    clear and concise explanation, thank you!

    • @b213videoz
      @b213videoz 4 месяца назад

      Nothing is concise or clear with abominable AT&T syntax

  • @ucanh8173
    @ucanh8173 Год назад

    very nice