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 > Compiler Internals > [fasmg] Error: could not generate code...

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 419
Location: Belarus
[fasmg] Error: could not generate code...
Error: could not generate code within the allowed number of passes.

Well, it took me some time to find what had been causing this error, as no additional information was displayed.

It appeared, that I have a struct definition:


Code:

struct EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
  Version               rd 1
  HorizontalResolution  rd 1
  VerticalResolution    rd 1
  PixelFormat           rd 1
  PixelInformation      EFI_PIXEL_BITMASK
  PixelsPerScanLine     rd 1
ends




and I also have a macro


Code:

struct VERSION_INFO
  Major     rd 1
  Minor     rd 1
  Patch     rd 1
  Build     rd 1
ends

macro Version namever
  match maj.min.pver
    name VERSION_INFO Major:0x#majMinor:0x#minPatch:0x#pBuild:%t
  else
    err 'Valid version in x.y.z format is expected'
  end match
end macro




Not sure if this is as designed, but if it is, then extreme care should be taken when giving names to macros and structures entries
Post 22 Jan 2017, 17:08
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6179
Location: Kraków, Poland
Yes, this is an old problem that when you can redefine everything, it is easy to shoot yourself in the foot.

On the other hand, unlike fasm 1, fasmg has some facilities that allow to prevent this specific problem that you encountered. An implementation of "struct" could use "macro ?" or even "macro ?!" to intercept and parse all lines of its block. In fact I plan to prepare such macro myself, because my planned macro which would be compatible with fasm 1 "struct" would need to work exactly like that.
Post 22 Jan 2017, 19:47
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


Powered by phpBB © 2001-2005 phpBB Group.

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