From: Richard Nichols Newsgroups: comp.os.msdos.djgpp Subject: Getting to the bottom of this Date: Sat, 10 Jan 1998 12:03:04 +1000 Organization: None Lines: 71 Message-ID: <34B6D6D8.6B48@mailhost.net> Reply-To: tiberius AT mailhost DOT net NNTP-Posting-Host: 138.77.56.32 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hmm.. after my numerous posts on bugs and stuff I've decided that it must be NASM that's screwing my library (or my use of NASM). My library is a hulking beast like allegro (only about 45% of that functionality yet though) which is making debugging difficult. I would wager that I have numberous bugs which are causing weird errors. Here is the way I am using nasm: -I only preserve ds when I use it. I often clobber es and all offset regs -I store ebp and mov ebp, esp to reference the function's args if I've messed around on the stack I mov esp, ebp at the end before popping ebp -does using ebp with debug info on cause any worries? -I have MIDAS sound system running in the background. Is this a problem? Here is a sample procedure to write to the LFB. I've gotten myself a selector to the LFB. I know this function causes problems so what's wrong??? ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; gfxSendToLFB : Sends the data pointed to to the lfb ; ; void gfxSendToLFB(UCHAR *data, int length); ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;_gfxSendToLFB: ; push ebp ; mov ebp, esp ; push dword [_vidLFB_Seg] ; es = LFB segment ; pop es ; ; cld ; ; xor edi, edi ; edi = 0 ; mov esi, [ebp + 8] ; esi = data ; mov edx, [ebp + 12] ; edx = count ; mov ecx, edx ; ecx = count/4 ; shr ecx, 2 ; ; rep movsd ; copy data ; mov ecx, edx ; ecx = count mod 4 ; and ecx, 3 ; ; rep movsb ; copy left over data ; ; mov esp, ebp ; pop ebp ; ret And another thing, I'm using NASM 0.97 and when I do [SECTION .text ALIGN=4] I get an error: standard coff format does not support section alignment the examples from djppasm.doc all have this error. Has something changed in a subsequent version of NASM? hmm.. I know I've got a lot of problems there but I'm really starting to get annoyed with this... -Rich -- .------------------------------+--------------------------------. | Richard Nichols | Inspire Media (Demos/Games) | | mailto:tiberius AT mailhost DOT net | mailto:InspireMedia AT post1 DOT com | | http://tiberius.home.ml.org/ | http://inspire.home.ml.org/ | +------------------------------+--------------------------------+ | Organizer, coder for Inspire Media | `---------------------------------------------------------------' "The life of the coder is that of the hermit, except the hermit can't make shadebobs." -- Leviathan