From the course: Advanced C Programming: Integrating C and Assembly Language

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Challenge: Random range

Challenge: Random range

- [Instructor] Your final challenge for this course is to write an Assembly language function, random_range. The function accepts two integers as arguments and returns an integer value. Use a C module to call this function, processing the values returned. To help you out, I've already written the C module, which is available in the exercise files and shown here. The random_range function is prototyped at line five. It returns a random value in the range of argument low to argument high inclusive. This function is called in a for loop later in the code. The values returned will be in the range of one to 100 inclusive. The random range function can and should call the C language rand function to generate its values. It must work with the values passed, saving them if necessary, and using them to manipulate the value returned from the rand function, which is a long integer value. Here are some hints. The Intel x86 Assembly…

Contents