.lcomm localbuf 1 .data ch_to_output: .fill 128,1, 0 # this is a buffer num_ch_to_output: .word 0 # this is a number .text .global _start _start: # to output a linefeed character movb $10, ch_to_output movw $1, num_ch_to_output call sub1 # to print to the output file movb $32, ch_to_output movw $1, num_ch_to_output call sub1 # to print to the output file movl $1,%eax movl $0,%ebx int $0x80 sub1: .lcomm localbuf 1 movl $ch_to_output, %ecx # using global var. ch_to_output for chars to # output movl $0, %edx movw num_ch_to_output, %dx # using global var. num_ch_to_output for # number of characters to output movl $1, %ebx movl $4, %eax int $0x80 ret