.data
.bss
.lcomm source, 10
.lcomm dest, 10
.text
.global _start
_start:
movq $source, %rsi
movq $1, (%rsi)
movq $2, 1(%rsi)
movq $3, 2(%rsi)
movq $dest, %rdi
movq $3, %rcx
cld
rep movsb
movq $60, %rax
xorq %rdi, %rdi
syscall
.end
$ gcc -nostartfiles -static str.s -o str
$ gdb ./str
...
(gdb) b *0x40102f
Breakpoint 1 at 0x40102f
(gdb) r
Starting program: /home/jcmvbkbc/tmp/toster/str
Breakpoint 1, 0x000000000040102f in _start ()
(gdb) x/3b $rsi - 3
0x402000 <source>: 1 2 3
(gdb) x/3b $rdi - 3
0x402010 <dest>: 1 2 3