flat assembler
Message board for the users of flat assembler.

Index > Main > Error: unexpected end of file - source attached

Author
Thread Post new topic Reply to topic
Jorge F. Gonzalez



Joined: 28 May 2004
Posts: 2
Location: USA
Jorge F. Gonzalez 28 May 2004, 01:30
(second post)

I am compiling a simple program for testing a considerably more complicated black box add-on .inc file, and am also making use of some macros and def's in another .inc file (though I suppose these details might be unimportant), and am having Fasm quit, giving me an "Error: unexpected end of file" message, but no details about why it is saying this. What it is that makes Fasm quit with this message?

For those who like nothing better than making heads and tails out of assembly code where label names constitute most of the code documentation, the source files involved are attached this time, although the cause of the problem is probably something other than the code's specifics, i.e. what this code does. I figure something is probably missing, and guessed that it could be something along the lines of a missing procedure definition, except I would expect that FAsm would say that that in particular is the problem if such was indeed the case, instead of just vaguely complaining of a file unexpectedly ending.

Thanks to everybody who looks at this.


Description:
Download
Filename: general defs.INC
Filesize: 21.77 KB
Downloaded: 545 Time(s)

Description:
Download
Filename: black box.inc
Filesize: 35.98 KB
Downloaded: 546 Time(s)

Description:
Download
Filename: black box test.ASM
Filesize: 2.3 KB
Downloaded: 571 Time(s)



Last edited by Jorge F. Gonzalez on 28 May 2004, 05:45; edited 1 time in total
Post 28 May 2004, 01:30
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 28 May 2004, 02:27
paste source?

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 28 May 2004, 02:27
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
aaro



Joined: 21 Jun 2003
Posts: 107
Location: hel.fi
aaro 28 May 2004, 09:48
Newest versions of fasm have different proc syntax:
Code:
proc name, arg
enter
   return
endp
    
Post 28 May 2004, 09:48
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 28 May 2004, 13:18
aaro wrote:
Newest versions of fasm have different proc syntax


Let me point out a needed precisation: The changes are in the standard macros shipped with fasm.
Post 28 May 2004, 13:18
View user's profile Send private message Yahoo Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 May 2004, 13:52
you just have to add "endp" at end of procedure.
Post 28 May 2004, 13:52
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Jorge F. Gonzalez



Joined: 28 May 2004
Posts: 2
Location: USA
Jorge F. Gonzalez 28 May 2004, 17:45
But what is it that prompts the "unexpected end of file" error?

P.S.: the version of FAsm I am using does not use the endp directive or macro.
Post 28 May 2004, 17:45
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 29 May 2004, 11:42
If we don't have the full source and includes, then we can't help you...sorry!

But, if you check your code thorougly you might find some unended codegroups, that is why it reach the end of file unexpectedly - something isn't finished properly.
I have had this error even when not ending start: with ExitProccess...
Post 29 May 2004, 11:42
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo 29 May 2004, 17:08
Jorge F. Gonzalez wrote:
But what is it that prompts the "unexpected end of file" error?
P.S.: the version of FAsm I am using does not use the endp directive or macro.


I hope this help Wink

This does not depend on FAsm version. This depends on macros you are using. For example:

1. You are including Win32A.inc but you are using macros
Code:
.data
.code    

that are not defined on standard Win32A.inc but in Win32AX.inc

2. If you are using standard Win32A.inc, the proc macro must end with endp to close the opened stack frame.

3. If you customize standard macros, we need to see them in order to help you.

4. If you are using standard macros, there are some errors on "black box.inc" such as (there are a few more of the same):
Code:
; added endp to all procs

  macro BB_DiscardWindow
  {
  if BB_DebugMode = ON
   ; stdcall BB_ScrapWindow
    call BB_ScrapWindow
  end if
  }

  macro BB_LeftProc
  {
  if BB_DebugMode = ON
  ;stdcall call BB_RecProcReturn
    call BB_RecProcReturn
  end if
  }

  macro BB_DontMonitor VarName
  {
  if BB_DebugMode = ON
;    stdcall BB_DropVar VarName
    stdcall BB_DropVar,VarName
  end if
  }

  proc BB_RecProcReturn
; this procedure doesn't have a stack frame,
; so enter is not needed
;    enter
    test    [BlackBox.Flags], BB_IsOperable
    jz      .End
    dec     [BlackBox.ProcNameStackPos]
    or      [BlackBox.Flags], BB_FinishedProc
  .End:
  return
  endp

    
Post 29 May 2004, 17:08
View user's profile Send private message Yahoo Messenger Reply with quote
khanh



Joined: 25 Jul 2003
Posts: 27
khanh 01 Jun 2004, 10:58
I have the same problems as well, when trying to comply a package in Fresh source.

Anyway, the error should be clearly indicated? This may be something missing from Fasm.

Sorry for my English. Cool
Post 01 Jun 2004, 10:58
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


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.