Tiny Assembly
So, what is Tiny? Tiny is an assembly language for an imaginary cpu designed to help teach the concepts
of assembly language. It was created by Dr. Steve Baber and Dr. Tim Baird at Harding University to use
in the Assembler class. The instructions and specifications are listed here as well. All information
and code that was written by them is used by permission.
Tiny Tutorial
Tiny Opcodes
Ascii Chart
Assembler(Rebol) - [11/15/05] - I was learning Rebol and decided this would be the perfect project to learn
how to use the parse and a lot of other rebol functions.
Asm.r - Version 1
Assembler 2(Rebol) - [4/27/07] - This is not an updated version of the first assembler, this was written from scratch as an exercise in writing a dialect.
This actually reads in tiny code as a dialect and assembles it while parsing. Very very cool. This is also much more predictable than the first version.
Asm2.r
Tiny Assembler(C++) - [6/14/04] - Just a C++ version of the assembler that I did a long time ago.
Tiny Assembler Source
TinyAssembler.exe
Tiny Emulator(C++) - [11/15/03] - I started this while I was in the asm class and ended up finishing it about
a year later. It's a very short piece of code. Just a console app to run your .tnc tiny executables. Source is
included. This is a very good example of how an emulator works. Although it does get to bypass having graphics
or sound. =)
Tiny Emulator Source
TinyEmulator.exe
Tiny Emulator(Rebol) - [4/24/07] - I wanted to work with rebol and needed another
project. Plus I didn't want to always have to compile the emulator. The was interesting because rebol's arrays are 1 based
and tiny's memory is zero based, and I made get/set functions for the array so I didn't have to worry about the offset. Anyway, it's a nice little piece of code.
tiny_emulator.r
Tiny Emulator(Tiny) - [11/15/03] - I did this right after I made the C++ emulator. I realized that the
emulator code was so short I could fit it within tiny. So I did. The only problem is that you have to specify the amount
of memory to use since you obviously can't use all of it. I think the max you can use is 500. You also have to
enter the program to run in manually and it has to already be in machine code. But hey, just use the asm and cut
and paste.
TinyEmulator.tny
TinyTim OSv1(Tiny) - [11/15/03] - I wrote this a couple of years ago and it's just a very simple operating
system that allows you to run preloaded programs, create/open/read text files, create/navigate directories. You
know, the kind of thing you do in an OS. Well, this is actually version one of the program. It was very hacked
together as a proof of concept. I started to rewrite the entire thing to be much more dynamic and flexible, but
about halfway through I got sidetracked and I never finished it.
TinyOS.tny
Tiny C Compiler(Python) - [2011] - This is somewhat of a play on words because the compiler is for Tiny but it also
is only for a small subset of the C language. Currently it only handles int(*), char(*), single dimension arrays, functions,
if/else, and while loops. Still extremely useful though.
Soon
Tiny asm Dialect for Rebol (Rebol) - My first dialect. This allows you to write tiny code inline with your rebol code. You can also load and store data from and to rebol variables.(Integers) You can also declare bytes, strings, and spaces with rebol variables. Which means you can do this:
do %tiny_dialect.r
m: 5
t: 3
s: "this is sweet"
tiny {
program_main: |
lda | hello | |
jsb | printc | |
lda | rebol_string | |
jsb | printc | |
| | |
ld | m | |
add | tiny_var | |
st | m | |
stop | | |
;hello_world constants |
hello: | dc | 'hey, ' |
| db | 0 |
rebol_string: | dc | s |
| db | 0 |
tiny_var: | db | t |
random_space: | ds | m |
}
print m
|
And it will output "hey, this is sweet" in the tiny code and then the print m will give you 8. I know, beyond amazing huh? well, I think it's really cool. The only thing you can't really do yet is save something back to rebol that's not a string. I can't really decide any good way to do it. I thought about using sti, but that's not really the point of it, it may just have to stay like this. Anyway, my first dialect turned out really cool.
tiny_dialect.r
Tiny Syntax Highlighter - I created a Tiny syntax highlighter for Textpad. If you don't use textpad I suggest
you check it out. It has definitely made my life much easier. I'm addicted.
Tiny Syntax