Skip to content
Zwetan Kjukov edited this page Jan 12, 2016 · 3 revisions

Running Programs

Redshell

The Redtamarin Shell or redshell is the default interpreter.

  • it's the ActionScript Virtual Machine (AVM2)
    accessible from the command-line
  • you can configure it with numerous arguments
    for ex: -Dastrace 1, -api SWF_12, etc.
  • it can run ActionScript 3.0 files .as
  • it can run ActionScript Bytecode files .abc
  • it can also run .swf files

Here some examples:

executing one ABC file
$ ./redshell helloworld.abc

passing arguments to one ABC file
$ ./redshell helloworld.abc -- a b c

configuring the shell to use the API SWF_12
$ ./redshell -api SWF_12 helloworld.abc

configuring the VM and passing arguments
$ ./redshell -api SWF_12 helloworld.abc -- a b c

Originally with the Tamarin project it was named avmshell
and when we added our own API with the Redtamarin project
we then renamed it to redshell.

Because redshell is the AVM2 it can also run uncompiled source code,
for example:

executing one ActionScript file
$ ./redshell helloworld.as

passing arguments to one ActionScript file
$ ./redshell helloworld.as -- a b c

configuring the shell to use the API SWF_12
$ ./redshell -api SWF_12 helloworld.as

configuring the VM and passing arguments
$ ./redshell -api SWF_12 helloworld.as -- a b c

Because avmshell was meant as a testing tool
for the Flash Player and Adobe AIR, to test
the AVM2 behaviour, you end up having the same
advanced options also in redshell

Some of those options will not require AS, ABC or SWF files to interpret,
for example:

obtaining the version and the list of compiled features
$ redshell_dd -Dversion
output:

shell 2.1 debug-debugger build cyclone
Description: redtamarin-0.4.1.1T180-beta
features AVMSYSTEM_32BIT;AVMSYSTEM_UNALIGNED_INT_ACCESS;AVMSYSTEM_UNALIGNED_FP_ACCESS;
AVMSYSTEM_LITTLE_ENDIAN;AVMSYSTEM_IA32;AVMSYSTEM_MAC;AVMFEATURE_DEBUGGER;
AVMFEATURE_ALLOCATION_SAMPLER;AVMFEATURE_JIT;AVMFEATURE_COMPILEPOLICY;
AVMFEATURE_ABC_INTERP;AVMFEATURE_SELFTEST;AVMFEATURE_EVAL;AVMFEATURE_PROTECT_JITMEM;
AVMFEATURE_SHARED_GCHEAP;AVMFEATURE_MEMORY_PROFILER;AVMFEATURE_CACHE_GQCN;
AVMFEATURE_SAFEPOINTS;AVMFEATURE_INTERRUPT_SAFEPOINT_POLL;AVMFEATURE_SWF12;
AVMFEATURE_SWF13;AVMFEATURE_SWF14;AVMFEATURE_SWF15;AVMFEATURE_SWF16;AVMFEATURE_SWF17;
AVMFEATURE_SWF18;AVMFEATURE_SWF19;AVMTWEAK_EXACT_TRACING;

running the self tests
$ redshell_dd -Dselftest

running the REPL, eg. the run-eval-print-loop
$ redshell_d -repl

TODO

Clone this wiki locally