On Sat, 3 Jul 2004 20:21:46 +0100, "daz" <dooby / d10.karoo.co.uk> wrote (more or less): .... >Mid-1980's -- BBC Micro (Acorn) - BASIC Interpreter > 6502 processor (OK, not the best ;) And, of course, it ran at twice teh clock speed of the Apple ][ :-) > 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 > > -- Cheers, Euan Gawnsoft: http://www.gawnsoft.co.sr Symbian/Epoc wiki: http://html.dnsalias.net:1122 Smalltalk links (harvested from comp.lang.smalltalk) http://html.dnsalias.net/gawnsoft/smalltalk