flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > Help with Iczelion tut 35

Author
Thread Post new topic Reply to topic
alszla



Joined: 24 Sep 2016
Posts: 5
Help with Iczelion tut 35
Hi,

Sorry to bother you again, I would like to ask for your help on this one. I am trying to "translate" Iczelion tutorial 35 (Rich Edit Control + Syntax highlighting). It passes the compilation process but for some reason, it does not highlight the keywords.
When debugging it, I can see that the code reaches to the lstrcmp API (one in the whole code) with the 1st parameter always null (the one that correspond to the keyword extracted from the 'wordfile.txt' file). That leads me to think that something in the procs
FillHiliteInfo, ParseBuffer or NewRichEditProc is not working properly, I think it may have something to do with the way the WORDINFO structures (for each keyword) are saved, but I'm not exactly sure.

Hopefully someone who has already played with this Iczelion tutorial can bring some light here. I'm posting my translation code along with the required files.

Thanks in advance.

Regards,
alszla


Description:
Download
Filename: ftut35.zip
Filesize: 21.96 KB
Downloaded: 41 Time(s)

Post 15 Oct 2016, 17:46
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14923
Location: 6EQUJ5
I expect your problem is the line 621:

Code:
        invoke lstrcpy,edx,addr buffer

Note that the addr syntax uses edx to obtain the address of buffer. That is it will assemble to this code:

Code:
lea edx,[buffer]
push edx

So your value of edx is now corrupted.

BTW: There is no need to transfer the the value in eax to edx before doing the invoke. You can use eax directly:

Code:
        invoke lstrcpy,eax,addr buffer

Post 16 Oct 2016, 00:33
View user's profile Send private message Visit poster's website Reply with quote
alszla



Joined: 24 Sep 2016
Posts: 5
Absolutely right!!!, Thanks revolution.

I can see it clearly now, this tut being originally written for MASM32 performs that transfer (from eax to edx) after invoking HeapAlloc because MASM32 assembles 'addr' using eax:

Code:
lea  eax, [buffer]
push eax


as opposed to FASM, which assembles just like you said using edx register instead.

For sure, I could have been staring at the code for who knows how long and still not catching that detail and perhaps ruining the rest of the code.
Thank you very much Revolution.

Regards,
alszla
Post 16 Oct 2016, 03:31
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.