This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Access Violation error

Thanks for the guidance.

I made some progress by single stepping through the Disassembly listing..

BUT PLEASE DON"T STOP READING FROM HERE, COZ STILL NEED YOUR GUIDANCE SO PLEASE CONTINUE READING..

A)
I
found out that the return address is not getting correctly popped out of the System Stack on executing the RETS instruction at the end of the function.

This led to an arbitrary value getting written to the IP at which place there is no code.. so gettign the access violation.

To find out where exactly the SP is getting garbled I single stepped once more and found out that the IP jumps to a function in between even though that function is not called for.

The exact assemply listing is below..

181: ngFireInput_temp = ngFireInput;
182:
183:
0000058C D7000E00 EXTS #0x000E,#1
00000590 F2F40D2B MOV R4,DPP0:0x2B0D
00000594 F6F47889 MOV DPP2:0x0978,R4

on executing the MOV instruction at the address 00000590 above, the code jumps to a location 00000028. This location happens to be the entry point of "isalpha" fn.

The execution continues and there is popping of the stack at the end of the fn even though there was no corresponding PUSHING.. this was causing the stack pointer to go haywire..

B)
Now
I am looking for a reason why the code is jumping after executing the MOV.. one reason that I can think of is that the variable ngFireInput is of int type but is located at the address 0x0E2B0D which is an ODD address !!
Could this be causing a TRAP to be generated??

1. If this is the reason how can I fix it?
2. Why would the locater locate an int at an ODD address. Integers are to be aligned at even addresses if I am right?

Please if you can give some insight on the problem while I am tryin to fix it

Regards

0