flat assembler
Message board for the users of flat assembler.

Index > Main > Postpone is an illegal instruction

Author
Thread Post new topic Reply to topic
Trinitek



Joined: 06 Nov 2011
Posts: 257
Trinitek 17 Oct 2015, 23:27
Code:
postpone {
    align 16
    endOfProgram:
}    
The above produces "error: illegal instruction" from FASM 1.70.03, and an infinitely less insightful "code cannot be generated" from FASM 1.71.39.

What is going on here?
Post 17 Oct 2015, 23:27
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20430
Location: In your JS exploiting you and your system
revolution 18 Oct 2015, 00:00
There is no point testing that in any version less than 1.71.14. Postpone was introduced in version 1.71.14.

And for the "code cannot be generated" error, we will need to see your code to see what you have done. Usually this error is because of some variable length code or definition that oscillates between two values.
Post 18 Oct 2015, 00:00
View user's profile Send private message Visit poster's website Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 257
Trinitek 18 Oct 2015, 00:20
Hmm, it turned out to be a bad if statement in an unrelated section. The two errors from the different versions aren't related. Nothing to see here.
Post 18 Oct 2015, 00:20
View user's profile Send private message Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 517
Location: Munich
shutdownall 18 Oct 2015, 08:30
What sould happen exactly after postpone ?
Is any code following ?
I think the combination of postpone and align could maybe cause problems.
Post 18 Oct 2015, 08:30
View user's profile Send private message Send e-mail Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 18 Oct 2015, 08:31
"Code can not be generated" is an error related to the whole source, not to the postpone macro itself.
Post 18 Oct 2015, 08:31
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 257
Trinitek 18 Oct 2015, 09:05
If anyone is interested, here are the code snippets of interest.
Code:
; palette.inc
macro color cName*, r*, g*, b* {
    c.#cName = paletteIndex_
    postpone \{
        if ~ defined c_palette_ | defined @f
            @@:
            c_palette_:
        end if
        c.#cName#.palette: db r shr 2, g shr 2, b shr 2
    \}
    paletteIndex_ = paletteIndex_ + 1
}

color ALPHA, 0, 0, 0
color BLACK, 0, 0, 0
color BLUE, 0, 0, 255
color DARKBLUE, 0, 0, 127
color LIGHTBLUE, 127, 127, 255    
Code:
; At the end of the main file of the project, ricochet.asm
postpone {
    align 16
    endOfProgram:
}    
Post 18 Oct 2015, 09:05
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 18 Oct 2015, 14:51
Trinitek, this code compiles for me. If you get "code cannot be generated", there is something wrong elsewhere in your code.
Post 18 Oct 2015, 14:51
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 257
Trinitek 18 Oct 2015, 18:03
Oh no, I've already fixed it. I had made a syntax mistake in that if statement. I just wanted to post it to show what was going on and what I was working with.
Post 18 Oct 2015, 18:03
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.