\"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;l
ID: 3535924 • Letter: #
Question
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
must INCLUDE Irvine32.inc
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
Write a procedure named ShowParams that displays the
address and hexadecimal value of the
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
32-bit parameters on the runtime stack of the procedure that called
it. The parameters are to be
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
displayed in order from the lowest address to the highest. Input to
the procedure will be a single
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
integer that indicates the number of parameters to display. For
example, suppose the following
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
statement in main calls MySample, passing three arguments:
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
INVOKE MySample, 1234h, 5000h, 6543h
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
Next, inside MySample, we make a call to ShowParams,
passing the number of parameters:
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
MySample PROC first:DWORD, second:DWORD, third:DWORD
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
paramCount = 3
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
call ShowParams, paramCount
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
Suggestion: Run the program in Debug mode and examine the
Disassembly window. The following
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
is a sample of the expected output:
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
Stack parameters:
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
---------------------------
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
Address 0012FF80 = 00001234
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
Address 0012FF84 = 00005000
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
Address 0012FF88 = 00006543
"margin:0px 0px .5em;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
"margin:0px;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
Use these prototypes in your program:
"margin:0px;padding:0px;border:0px;font-family:Helvetica, sans-serif;line-height:16px;vertical-align:baseline;color:rgb(51,51,51);background-color:rgb(241,241,241);">
"margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;line-height:inherit;vertical-align:baseline;">
MySample PROTO first:DWORD, second:DWORD,
third:DWORD
"margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;line-height:inherit;vertical-align:baseline;">
ShowParams PROTO numParams:DWORD
"margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;line-height:inherit;vertical-align:baseline;">
"margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;line-height:inherit;vertical-align:baseline;">
Note:
after displaying the addresses and hex
value of each 32-bit parameter
"margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;line-height:inherit;vertical-align:baseline;">ShowParms MUST
utilize WaitMsg to
"margin:0px;padding:0px;border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;line-height:inherit;vertical-align:baseline;"> pause
the screen.
Explanation / Answer
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.