Write a procedure named DumpMemory that encapsulates the DumpMem procedure in the Irvine32 library. Use declared parameters and the USES directive. The following is an example of how it should be called: INVOKE DumpMemory,OFFSET array,LENGTHOF array,TYPE array Write a test program that calls your procedure several times, using a variety of data types.
时间: 2023-12-14 19:35:58 浏览: 73
DTMFTwelveKeyDialer.rar_The Class_dtmf dialer
Here is the procedure named DumpMemory:
```
DumpMemory PROC addr:PTR BYTE, length:DWORD, dataType:DWORD
USES ebx, ecx, edx
mov ebx, addr
mov ecx, length
mov edx, dataType
call DumpMem
ret
DumpMemory ENDP
```
And here is a sample test program that calls the DumpMemory procedure:
```
INCLUDE Irvine32.inc
.data
array1 BYTE 10,20,30,40,50
array2 WORD 100,200,300,400,500
array3 DWORD 1000,2000,3000,4000,5000
array4 QWORD 10000,20000,30000,40000,50000
.code
main PROC
; DumpMemory for array1
INVOKE DumpMemory,OFFSET array1,LENGTHOF array1,TYPE array1
call DumpCRLF
; DumpMemory for array2
INVOKE DumpMemory,OFFSET array2,LENGTHOF array2,TYPE array2
call DumpCRLF
; DumpMemory for array3
INVOKE DumpMemory,OFFSET array3,LENGTHOF array3,TYPE array3
call DumpCRLF
; DumpMemory for array4
INVOKE DumpMemory,OFFSET array4,LENGTHOF array4,TYPE array4
call DumpCRLF
exit
main ENDP
END main
```
This test program calls the DumpMemory procedure four times, each time with a different array of a different data type. The DumpCRLF procedure is called after each DumpMemory call to print a newline character and separate the output.
阅读全文