The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: egons on May 24, 2011, 11:18:20 AM

Title: one reason why sqlite3 sucks..
Post by: egons on May 24, 2011, 11:18:20 AM
  invoke sqlite3_open,eax,ADDR datab;ADDR DBName
        mov eax,datab
        invoke sqlite3_exec,eax,addr sqlc,addr CallBackCount,0,0; count record of node.tab
        mov eax,datab
       invoke sqlite3_exec,eax,addr sql2,addr CallBack,0,0; get nodes

while working in CallBack procedure you've meet w/unhandled exception only if you want to change CPU registers. I hate it :dazzled:
Title: Re: one reason why sqlite3 sucks..
Post by: hutch-- on May 24, 2011, 11:23:05 AM
Just make sure you are using the correct calling convention and passing the correct number and sizes of data, I would be surprised if the function(s) worked OK at high level but not with registers. Also check if your own code preserves the normal registers as again if it works at high level with other compilers, it will be Intel ABI complaint.
Title: Re: one reason why sqlite3 sucks..
Post by: egons on May 24, 2011, 12:14:11 PM
I've meet w/moby_dic example, which crashed ebx. no idea why code works. now looks like i must to store *all* registers *facepalm.jpeg*
Title: Re: one reason why sqlite3 sucks..
Post by: egons on May 24, 2011, 12:25:44 PM
btw application correctly work w/one record in a table instead couple of it :tdown
Title: Re: one reason why sqlite3 sucks..
Post by: hutch-- on May 25, 2011, 04:50:48 AM
Try using conventional register preservations in your own code to ensure you are not messing up important registers.


    push ebx
    push esi
    push edi

  ; write your code here

    pop edi
    pop esi
    pop ebx

    ret
Title: Re: one reason why sqlite3 sucks..
Post by: egons on May 25, 2011, 06:09:23 AM
oh, my thinko was vetry weird :bdg. I've found pretty one example. it helps to enumerate all records of table.
thanks for your reply :U
Title: Re: one reason why sqlite3 sucks..
Post by: farrier on May 26, 2011, 12:42:50 AM
egons,

You're welcomed!

farrier