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