flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Error: symbol 'NUMBER_OF_SECTIONS' is undefined or out of sc

Author
Thread Post new topic Reply to topic
uor99



Joined: 04 Dec 2014
Posts: 42
uor99 15 Oct 2016, 03:11
Need help to solve the below problem. Thanks.

flat assembler g version 0.99.1476464200
ekey.asm [5] macro format [70] W:\ed\CL\FASM\Include/format/pe.inc [308]:
.NumberOfSections dw NUMBER_OF_SECTIONS
Processed: .NumberOfSections dw NUMBER_OF_SECTIONS
Error: symbol 'NUMBER_OF_SECTIONS' is undefined or out of scope.
Post 15 Oct 2016, 03:11
View user's profile Send private message ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 Oct 2016, 09:34
A bit more of context is needed, you did not show how do you use these macros.

Also, sometimes the first error that gets reported is actually a consequence of an error elsewhere, because of the forward-referencing. Please try assembling with higher "-e" setting to display information about more errors.

For example, a similar error shows up if I add the unbalanced "IF" near the end of a simple PE source:
Code:
include 'format/format.inc'

format PE GUI 4.0

ret

if 0    

The error that gets reported when we show only one is the first one encountered, but this first error is in fact a consequence of an error elsewhere (the unbalanced "if 0" caused postponed lines to not get executed properly):
[fasmg test.asm nul] wrote:
test.asm [3] macro format [70] include\format/pe.inc [308]:
.NumberOfSections dw NUMBER_OF_SECTIONS
Processed: .NumberOfSections dw NUMBER_OF_SECTIONS
Error: symbol 'NUMBER_OF_SECTIONS' is undefined or out of scope.

With the "-e100" setting the actual original error that caused the "avalanche" is seen at the end:
[fasmg test.asm nul -e100] wrote:
test.asm [3] macro format [70] include\format/pe.inc [308]:
.NumberOfSections dw NUMBER_OF_SECTIONS
Processed: .NumberOfSections dw NUMBER_OF_SECTIONS
Error: symbol 'NUMBER_OF_SECTIONS' is undefined or out of scope.
test.asm [3] macro format [70] include\format/pe.inc [339]:
.SizeOfImage dd SIZE_OF_IMAGE
Processed: .SizeOfImage dd SIZE_OF_IMAGE
Error: symbol 'SIZE_OF_IMAGE' is undefined or out of scope.
test.asm [3] macro format [70] include\format/pe.inc [374]:
db (NUMBER_OF_SECTIONS-1)*SectionTable.ENTRY_LENGTH dup 0
Processed: db (NUMBER_OF_SECTIONS-1)*SectionTable.ENTRY_LENGTH dup 0
Error: symbol 'NUMBER_OF_SECTIONS' is undefined or out of scope.
test.asm [3] macro format [70] include\format/pe.inc [397]:
relocated_addresses:: rd NUMBER_OF_RELOCATIONS
Processed: rd NUMBER_OF_RELOCATIONS
Error: symbol 'NUMBER_OF_RELOCATIONS' is undefined or out of scope.
test.asm [3] macro format [70] include\format/pe.inc [401]:
relocation_types:: rw NUMBER_OF_RELOCATIONS
Processed: rw NUMBER_OF_RELOCATIONS
Error: symbol 'NUMBER_OF_RELOCATIONS' is undefined or out of scope.
test.asm [3] macro format [70] include\format/pe.inc [725]:
end postpone
Processed: end postpone
Error: unexpected instruction.
test.asm [3]:
format PE GUI 4.0
macro format [179]
Custom error: invalid argument.
test.asm [7]:
if 0
Error: missing end directive.
Post 15 Oct 2016, 09:34
View user's profile Send private message Visit poster's website Reply with quote
uor99



Joined: 04 Dec 2014
Posts: 42
uor99 15 Oct 2016, 14:44
please help compile this app in fasmg.


Description:
Download
Filename: test.rar
Filesize: 2.92 KB
Downloaded: 472 Time(s)

Post 15 Oct 2016, 14:44
View user's profile Send private message ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 15 Oct 2016, 16:48
This source uses many of the macros of fasm 1 that have no counterparts for fasmg defined in this "macros.inc", in particular "proc" and resource macros. The resource macros of fasm 1 are very simple, adapting them to fasmg should be quite simple, but "proc" may require a bit more work.

You also lack the Win32 equates, like KERNEL32.INC, but these can be copied directly from fasm 1 packages.
Post 15 Oct 2016, 16:48
View user's profile Send private message Visit poster's website 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.