I am using NASM assembler on linux 64 bit. There is something with variables and registers I can't understand. I create a variable named "msg":
msg db "hello, world"
Now when I want to write to the stdout I move the msg
to rsi
register, however I don't understand the mov
instruction bitwise ... the rsi register consists of 64 bit , while the msg variable has 12 symbols which is 8 bits each , which means the msg variable has a size of 12 * 8
bits , which is greater than 64 bits obviously.
So how is this even possible to make an instruction like:
mov rsi, msg
, without overflowing the memory allocated for rsi.
Or does the rsi register contain the memory location of the first symbol of the string and after writing 1 symbol it changes to the memory location of the next symbol?
Sorry if I wrote complete nonsense, I'm new to assembly and i just can't get the grasp of it for a while.