I have two questions about this homework assignment:
Write an assembly language program in a file called HW5.asm that would read in a signed base 10 number from the keyboard (less than 1000 and greater than -1000 ends with a $ sign) and calculates the square of the number and prints back to display. Since we are using Visual Studio emulator and there is no I/O you will have to create a string variable as the input and write a string to memory as the output.
A. How large should a string variable be? WORD string?
B. What does the professor mean by “ends with a $ sign”? Is that true? How do I remove that in order to read the number in properly?
A. The string variable will be as long as needed to hold the string in question; given the specs, WORD won’t be big enough.
B. Since you’re the one writing the code to compute the numeric value represented by a string, you can use the $ as it was intended: to signify the end of the string.