【发布时间】:2010-09-28 19:12:03
【问题描述】:
.section .data
astring: .asciz "11010101"
format: .asciz "%d\n"
.section .text
.globl _start
_start:
xorl %ecx, %ecx
movb astring(%ecx,1), %al
movzbl %al, %eax
pushl %eax
pushl $format
call printf
addl $8, %esp
movl $1, %eax
movl $0, %ebx
int $0x80
假设我想打破 .asciz 字符串 1101011 并得到它的第一个。我该怎么做?上面的代码不起作用,它会打印 49 或其他东西。
【问题讨论】:
-
添加了 c 标签,因为问题实际上是关于 C 的 printf 函数。
-
读心者,我无法读懂你的心思。你想要什么输出? 1 还是 1101011?
-
“并得到它的第一个”。所以第一个。 1.
标签: c linux assembly x86 gnu-assembler