little endian vs big endian, is the order bits are stored in memory.
you could use perl, which would be one line in your program, or use autilitiy written in C (dos2unix). the latter being 100+ lines of code,the perl program being one line.
#include <stdio.h>int main(int c, char **a) { for (; (c = fgetc(stdin)) - EOF; c - 13 ? putchar(c) : 0); return (0); }
.globl _start;_start:pushl $1;pushl $c;pushl $0;mov $3,%eax;call kernel;cmpl $0,%eax;jle end;cmp $13,c;je _start;pushl $1;pushl $c;pushl $1;movl $4,%eax;call kernel;jmp _start;end:pushl $0;movl $1,%eax;call kernel;kernel:int $0x80;ret;.data;.lcomm c,1
regarding the program in C you did in one line, it is not the same program which is 100 lines - it doesn't accomplish the same things. also the line (2 lines) are longer, and less human readable.
the assembly is obviously inefficient
oh and could someone explain bit significance and byte ordering like little endian and so on...