Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write assembly functions that implement the following C functions: a. uint32_t add32(uint32_t x, uint32_t y) // returns (x+y)%(2^32); any carry out is lost b. uint64_t

Write assembly functions that implement the following C functions: a. uint32_t add32(uint32_t x, uint32_t y) // returns (x+y)%(2^32); any carry out is lost b. uint64_t add32_64(uint32_t x, uint32_t y) // returns x+y; sum contains any carry c. uint64_t add64(uint64_t x, uint64_t y) // returns (x+y)%(2^64) d. uint32_t shiftLeftU32 (uint32_t x, uint32_t p) // returns x << p = x*2^p for p = 0..31 e. uint32_t shiftU32(uint32_t x, int32_t p) // return x*2^p for p = -31..31 f. int32_t shiftLeftS32 (int32_t x, uint32_t p) // returns x << p = x*2^p for p = 0..31 g. int32_t shiftS32(int32_t x, int32_t p) // return x*2^p for p = -31..31 h. uint32_t isEqual32(uint32_t x, uint32_t y) // returns 1 if x=y, 0 if x!=y i. int32_t isEqual32(int32_t x, int32_t y) // returns 1 if x=y, 0 if x!=y j. uint32_t isEven(uint32_t x) // returns 1 if even, 0 if not even k. uint32_t maxU32(uint32_t x, uint32_t y) // returns the maximum of x, y l. int32_t maxS32(int32_t x, int32_t y) // returns the maximum of x, y For each of these programs, submit a file named hw2_4x.s where x is a, b, c, d, e, f, g, h, I, j, k, or l. Each file must include assembler directives so that it can be assembled with the following command as o hw2_4x_s.o hw2_4x.s with the function being callable from a C program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions