Hi group,
Why do access violation errors occur? I am getting the error: Unhandled exception 0xC0000005 : Access Violation.
This error is occuring for this piece of code:
;;;;;;;;Begin ASM
;;;;;;;;;End ASM
Another thing I noted was the msdev debugger shows the value of the ECX register to be 0040102D after the instruction 'mov ecx, dword ptr [aSize]' has executed. Shouldnt the value be 0000000A? And the value in ESI is 0000000A, but shouldnt the value be the offset of array?
In disassembly the instruction shows as: 'mov esi, dword ptr [pArry]' in replacement for 'mov esi, [ebp+12]' which is what I expected, but i'm confused to why the value of ESI is not the offset of array! I'm sure this has something to do with why im getting that access violation error.
Can anyone please help?
K.
Why do access violation errors occur? I am getting the error: Unhandled exception 0xC0000005 : Access Violation.
This error is occuring for this piece of code:
;;;;;;;;Begin ASM
Code:
INCLUDE Irvine32.inc
FillArray proto,
aSize:dword, pArry:ptr dword
.data
ArraySize = 10
Array dword ArraySize dup(?)
.code
main proc
Call Randomize
Invoke FillArray, ArraySize, addr Array
main endp
FillArray proc,
aSize:dword, pArry:ptr dword
push ebp
mov ebp, esp
pushad
mov esi, [ebp+12]
mov ecx, [ebp+8]
call dumpregs
cmp ecx, 0
jle Finish
Fill:
mov eax, 10000
call RandomRange
mov [esi], eax ; <- This is the line the debugger stops at.
add esi, type dword
Loop Fill
Finish:
popad
ret
FillArray endp
end main
Another thing I noted was the msdev debugger shows the value of the ECX register to be 0040102D after the instruction 'mov ecx, dword ptr [aSize]' has executed. Shouldnt the value be 0000000A? And the value in ESI is 0000000A, but shouldnt the value be the offset of array?
In disassembly the instruction shows as: 'mov esi, dword ptr [pArry]' in replacement for 'mov esi, [ebp+12]' which is what I expected, but i'm confused to why the value of ESI is not the offset of array! I'm sure this has something to do with why im getting that access violation error.
Can anyone please help?
K.