The MASM Forum Archive 2004 to 2012

Project Support Forums => OpenGL Forum => Topic started by: Kernel on April 16, 2007, 08:00:13 PM

Title: Access Violation in Bmp.asm ?
Post by: Kernel on April 16, 2007, 08:00:13 PM
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
Title: Re: Access Violation in Bmp.asm ?
Post by: Kernel on April 17, 2007, 08:40:24 AM
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
Title: Re: Access Violation in Bmp.asm ?
Post by: bacchus on October 09, 2007, 12:26:13 AM
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
Title: Re: Access Violation in Bmp.asm ?
Post by: grofaz on November 08, 2008, 06:39:35 PM
I'd like to know as well.