home .. forth .. colorforth mail list archive ..

Re: [colorforth] New Linux 4word


On Fri, 8 Apr 2005 11:57:41 +0200
albert@xxxxxxxxxxxxxxxxxx (Albert van der Horst) wrote:
> An assembler is the proper starting point. There is no Metacompiler
> without assembler. And an assembler may be enough.
> Unless of course you think you have a nice source if it is sprinkled
> with
>         cd45 2,      12 1, 3135 2,

While porting 4word to linux I encountered the above problem of inline
opcode compilation without comments. Had to go back and decode the 16-bit mode
opcodes and translate them into 32-bit mode opcodes.

Rather than putting together a sub-set of an assembler I just commented the
new inline opcodes with their intel mneumonics. Maximum efficiency of size and
readability.

Old 16-bit definition:
macro : 2*    [ $ e0d166 L ] 3, ] ;

New 32-bit definition:
macro : 2*    [ $ e0d1 L ( shl eax,1) ] w, ] ;

The really tough discipline is keeping the comments up to date...

Regards,
Terry Loveall

---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com