Question: NASM Program with External Subroutines In this project, you are going to first implement the subroutines from Assignment 4 as external subroutines ( that are
NASM Program with External Subroutines In this project, you are going to first implement the subroutines from Assignment as external subroutines that are in a different file and assembled independently from the main program callable from an assembly language main program. Then you are going to write another NASM main program to call these subroutines from different places. First, implement the following NASM subroutines you developed in Assignment as external subroutines as a dynamic library. printstr len: prints the character string of length len stored at address str on the standard output device screen iprint int: prints the specified signed integer int on the standard output device screen after converting it into the appropriate character string. prln: prints the linefeed character at the end of the current output line so that the next output will go to a new line. ireadint: reads a signed integer from the standard input device keyboard and returns the binary integer in int. This should be done by placing the code of these subroutines in a separate file, adding the necessary assembler directives to make them external subroutines and then assembling them into a dynamic program library. Next write a NASM main program that will read a signed integer number of up to four digits, check if the number is a perfect square and print appropriate messages as shown in the following pseudo code. readintnumber; if number then println The entered number number, cannot be a perfect square as it is negative.; else case number of : root ; break; : root ; break; : root ; break; : root ; rootsqr rootroot; while rootsqr number root root ; rootsqr rootroot; if rootsqr number then println The entered number number, is a perfect square and its square root is root, ; else println The entered number number, is not a perfect square.; Implement your main program to do the above computation within a loop as long as a valid nonempty number is entered. Place your main program in a separate file, assemble it link it with your program library and run the program. Your submission should include the source code of your program and its output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
