New Semester
Started
Get
50% OFF
Study Help!
--h --m --s
Claim Now
Question Answers
Textbooks
Find textbooks, questions and answers
Oops, something went wrong!
Change your search query and then try again
S
Books
FREE
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Tutors
Online Tutors
Find a Tutor
Hire a Tutor
Become a Tutor
AI Tutor
AI Study Planner
NEW
Sell Books
Search
Search
Sign In
Register
study help
business
implementing programming languages
Assembly Language For X86 Processors 7th Edition Kip Irvine - Solutions
28. How many local descriptor tables can exist?
27. How many global descriptor tables can exist?
26. Which register contains the base location of a global descriptor table?
25. Which register contains the base location of a local descriptor table?
24. What advantage does paging offer?
23. If paging is disabled, how does the processor translate a linear address to a physical address?
22. How does paging relate to linear memory?
21. Describe a linear address.
20. Does the message box activated by WM_CLOSE appear before or after the main window closes?
19. Does the message box activated immediately after calling CreateWindow appear before or after the application’s main window?
18. Describe the role of the ErrorHandler procedure in the example program.
17. Which messages are processed by the WinProc procedure in the example program?
16. Describe the role of the WinProc procedure in the example program.
15. Name at least three tasks performed by the WinMain (startup) procedure.
14. Name two icon constants that can be used when calling the MessageBox function.
13. Name two button constants that can be used when calling the MessageBox function.
12. When CreateWindowEx is called, how is the window’s appearance information transmitted to the function?
11. Which Win32 function lets you pause a program for a specified number of milliseconds?
10. Which Win32 function lets you copy an array of attribute values to consecutive cells of the console screen buffer?
9. Which Win32 function lets you change the color of subsequent text output?
8. Which Win32 function lets you change the size of the cursor?
7. Which Win32 function lets you change the dimensions of the screen buffer?
6. Which Win32 function changes the title of the console window?
5. Which Win32 function moves the file pointer to a specified offset relative to the beginning of a file?
4. Describe the COORD structure.
3. Which Win32 function reads a string of text from the keyboard and places the string in a buffer?
2. Which Win32 function returns a handle to standard input?
1. Name the MASM data type that matches each of the following standard MS-Windows types:a. BOOLb. COLORREFc. HANDLEd. LPSTRe. WPARAM
6. (True/False): A segment descriptor does not contain segment size information.
5. (True/False): A segment selector is 32 bits.
4. (True/False): A segment descriptor contains the base location of a segment.
3. (True/False): A segment selector points to an entry in a segment descriptor table.
2. Define the following terms:a. Segment selectorb. Logical address
1. Define the following terms:a. Multitaskingb. Segmentation
5. When calling HeapDestroy, how do you identify the memory block being destroyed?
4. Show a sample call to the HeapCreate function.
3. Describe the HeapAlloc function.
2. Describe the GetProcessHeap function.
1. What is another term for heap allocation, in the context of C, C++, and Java?
5. In a WNDCLASS structure, what is the meaning of the hInstance field?
4. In a WNDCLASS structure, what is the meaning of the style field?
3. In a WNDCLASS structure, what is the meaning of the lpfnWndProc field?
2. How is the WNDCLASS structure used?
1. Describe a POINT structure.
5. (True/False): Win32 console input functions can detect when the user has resized the console window.
4. (True/False): The ReadConsole function reads mouse information from the input buffer.
3. (True/False): Unicode is the native character set for Windows 98.
2. (True/False): A function ending with the letter W (such as WriteConsoleW) is designed to work with a wide (16-bit) character set such as Unicode.
1. What is the linker command that specifies that the target program is for the Win32 console?
Some computer instruction sets permit arithmetic instructions with three operands. Such operations sometimes appear in simple virtual assemblers used to introduce students to the concept of assembly language or using intermediate language in compilers. In the following macros, assume EAX is
Create a macro that shifts an array of 32-bit integers a variable number of bits in either direction, using the SHRD and SHLD instructions. Write a test program that tests your macro by shifting the same array in both directions and displaying the resulting values. You can assume that the array is
When testing the DrunkardWalk program, you may have noticed that the professor doesn’t seem to wander very far from the starting point. This is no doubt caused by an equal probability of the professor moving in any direction. Modify the program so there is a 50% probability the professor will
When the professor took the drunkard's walk around campus in Section 10.1.6, we discovered that he lost his cell phone somewhere along the path. When you simulate the drunken walk, your program must drop the phone wherever the professor is standing at some random time interval. Each time you run
Create a macro named mWriteInt that writes a signed integer to standard output by calling the WriteInt library procedure. The argument passed to the macro can be a byte, word, or doubleword. Use conditional operators in the macro so it adapts to the size of the argument.Write a program that tests
Create a macro named mReadInt that reads a 16- or 32-bit signed integer from standard input and returns the value in an argument. Use conditional operators to allow the macro to adapt to the size of the desired result. Write a program that tests the macro, passing it operands of various sizes.
Create a macro named mMult32 that multiplies two 32-bit memory operands and produces a 32-bit product. Write a program that tests your macro.
Write a macro named mMove32 that receives two 32-bit memory operands. The macro should move the source operand to the destination operand. Write a program that tests your macro.
(Requires reading ahead to Section 11.1.11.) Create a macro that writes a null-terminated string to the console with a given text color. The macro parameters should include the string name and the color. Hint: Call SetTextColor from the book’s link library. Write a program that tests your macro
Create a macro that waits for a keystroke and returns the key that was pressed. The macro should include parameters for the ASCII code and keyboard scan code. Hint: Call ReadChar from the book’s link library. Write a program that tests your macro. For example, the following code waits for a key;
16. Assume the following mLocate macro definition:mLocate MACRO xval,yval IF xval LT 0 ;; xval < 0?EXITM ;; if so, exit ENDIF IF yval LT 0 ;; yval < 0?EXITM ;; if so, exit ENDIF mov bx,0 ;; video page 0 mov ah,2 ;; locate cursor mov dh,yval mov dl,xval int 10h ;; call the BIOS ENDM Show the source
15. Write a short macro that demonstrates the use of the & operator when the macro parameter is embedded in a literal string.
14. Write a statement using the IF directive that checks the value of the constant macro parameter Z; if Z is less than zero, display a message during assembly indicating that Z is invalid.
13. Write a short example that uses the IF, ELSE, and ENDIF directives.
12. Show an example of a macro parameter having a default argument initializer.
11. Write a macro named mDumpMemx that receives a single parameter, the name of a variable.Your macro must call the mDumpMem macro from the book’s library, passing it the variable’s offset, number of units, and unit size. Demonstrate a call to the mDumpMemx macro.
10. Show the expanded code produced by the following statement that invokes the mRead-String macro from Section 10.2.5:mReadStr customerName
9. Show the expanded code produced by the following statement that invokes the mWrite-String macro from Section 10.2.5:mWriteStr namePrompt
8. Write a macro named mWriteAt that locates the cursor and writes a string literal to the console window. Suggestion: Invoke the mGotoxy and mWrite macros from the book’s macro library.
7. Write a macro named mPromptInteger that displays a prompt and inputs an integer from the user. Pass it a string literal and the name of a doubleword variable. Sample call:.data minVal DWORD ?.code mPromptInteger "Enter the minimum value", minVal
6. Write a macro named mGenRandom that generates a random integer between 0 and n 1.Let n be the only parameter.
5. Write a macro named mPrintChar that displays a single character on the screen. It should have two parameters: this first specifies the character to be displayed and the second specifies how many times the character should be repeated. Here is a sample call:mPrintChar 'X',20
4. Declare an array of Triangle structures. Write a loop that initializes Vertex1 of each triangle to random coordinates in the range (0...10, 0...10).
13. Create a structure named SampleStruct containing two fields: field1, a single 16-bit WORD, and field2, an array of 20 32-bit DWORDs. The initial values of the fields may be left undefined?
12. Using the following Triangle structure, declare a structure variable and initialize its vertices to (0,0), (5, 0), and (7,6):Triangle STRUCT Vertex1 COORD Vertex2 COORD Vertex3 COORD Triangle ENDS
11. Write a statement that retrieves the wHour field of a SYSTEMTIME structure.
10. What is the purpose of the % operator in a macro definition?
9. What is the purpose of the ! operator in a macro definition?
8. What is the purpose of the & operator in a macro definition?
7. List all the relational operators that can be used in constant boolean expressions.
6. Which directive marks the end of a conditional block of statements?
5. Which directive displays a message on the console during the assembly step?
4. What is the purpose of the LOCAL directive?
3. (True/False): A macro cannot contain data definitions.
2. Assume that the following structure has been defined:RentalInvoice STRUCT invoiceNum BYTE 5 DUP(' ')dailyPrice WORD ?daysRented WORD ?RentalInvoice ENDS State whether or not each of the following declarations is valid:a. rentals RentalInvoice b. RentalInvoice rentals c. march RentalInvoice d.
1. What is the purpose of the STRUCT directive?
8. Challenge: In the Linked List example program (Section 10.4.5), what would be the result if the REPEAT loop were coded as follows?REPEAT TotalNodeCount Counter = Counter + 1 ListNode ENDM
7. Assume the following mRepeat macro has been defined:mRepeat MACRO char,count LOCAL L1 mov cx,count L1: mov ah,2 mov dl,char int 21h loop L1 ENDM Write the code generated by the preprocessor when the mRepeat macro is expanded by each of the following statements (a,b, and c):mRepeat 'X',50 ; a
6. Write the statements generated by the following macro:FOR val,BYTE 0,0,0,val ENDM
5. Which looping directive would be the best tool to generate a character lookup table?
4. Briefly describe the FORC directive.
3. Briefly describe the FOR directive.
2. Briefly describe the REPEAT directive.
1. Briefly describe the WHILE directive.
5. What is the purpose of the IFDEF directive?
4. How is IFIDNI different from IFIDN?
3. Which directive stops all further expansion of a macro?
2. What is the purpose of the IFIDN directive?
1. What is the purpose of the IFB directive?
6. (True/False): A macro cannot contain data definitions.
5. (True/False): Replacing a long procedure with a macro containing the procedure’s code will typically increase the compiled code size of a program if the macro is invoked multiple times.
Showing 300 - 400
of 1525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Last
Step by Step Answers