Answer the question
In order to leave comments, you need to log in
The movsb gas syntax line instruction doesn't work, can anyone explain why?
.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
Answer the question
In order to leave comments, you need to log in
The original code works fine as is:
$ 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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question