flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Smallest "code cannot be generated" example

Author
Thread Post new topic Reply to topic
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 17 Jan 2005, 21:46
This thread should not contain some new information, it shall only (try to)
explain something related to the assembler.

The following code cannot be generated.
Code:
if ~SomeLabel
 db 0
end if

SomeLabel:
    

The assembler would hang if there were no passes_limit :<, and that's exactly
why Flat Assembler needs it!

This causes also problems in many other sciences.
(For example, an electronical amplifier with negative feedback will
oscillate, the good old "don't hold your mic to close to the speaker"
phenomen. It also occurs in the logistic growth model etc...)

Explanation for beginners: This is a classical negative feedback problem.
Fasm tries to resolve the address of SomeLabel, but this address also depends
on if SomeLabel has already been defined, but it won't succed since the
define byte instruction changes the address of SomeLabel.

_________________
MCD - the inevitable return of the Mad Computer Doggy

-||__/
.|+-~
.|| ||
Post 17 Jan 2005, 21:46
View user's profile Send private message Reply with quote
beppe85



Joined: 23 Oct 2004
Posts: 181
beppe85 18 Jan 2005, 10:13
Maybe this is the defined's meaning of life.

Code:
if ~ defined SomeLabel
 db 0
end if

SomeLabel:    
Post 18 Jan 2005, 10:13
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.