flat assembler
Message board for the users of flat assembler.

Index > IDE Development > Problems Compiling app with fresh

Author
Thread Post new topic Reply to topic
silkodyssey



Joined: 02 Oct 2003
Posts: 205
Location: St.Vincent & the Grenadines
silkodyssey
I'm getting an invalid value error when i try to compile a program with fresh. This is the procedure where the error is.

Code:
 
proc ProcessKeys, wParam, lParam
     .nBytes dd ?
     begin

     push    esi
     push    edi

     mov     eax, [wParam]
     mov     edx, [memPtr]
     mov     ecx, [bufferPos]
     mov     byte [edx + ecx], al
     inc     [bufferPos]
     cmp     [bufferPos], 20
     jb      .buffer_not_full ;line that cases invalid value error 

     stdcall OpenLogFile, testFile
     lea     esi, [.nBytes]

     ; Determine if keys are being written
     ; to the same application

     invoke  lstrcmp, prevApp, [curApp]
     jz      .write_keystrokes

     ; write appname to file

     invoke  lstrlen, [curApp]
     invoke  WriteFile, [fileHandle], crLf, 2, esi, 0
     invoke  lstrlen, [curApp]
     invoke  WriteFile, [fileHandle], [curApp], eax, esi, 0
     invoke  WriteFile, [fileHandle], crLf, 2, esi, 0

 .write_keystrokes:
     invoke  WriteFile, [fileHandle], [memPtr], 20, esi, 0
     invoke  CloseHandle, [fileHandle]
     invoke  lstrcpy, prevApp, [curApp]
     mov     [bufferPos], 0
 .buffer_not_full:
     pop     edi
     pop     esi
     return
endp                              

    


The code compiles with fasmw. Anyone have any idea why its not compiling?

_________________
silkodyssey
Post 22 Jul 2004, 11:16
View user's profile Send private message MSN Messenger Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1095
Location: Poland
decard
can you attach whole program so we could try to compile it?
Post 22 Jul 2004, 11:59
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 875
Location: Colombia
pelaillo
Code:
 
     mov     eax, [.wParam]
    


Maybe the new fresh includes? Arguments are dotted as local variables. Fasm includes are still in the old manner.
Post 22 Jul 2004, 13:39
View user's profile Send private message Yahoo Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
Yea, arguments have to be dotted. But the error message "invalid value" looks strange.
What is the type of the file: .asm or .frm?
There is small bug in the .frm files editor that causes wrong line positioning on error.
What exactly is the error message?

Regards.
Post 22 Jul 2004, 13:56
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 205
Location: St.Vincent & the Grenadines
silkodyssey
The source type is asm not frm. I tried prefixing wParam with the dot character but that didn't help. I didn't think that was the problem because if it were the other procedures would have produced errors also and from a glimpse at the fresh source code I see that the procedures are defined the same way as mine without the dot.

The exact error message is this.

Code:
 
Error:invalid value <<jb .buffer_not_full>> processmessages.asm[36] 
    

_________________
silkodyssey
Post 22 Jul 2004, 20:40
View user's profile Send private message MSN Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
silkodyssey wrote:
... I see that the procedures are defined the same way as mine without the dot.


Definition of the argument in the "proc" statement have to be without dot, but when you are using this argument in the procedure, you MUST use it with dot. (for the latest version of stdcallex.inc) Simply the macro "proc" adds this dot for you at the front of every argument.

Here is small example:
Code:
proc ProcessKeys, wParam, lParam ; it is right...
begin
......
    mov   eax, [.wParam]    ; this is right to...
    mov   eax, [wParam]     ; this is wrong...
.........
endp    


Regards.
Post 22 Jul 2004, 21:30
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 205
Location: St.Vincent & the Grenadines
silkodyssey
I've added the dot to all function parameters but I am still getting the same error. I am using fresh1_0_1c.

_________________
silkodyssey
Post 22 Jul 2004, 21:45
View user's profile Send private message MSN Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
silkodyssey wrote:
I am using fresh1_0_1c.


Change it. It is too old (and probably buggy and with old version of FASM inside). Actually, I will remove it from the site very soon, because of comming the next stable version. If you are using 1.0.1c - your code is OK. Forget about dots - it is for latest versions.

Regards.
Post 22 Jul 2004, 22:03
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 205
Location: St.Vincent & the Grenadines
silkodyssey
I decided to try to current work version but i get the same error. I've attached the project directory so maybe you can try compiling it.


Description:
Download
Filename: keylog.zip
Filesize: 10.21 KB
Downloaded: 151 Time(s)


_________________
silkodyssey
Post 22 Jul 2004, 22:18
View user's profile Send private message MSN Messenger Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld
Very strange...
Removing 'jb ...' line causes error on 'jz ...' line. Some jumps bug?
Post 22 Jul 2004, 22:52
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
Ah, I found it. Smile Missing "begin" in the both: AddIconToSysTray and CreateMenus procedures.
After that you will have to fix dots on many places on procedure arguments, but this is easy. Smile

Regards.
Post 23 Jul 2004, 03:17
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 205
Location: St.Vincent & the Grenadines
silkodyssey
Ok it's working now, thanks for the help. Smile

_________________
silkodyssey
Post 23 Jul 2004, 04:54
View user's profile Send private message MSN Messenger 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


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.