Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assembly Sorting Random Integers Programmed by Author Name This program generates random numbers in the range [100 .. 999], displays the original list, sorts the

Assembly Sorting Random Integers Programmed by Author Name This program generates random numbers in the range [100 .. 999], displays the original list, sorts the list, and calculates the median value. Finally, it displays the list sorted in descending order. How many numbers should be generated? [15 .. 200]: 10 Invalid input How many numbers should be generated? [15 .. 200]: 16 The unsorted random numbers: 680 329 279 846 123 101 427 913 255 736 431 545 984 391 626 803 The median is 488. The sorted list: 984 913 846 803 736 680 626 545 431 427 391 329 279 255 123 101 Thanks for using my program!

Requirements

  1. The title, programmer's name, and brief instructions must be displayed on the screen.
  2. The program must validate the users request.
  3. The main procedure must consist (mostly) of procedure calls. It should be a readable list of what the program will do.
  4. min, max, lo, and hi must be declared and used as global constants.
  5. All procedure parameters must be passed on the system stack.
  6. Each procedure will implement a section of the program logic, i.e., each procedure will specify how the logic of its section is implemented. The program must be modularized into at least the following procedures and sub-procedures:
    • main
    • introduction
    • get data {parameters: request (reference)}
    • fill array {parameters: request (value), array (reference)}
    • sort list {parameters: array (reference), request (value)}
      • exchange elements (for most sorting algorithms): {parameters: array[i] (reference), array[j] (reference), where i and j are the indexes of elements to be exchanged}
    • display median {parameters: array (reference), request (value)}
    • display list {parameters: array (reference), request (value), title (reference)}
  7. Parameters must be passed by value or by reference on the system stack as listed above.
  8. There must be just one procedure to display the list. This procedure must be called twice: once to display the unsorted list, and once to display the sorted list.
  9. Procedures (except main) should not reference .data segment variables by name. request, array, and titles for the sorted/unsorted lists should be declared in the .data segment, but procedures must use them as parameters. Procedures are allowed to use local variables when appropriate (section 8.2.9 in the textbook). Global constants are OK.
  10. The program must use appropriate addressing modes for array elements.
  11. The two lists must be identified when they are displayed (use the title parameter for the display procedure).
  12. Each procedure must have a procedure header that follows the format discussed during lecture.
  13. The code and the output must be well-formatted.
  14. The usual requirements regarding documentation, readability, user-friendliness, etc., apply.
    Sorting Random Integers Programmed by Author Name This program generates random numbers in the range [100 .. 999], displays the original list, sorts the list, and calculates the median value. Finally, it displays the list sorted in descending order. How many numbers should be generated? [15 .. 200]: 10 Invalid input How many numbers should be generated? [15 .. 200]: 16 The unsorted random numbers: 680 329 279 846 123 101 427 913 255 736 431 545 984 391 626 803 The median is 488. The sorted list: 984 913 846 803 736 680 626 545 431 427 391 329 279 255 123 101 Thanks for using my program!

    Requirements

  15. The title, programmer's name, and brief instructions must be displayed on the screen.
  16. The program must validate the users request.
  17. The main procedure must consist (mostly) of procedure calls. It should be a readable list of what the program will do.
  18. min, max, lo, and hi must be declared and used as global constants.
  19. All procedure parameters must be passed on the system stack.
  20. Each procedure will implement a section of the program logic, i.e., each procedure will specify how the logic of its section is implemented. The program must be modularized into at least the following procedures and sub-procedures:
    • main
    • introduction
    • get data {parameters: request (reference)}
    • fill array {parameters: request (value), array (reference)}
    • sort list {parameters: array (reference), request (value)}
      • exchange elements (for most sorting algorithms): {parameters: array[i] (reference), array[j] (reference), where i and j are the indexes of elements to be exchanged}
    • display median {parameters: array (reference), request (value)}
    • display list {parameters: array (reference), request (value), title (reference)}
  21. Parameters must be passed by value or by reference on the system stack as listed above.
  22. There must be just one procedure to display the list. This procedure must be called twice: once to display the unsorted list, and once to display the sorted list.
  23. Procedures (except main) should not reference .data segment variables by name. request, array, and titles for the sorted/unsorted lists should be declared in the .data segment, but procedures must use them as parameters. Procedures are allowed to use local variables when appropriate (section 8.2.9 in the textbook). Global constants are OK.
  24. The program must use appropriate addressing modes for array elements.
  25. The two lists must be identified when they are displayed (use the title parameter for the display procedure).
  26. Each procedure must have a procedure header that follows the format discussed during lecture.
  27. The code and the output must be well-formatted.
  28. The usual requirements regarding documentation, readability, user-friendliness, etc., apply.

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

Step: 3

blur-text-image

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions