«Привет всем» в регистре% edx
На самом деле у вас нет «строки» в регистре. Вместо этого у вас есть ссылка на память.
Если вы не хотите обрезать исходную строку. Вы можете сделать это
; Method #1: Copy the cut part of the string to a new address %edi
movl $10,%ecx ; Store the length of cut string to %ecx
movl %edx,%esi ; Copy the address of original string to %esi (Source Index)
rep movsb ; This instruction copies %ecx bytes from %esi to %edi (Destination Index)
movb $0,(%edi)
movl %edi,%eax
Используйте метод # 2, если вы хотите изменить только текущую строку
; Method #2: Cut the current string
movb $0,10(%edx) ; Put a null-terminator at the end of letter 'e'