.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
Suppose I wanna break the .asciz string 1101011 and get it’s first one. How do I go about it? The code above ain’t working, it prints 49 or something.
Change the conversion specifier for
printffrom%dto%cto print the character instead of its ascii value.