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 --- CSAPP/tmul.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 CSAPP/tmul.c (limited to 'CSAPP/tmul.c') diff --git a/CSAPP/tmul.c b/CSAPP/tmul.c new file mode 100644 index 0000000..687221a --- /dev/null +++ b/CSAPP/tmul.c @@ -0,0 +1,14 @@ +int tmul_ok_asm(long x, long y, long *dest ) +{ + long r = x*y; + *dest = r; + return r > 0; +} + +int umul_ok_asm(unsigned long x, unsigned long y, unsigned long *dest) +{ + unsigned long r = x*y; + + *dest = r; + return r > 0; +} -- cgit v1.2.3