CPEN 3710 Lab Exercise 11 Real Number Processing and Linking to High-Level Language Programs Required Materials: $ Your textbook, Assembly Language for x86 Processors (7th edition) $ Removable or...

assembly x86 coding


CPEN 3710 Lab Exercise 11 Real Number Processing and Linking to High-Level Language Programs Required Materials: $ Your textbook, Assembly Language for x86 Processors (7th edition) $ Removable or network device (Flash drive, memory card, MyMocsNet account mapped to a drive letter, etc.) for storage of your programs $ These instructions $ Intel-compatible, Windows-based personal computer (like the ones in EMCS 306) with text editor, MASM, and Microsoft Visual Studio (or other available high-level language compiler of your choice) Preparation for Laboratory: Read the material on floating-point binary representation and the Intel floating-point unit in Sections 12.1 and 12.2, pages 511-539 of your textbook. Also read the material on interfacing assembly language code to high-level languages in Chapter 13, pages 555-586 of your textbook. Instructions: Write an assembly language procedure that will use Intel floating-point instructions to perform the computations required to evaluate the distance formula (found in any algebra textbook). In other words, given the real number coordinates (x1, y1) and (x2, y2) that represent two points on the x-y plane, compute the distance between the two points according to the equation d = [(x1 - x2)2 + (y1 - y2)2 ]. This procedure must be called from a high-level language main program (written in C, C++, Java, Pascal, Fortran, or any other high-level language approved by the instructor for which you have access to a compiler) which prompts the user for the values of the real numbers x1, y1, x2, and y2; passes these four values (as well as a pointer resultptr to the memory location used to return the result) to the procedure using the standard mechanism supported by the high-level language compiler (most likely through a stack frame); and (after the called procedure returns) displays the result (the Euclidean distance between the two points) computed by the assembly language procedure. Note that while most high-level languages return an integer value in the EAX register, in this case the calculated distance will be a real number. Therefore, the assembly procedure must use the supplied pointer (which will need to be set up to point to a float or double variable in memory) to store the result in memory such that it is accessible to the caller, which will then display the computed distance to the user. To Hand In: (due by 4:50 p.m. Tuesday, November 19) 1. Turn in a printed copy of your thoroughly commented assembler listing (.LST file) for the called procedure, and your thoroughly commented high-level language program (.C, .CPP, .java, .PAS, or other source code file as appropriate). Be sure to follow the guidelines given in the programming style and documentation handout. 2. Submit the results of your program as follows: run it from the command prompt and capture a Ascreen shot@ of the output produced by the program. Do this for at least four test cases, including cases where the two points are in different quadrants of the x-y plane. 3. Have the instructor check the operation of your program and sign in the space below when you have demonstrated its operation. Instructor=s signature: _________________________________________________________________________ Staple your HLL and Assembly program listings, results, and this signed sheet together. Submit these items by the date and time specified above. Late submissions will be penalized substantially.
Nov 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here