Chapter 8 Exercises
Question 1 Prototype for the ArraySum procedure, showing its parameter list: ArraySum PROTO, ptrArray:PTR DWORD, szArray:DWORD Describe in words about the parameters and their data types.
Question 2 A procedure accepts two parameters: an address of an array and a signed integer. Assume that the data type of the elements of the array is DWORD. Write the prototype of the procedure in an assembly code. Use PROTO.
Question 3 What does the following procedure fragment do? CopyString PROC, count:DWORD LOCAL temp[20]:BYTE mov edi,OFFSET count; invalid operand mov esi,OFFSET temp; invalid operand
Question 3 What does the following procedure fragment do? CopyString PROC, count:DWORD LOCAL temp[20]:BYTE mov edi,OFFSET count; invalid operand mov esi,OFFSET temp; invalid operand lea edi,count; ok lea esi,temp; ok
Question 4 CopyString PROC, count:DWORD LOCAL temp[20]:BYTE Give one example to call the procedure CopyString.
Question 5 PromptForIntegers PROTO, ptrPrompt:PTR BYTE, ptrArray:PTR DWORD, arraySize:DWORD Give one example to call the procedure PromptForIntegers. Use INVOKE.