Making all bits false using Assembly Language

.section .data

data_items:

.byte 0b11111111

.section .text

.globl _start

_start:

movl $0, %edi

movb data_items(,%edi,1), %eax

start_loop:

shrl $1, %eax

cmpl $0b00000000,%eax

je exit_loop

jmp start_loop

exit_loop:

movb %eax, %ebx

movl $1, %eax

int $0x80

Share on : Twitter, Facebook or Google+