<p>Am 26.08.2013 00:57 schrieb "Steve Smith" <<a href="mailto:fski12@yahoo.com">fski12@yahoo.com</a>>:<br>
>>>> There's also the issue of the assembler reader (used, if I understand<br>
>>>> things correctly, to parse inline assembler mostly in the lower-level<br>
><br>
> >>> bits of the RTL). This seems to cause almost as much problem during<br>
> >>> development as the assembler writer, and having to support (or at<br>
> >>> least pass through) complex assembler macros isn't going to make<br>
> >>> things any easier.<br>
>>><br>
>>><br>
>>> I don't really see why passing macro calls through to an external<br>
>>> assembler is any different than passing 'raw' code. It's just text<br>
>>> isn't it?<br>
>><br>
>><br>
>> Writing assembler by hand is not necessarily the same as letting a compiler<br>
>> write assembler code. At least in FPC the assembly language of each<br>
>> processor is abstracted in operations which are hold in lists and using an<br>
>> assembler writer (of which there can be multiple to target different<br>
>> assemblers) this list is turned into the final file.<br>
><br>
><br>
> I'm aware of that, but I don't see how that makes a difference to how the compiler generated assembler is treated differently to the stuff inside a TP ASM block, inline assembler, or am I misunderstanding Mark's point.<br>
></p>
<p>Assembler blocks in FPC are handled by a assembler reader which needs to be implemented for each assembler language variant that needs to be supported (e.g. on x86 systems we support Intel and AT&T syntaxes whereby each has its own reader implementation). These readers convert a parsed assembler operation to an abstract assembler operation which is independent of the assembler syntax, but CPU dependant. At the end an assembler writer converts the linear lists of assembler operations to a assembly language file for the chosen assembler which may contain additional information not present in the assembler block and which also does not need to be the same assembler syntax that was parsed originally. </p>
<p>So for a new CPU platform you need to implement at least an assembler writer, an assembler reader (which could be at first so primitive that it can only handle the necessary RTL assembler blocks) and a linkscript writer which is passed to the external linker to link together all generated object files.</p>
<p>><br>
>>> "Here's some code, assemble it, and be quick about it johnny!"<br>
>><br>
>><br>
>> Was that a Short Circuit reference? O.o<br>
><br>
><br>
> Once again in English please. I just don't understand that last sentence at all. Sorry.</p>
<p>As waldo already wrote "Johnny" is the name the robot of the movie "Short Circuit" gave itself at the end of the first movie and is used extensively in the second one. Also he his told by his friend to assemble toy robots that resemble Johnny which is why I thought it was a reference.</p>
<p>Regards,<br>
Sven</p>