From 1f9b81740a1ec7b1b91ed0110a183e68eefce4d3 Mon Sep 17 00:00:00 2001 From: David Lee Date: Thu, 4 Jul 2024 09:40:33 -0700 Subject: [PATCH] linux build --- Microsoft C v203/{e.c => E.C} | 0 Microsoft C v203/{tm.c => TM.C} | 0 Microsoft C v203/{ttt.c => TTT.C} | 0 Microsoft C v203/m.sh | 12 ++++++++ Microsoft C v203/tphi.c | 31 --------------------- Microsoft C v203/tpi.c | 46 ------------------------------- 6 files changed, 12 insertions(+), 77 deletions(-) rename Microsoft C v203/{e.c => E.C} (100%) rename Microsoft C v203/{tm.c => TM.C} (100%) rename Microsoft C v203/{ttt.c => TTT.C} (100%) create mode 100644 Microsoft C v203/m.sh delete mode 100644 Microsoft C v203/tphi.c delete mode 100644 Microsoft C v203/tpi.c diff --git a/Microsoft C v203/e.c b/Microsoft C v203/E.C similarity index 100% rename from Microsoft C v203/e.c rename to Microsoft C v203/E.C diff --git a/Microsoft C v203/tm.c b/Microsoft C v203/TM.C similarity index 100% rename from Microsoft C v203/tm.c rename to Microsoft C v203/TM.C diff --git a/Microsoft C v203/ttt.c b/Microsoft C v203/TTT.C similarity index 100% rename from Microsoft C v203/ttt.c rename to Microsoft C v203/TTT.C diff --git a/Microsoft C v203/m.sh b/Microsoft C v203/m.sh new file mode 100644 index 0000000..fce2b16 --- /dev/null +++ b/Microsoft C v203/m.sh @@ -0,0 +1,12 @@ +str=$(tr '[a-z]' '[A-Z]' <<< $1) + +rm $str.OBJ 2>/dev/null +rm $str.MAP 2>/dev/null +rm $str.EXE 2>/dev/null + +ntvdm -r:. -u mc1 $str +ntvdm -r:. -u mc2 $str +ntvdm -r:. -u link $str + cs + gettm,, $str.map, mcs + +rm $str.OBJ 2>/dev/null +rm $str.MAP 2>/dev/null diff --git a/Microsoft C v203/tphi.c b/Microsoft C v203/tphi.c deleted file mode 100644 index fbd4b3f..0000000 --- a/Microsoft C v203/tphi.c +++ /dev/null @@ -1,31 +0,0 @@ -#include - -#define unsigned - -typedef unsigned long uint32_t; - -int main() -{ - uint32_t limit = 40; - uint32_t prev2 = 1; - uint32_t prev1 = 1; - uint32_t next, i, last_shown = 0; - - printf( "should tend towards 1.61803398874989484820458683436563811772030\n" ); - - for ( i = 1; i <= limit; i++ ) - { - next = prev1 + prev2; - prev2 = prev1; - prev1 = next; - - if ( i == ( last_shown + 5 ) ) - { - last_shown = i; - printf( " at %2lu iterations: %lf\n", i, (double) prev1 / (double) prev2 ); - } - } - - printf( "done\n" ); - return 0; -} diff --git a/Microsoft C v203/tpi.c b/Microsoft C v203/tpi.c deleted file mode 100644 index 07055b0..0000000 --- a/Microsoft C v203/tpi.c +++ /dev/null @@ -1,46 +0,0 @@ -#include - -#define HIGH_MARK 500 /* 2800 */ - -static long r[HIGH_MARK + 1]; - -int main() { - long i, k, c; - long b, d; - long iter; - - int iterations = 1; - - for ( iter = 0; iter < iterations; iter++ ) { - c = 0; - - for (i = 0; i < HIGH_MARK; i++) { - r[i] = 2000; - } - - for (k = HIGH_MARK; k > 0; k -= 14) { - d = 0; - - i = k; - for (;;) { - d += r[i] * 10000; - b = 2 * i - 1; - - r[i] = d % b; - d /= b; - i--; - if (i == 0) break; - d *= i; - } - if ( iter == ( iterations - 1 ) ) - { - printf( "%.4d", c + d / 10000 ); - fflush( stdout ); - } - c = d % 10000; - } - } - - printf( "\n" ); - return 0; -}