From f5281689c95758f17628f0286e0265ecf3385a8e Mon Sep 17 00:00:00 2001 From: Miguel Date: Fri, 21 Sep 2018 11:44:55 +0200 Subject: little div prog and cleaning userspace --- userspace/checker.c | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 userspace/checker.c (limited to 'userspace/checker.c') diff --git a/userspace/checker.c b/userspace/checker.c deleted file mode 100644 index ac0bcc9..0000000 --- a/userspace/checker.c +++ /dev/null @@ -1,20 +0,0 @@ -#include - -int main() - -{ -FILE *fp; /* The file handle for input data */ -fp=stdin; -int ch; /* Each character read. */ -int checksum = 0; /* The checksum mod 2^16. */ -int count=0; - -printf("this will calc a simple checksum of the enered text\nPress Left Control + D to signify end of file \n",checksum,count); -while ((ch = getc(fp)) != EOF) { - checksum = (checksum >> 1) + ((checksum & 1) << 15); - checksum +=(int) ch; - checksum &= 0xffff; /* Keep it within bounds. */ - count++; -} -printf("checksum : 0x%08X for %i bytes\n",checksum,count); -} -- cgit v1.2.3