1

I want to pick out certain character out of a string stored in memory, but don't know how

str    db "hello",0
mov    rdi,str
call   puts

when I do this I get the output hello, but I want to know how to get the first character out. For example how do I move the first character h saved in some register?

1 Answers1

1
mov  al, byte ptr [rdi]

will move one byte from the address pointed at by rdi into the al register (bottom 8 bits of rax)

Chris Dodd
  • 119,907
  • 13
  • 134
  • 226