At Wednesday, 31 July 2002, you wrote:
I know this may sound sadistic, but how could I go about programming in Smalltalk bytecode, directly? I've seen assemblers for Java, that
do the
same job as assemblers for native CPUs. I imagine such a tool doesn't exist for SMalltalk at this time, but perhaps it wouldn't be hard
to put
one together in my quest to play with bytecode.
One of the projects I did a while ago was writing PIC/Smalltalk, which basically is a Slang-style translater that translates Smalltalk source code into PIC assembler. PIC chips are tiny 8-bit RISC embedded micro-controllers (www.microchip.com), with miniscule amounts of memory (program memory measured in single-digit kilobytes and RAM between 50 and 500 bytes).
If you want to work at a low level with Smalltalk, doing stuff like that is fun and useful as well. And of course it works in Squeak, although its been a while since I did anything with it.
http://www.huv.com/smalltalk for more details...
Later, Jon
-------------------------------------------------------------- Jon Hylands Jon@huv.com http://www.huv.com/jon
Project: Micro Seeker (Micro Autonomous Underwater Vehicle) http://www.huv.com
Jon Hylands wrote:
One of the projects I did a while ago was writing PIC/Smalltalk, which basically is a Slang-style translater that translates Smalltalk source code into PIC assembler. PIC chips are tiny 8-bit RISC embedded micro-controllers (www.microchip.com), with miniscule amounts of memory (program memory measured in single-digit kilobytes and RAM between 50 and 500 bytes).
Thank you, thank you for that pointer, after looking at the PIC IDE I felt a little overwhelmed, but this gets my motivation way up :-)
Are you aware of the work Maurice Rabb did on developing a tiny smalltalk for micro controllers? He did a presentation at the Smalltalk Solutions, but I lost track of whether he is still working on it.
Michael
On Wed, 31 Jul 2002, Michael Rueger wrote:
Are you aware of the work Maurice Rabb did on developing a tiny smalltalk for micro controllers? He did a presentation at the Smalltalk Solutions, but I lost track of whether he is still working on it.
I know everyone here is capable of Googling, but to see the slides from the presentation, check out this link:
http://www.whysmalltalk.com/Smalltalk_Solutions/Rabb%20-%20Smalltalk%20on%20...
As far as I know, it'll only work with IE on Windows. Didn't work in opera- it wants to download some MS PowerPoint runtime. :/
Aaron
On Wednesday 31 July 2002 10:18 am, Aaron wrote:
On Wed, 31 Jul 2002, Michael Rueger wrote:
Are you aware of the work Maurice Rabb did on developing a tiny smalltalk for micro controllers? He did a presentation at the Smalltalk Solutions, but I lost track of whether he is still working on it.
I know everyone here is capable of Googling, but to see the slides from the presentation, check out this link:
http://www.whysmalltalk.com/Smalltalk_Solutions/Rabb%20-%20Smalltal k%20on%20Tiny%20Real-Time%20Systems.htm
As far as I know, it'll only work with IE on Windows. Didn't work in opera- it wants to download some MS PowerPoint runtime. :/
I tried it in IE 5.5 windows and I only see the first slide.
Jon Hylands jon@huv.com wrote...
One of the projects I did a while ago was writing PIC/Smalltalk, which basically is a Slang-style translater that translates Smalltalk source code into PIC assembler. PIC chips are tiny 8-bit RISC embedded micro-controllers (www.microchip.com), with miniscule amounts of memory (program memory measured in single-digit kilobytes and RAM between 50 and 500 bytes).
If you want to work at a low level with Smalltalk, doing stuff like that is fun and useful as well. And of course it works in Squeak, although its been a while since I did anything with it.
http://www.huv.com/smalltalk for more details...
This reminded me that, about ten years ago I wrote in a day or two a little assembler for a simple processor.
Anyway, since I said "a page or two", I thought I should put my money where my mouth is, so I'm sending along that old code. Unfortunately it's for a slightly different dialect from Squeak, but most of the code should still work if you file off the rough edges. There's nothing great about it, but if people think assemblers are hard, this should help to allay that fear.
One thing to notice (and this may take a little bit of tweaking for Squeak) is that it the class redirects the message compile:classified:notifying: so that once you define a subclass of the assembler, you can actually type assembly code into the browser, and it assembles when you do an 'accept' [in fact you can mix them -- it assembles any method in a category whose name begins with 'ASM-']. This kind of environmental leverage might not occur to a newbie.
Enjoy - Dan
On Wed, 31 Jul 2002, Dan Ingalls wrote:
This reminded me that, about ten years ago I wrote in a day or two a little assembler for a simple processor.
Anyway, since I said "a page or two", I thought I should put my money where my mouth is, so I'm sending along that old code. Unfortunately it's for a slightly different dialect from Squeak, but most of the code should still work if you file off the rough edges. There's nothing great about it, but if people think assemblers are hard, this should help to allay that fear.
Fun! I'll have to play with it.
People think assemblers are hard? I always imagined that it'd be a lot easier to write an assembler than a compiler. I'm a biologist, not a computer scientist or elec engineer, but I always thought that you don't do more than superficial optimization within an assembler, but simply translate human-readable opcodes, like translating "returnTop" in SqVM assembly to the byte 7C.
Aaron
On Wednesday 31 July 2002 01:09 pm, Aaron wrote:
People think assemblers are hard? I always imagined that it'd be a lot easier to write an assembler than a compiler. I'm a biologist, not a computer scientist or elec engineer, but I always thought that you don't do more than superficial optimization within an assembler, but simply translate human-readable opcodes, like translating "returnTop" in SqVM assembly to the byte 7C.
It can be more complicated than just translating opcodes.
For instance, you could do register/RAM allocation (overlaying function temps, for instance); on the PIC you have to deal with a banked program space as well as a banked RAM/register space. So you have to be able to stretch instructions for the extra bytes needed for extended jumps/calls or RAM references. Which may cause other jumps to have to become extended jumps.
A clever assembler could try to arrange all the RAM used by a particular function to be on the same RAM page, and all the functions called to be in the same ROM page.
Aaron wrote:
On Wed, 31 Jul 2002, Dan Ingalls wrote:
This reminded me that, about ten years ago I wrote in a day or two a little assembler for a simple processor.
Anyway, since I said "a page or two", I thought I should put my money where my mouth is, so I'm sending along that old code. Unfortunately it's for a slightly different dialect from Squeak, but most of the code should still work if you file off the rough edges. There's nothing great about it, but if people think assemblers are hard, this should help to allay that fear.
Fun! I'll have to play with it.
People think assemblers are hard? I always imagined that it'd be a lot easier to write an assembler than a compiler. I'm a biologist, not a computer scientist or elec engineer, but I always thought that you don't do more than superficial optimization within an assembler, but simply translate human-readable opcodes, like translating "returnTop" in SqVM assembly to the byte 7C.
Aaron
It definitely used to be a lot easier to write an assembler than a compiler. Once upon I did an assembler for a 6502 (Apple II), and it wasn't that difficult, but my stab at compilers ... shudder. (Well, it was fun, but it sure wasn't a quality compiler, and it took most of a quarter.)
squeak-dev@lists.squeakfoundation.org