News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Access Violation in Bmp.asm ?

Started by Kernel, April 16, 2007, 08:00:13 PM

Previous topic - Next topic

Kernel

Hi,

I'm still trying to get into the framework.
I could compile a running base, but as I'm adding something to play with, it still compiles fine, but crashes then.
For example a simple bmp-loading:
It compiles fine, but throws me an access violation, which I could locate in the Bmp.asm.
...
...
Load_BMP proc uses ebx esi edi BMP_FName:dword, BMP_Struct:dword, Color_Key:dword
local BMP_Buffer:dword
local FSize:dword
local DatOffset:dword
local _Modulo:dword
local _Width:dword
local _Height:dword

mov esi, BMP_Struct
mov [esi + BMP.Datas], NULL

; Load texture into memory
...
...

This one makes the access violation:
mov [esi + BMP.Datas], NULL

Any idea what I could have missed ???

PS: The compiled examples in the bin folder are running fine.

Thanks

Kernel

Ok, the LOCALS of "Load_BMP" are in the .code-section ?

mov esi, BMP_Struct ->  MOV ESI,DWORD PTR SS:[EBP+C] -> MOV ESI,0040421B
mov [esi + BMP.Datas], NULL ->  MOV DWORD PTR DS:[ESI],0 -> MOV 0040421B,0

Hum, I added in every included .asm many missing ".data" and ".code" - now it works...    ::)

But I'm still confused. Why did I have to do that ? And how could u compile it without the
missing ".data" and ".code" ???  :eek

bacchus

ah yeah .. had the same problem ... cant compile the stuff without adding sections in every inlcude-file...
have problem with camera and the quaternions. let me know how u fix that problem, plz

greets Bacchus

grofaz