1

I am learning x86-64 assembly, using SASM IDE and I have this question.

%include "io64.inc"

section .data
string2 db "hello",0

section .text
global CMAIN

CMAIN:
    mov rbp, rsp; for correct debugging
    mov rsi, string2
    xor rax, rax
    ret

Since I mov rsi, string2, I thought rsi and string2 hold the same thing, an address .

When debugging, I watch $rsi and check the "address" box, it shows the char array correctly. But when I also watch string2 and check "address", it gives Wrong variable or address: "string2". If I uncheck "address", it shows the char array correctly.

Why $rsi and string2 behaves differently? Did I miss something?

enter image description here

enter image description here

Rick
  • 7,007
  • 2
  • 49
  • 79
  • Not the answer to your question, but make sure you preserve `rbp` otherwise you may get a crash later. – Jester Jun 27 '23 at 10:21

0 Answers0