From d98f46ce647846b0aa30b2e16a30fd4e152a1bf5 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 10 Jul 2025 22:55:07 +0200 Subject: Add new code Signed-off-by: Carlos Maiolino --- PGU/OLD/asm/max.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 PGU/OLD/asm/max.c (limited to 'PGU/OLD/asm/max.c') diff --git a/PGU/OLD/asm/max.c b/PGU/OLD/asm/max.c new file mode 100644 index 0000000..5b4c37a --- /dev/null +++ b/PGU/OLD/asm/max.c @@ -0,0 +1,27 @@ +int main(void) +{ + + static int list[] = {10,20,30,40,5,50,60,70,80,90,0}; + int i, ret; + + ret = list[0]; + i = 0; + + /* + for (i = 0; list[i] != 0; i++) { + if (list[i] < ret) + ret = list[i]; + } + */ + while (1) { + i++; + + if (list[i] == 0) + return ret; + + if (ret > list[i]) + ret = list[i]; + } + + return ret; +} -- cgit v1.2.3