Stefan Schmiedl wrote:
> I know I shouldn't, but I'm going to anyways ...
>

Go 4 it ;-)


> On Fri, 2 Jul 2004 08:08:01 +0900,
> Lothar Scholz <mailinglists / scriptolutions.com> wrote:
> >
> [...]
>
> >
> > Lisp guys write some routines in this "typed Lisp", rubyist's write
> > them in "C", so it's not so different.
> >
>
> And you usually have a built in assembler available in Forth :-)
>

Mid-1980's -- BBC Micro (Acorn) - BASIC Interpreter
              6502 processor (OK, not the best ;)
  Implemented in 8K ROM (including two pass assembler)

This snippet loads a 512-byte machine code file into a fixed
location in the adequate 32K RAM and assembles 3 patches over
the memory copy of the file ready for saving or running.
It uses the offset-assembly feature which generates code to
be run in a block of memory other than where it is being
assembled.  (No segment registers provided on 6502)

BASIC functions and variables are available within the [asm] block.
FNorg just updates the instruction address for the next patch and
returns "self" to the OPT (assembler options) directive.
Functions such as this and the ability to drop in and out of
BASIC gives a macro-like flexibility.


*LOAD AProg
   10:
   70 LD%=&37AD
   80:
   90 o%=3:  \ flags
  100:
  110 FOR pass%=4 TO 4+o% STEP o%
  120:
  130 [ OPT FNorg(&42A)
  140   JMP &43F
  150\
  160   OPT FNorg(&52E)
  170   LDX #0
  180\
  190   OPT FNorg(&5C1)
  200   TXA
  210 ]
  220 NEXT
  230:
  300 END
  310:
  320 DEF FNorg(p%)
  330  O%=LD%+(p%-&400)
  340  P%=p%
  350 =pass%


> Have a nice weekend, everyone.
> s.

( Difficult without an assembler in Ruby ?~)

cheers,  :-)

daz