1
我想創建3個asciz字符的子字符串(小字符串)出我的原始(thestring)。事情是不打印時運行,所以我不知道我到底在做什麼。爲什麼不打印?我是否正確創建小型字符串?在Linux IA-32彙編程序(氣體)上創建子字符串
.section .data
thestring: .asciz "111010101"
ministring: .asciz ""
formatd: .asciz "%d"
formats: .asciz "%s"
formatc: .asciz "%c"
.section .text
.globl _start
_start:
xorl %ecx, %ecx
ciclo:movb thestring(%ecx,1), %al
movzbl %al, %eax
movl %eax, ministring(%ecx,1)
incl %ecx
cmpl $3, %ecx
jl ciclo
movl thestring, %eax
pushl %eax
pushl $formats
call printf
addl $4, %esp
movl $1, %eax
movl $0, %ebx
int $0x80
分段錯誤 – andandandand 2008-12-31 09:24:53