How do you check that rsp mod 16 = 8?



  • "Trust that rsp mod 16 = 8 in the Long Mod." What does that mean?



  • I suspect that you're being asked to check whether the glass on the 16-bite border is even. Maybe someone needs it for the purpose of the efficiency of some of the instructions to the processor. The top of the line is in rsp, so it's got to be multiple 16. You can check, for example (write from your head, not compiling):

    mov rax, rsp
    and rax, 15
    jz .aligned ; Перейти куда-то, если остаток от деления на 16 равен 0.
    

    Accordingly, for verification at 8, you can write

    mov rax, rsp
    and rax, 15
    cmp rax, 8
    je .aligned ; Перейти куда-то, если остаток от деления на 16 равен 8.
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2