flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > error: code cannot be generated

Author
Thread Post new topic Reply to topic
Jin X



Joined: 06 Mar 2004
Posts: 133
Location: Russia
Jin X 14 Oct 2019, 11:56
What does mean "error: code cannot be generated"?
Why it cannot be generated?
This error is occured on quite legal code. It so strange when I add a line like a db 1234 and fasm 1 shows this error.
Post 14 Oct 2019, 11:56
View user's profile Send private message Reply with quote
Jin X



Joined: 06 Mar 2004
Posts: 133
Location: Russia
Jin X 14 Oct 2019, 12:25
Now I've done something like this:

Code:
org     0xF0

; . . .

if      some and 0xFF = 0
        mov     ah,some / 256
else
        mov     ax,some
end if

; . . .

if      some and 0xFF = 0
        adc     dl,al
else
        adc     dl,0
end if

align   16

some:    

This simple code is compiled ok.
But more complex (with extra conditions, more code and so on) can't be compiled.
Post 14 Oct 2019, 12:25
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8359
Location: Kraków, Poland
Tomasz Grysztar 14 Oct 2019, 12:35
This error message means that the assembler was not able to find a stable solution within a given limit of passes. Sometimes the solution may not exist at all, and even if there was one and the number of passes was unlimited, the assembler might still not be able to find it.

You can learn more about it my article about optimistic multi-pass assembly.
Post 14 Oct 2019, 12:35
View user's profile Send private message Visit poster's website Reply with quote
guignol



Joined: 06 Dec 2008
Posts: 763
guignol 15 Oct 2019, 06:16
how to brand a stranger from russia which tries to fit a 16-bit value into a single byte?
and what's the point for tomasz answering such nano machines anyway?
Post 15 Oct 2019, 06:16
View user's profile Send private message Reply with quote
MatQuasar



Joined: 25 Oct 2023
Posts: 105
MatQuasar 27 Apr 2024, 23:23
Anohter example which resulted in "code cannot be generated" error message:

Code:
db 1
a = $ - a         
Post 27 Apr 2024, 23:23
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20462
Location: In your JS exploiting you and your system
revolution 28 Apr 2024, 03:53
Perhaps the simplest example is this?
Code:
x=x-1    
Post 28 Apr 2024, 03:53
View user's profile Send private message Visit poster's website Reply with quote
MatQuasar



Joined: 25 Oct 2023
Posts: 105
MatQuasar 28 Apr 2024, 09:26
revolution wrote:
Perhaps the simplest example is this?
Code:
x=x-1    


Wah, that is short!
Post 28 Apr 2024, 09:26
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.