carld / sassy

x86 assembler in Scheme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

*************
* Sassy-0.2 *
*************

Sassy is a portable assembler for x86 processors written in
R5RS Scheme with the addition of a few SRFIs, written by Jonathan
Kraut (jak76@columbia.edu)

Sassy is released under the LGPL.

Note: The doc/html directory contains the complete documentation.

  Installation


    2.1  Supported Schemes

Sassy ships with support for the following Scheme interpreters (with the
indicated minimal version number):

    *

      PLT Scheme <http://www.plt-scheme.org/software/mzscheme/>:
      mzscheme (>= v299.400)

    *

      Chicken <http://www.call-with-current-continuation.org/>: csi (>=
      v2.2 with libffi support, and syntax-case and numbers eggs installed)

    *

      Gauche <http://www.shiro.dreamhost.com/scheme/gauche/>: gosh (>=
      v0.8.5)

    *

      Scheme48 <http://s48.org/>: scheme48 (v1.3)

    *

      SCM <http://swiss.csail.mit.edu/~jaffer/SCM.html>: scm (v5e1 with
      SLIB v3a2)

    *

      Guile <http://www.gnu.org/software/guile/guile.html>: guile (>=
      v1.7.91)

Sassy was developed on GNU/Linux, though since Sassy is embedded in
Scheme, Sassy should (theoretically) run everywhere Scheme does. If you
are running Scheme on a non *nix box, (Windows, for instance), you may
want to grab the .zip archive instead of the .tar.gz.


    2.2  Installing

(|$| means a shell prompt, |>| means a Scheme prompt.)


      2.2.1  Chicken

Sassy is availabe as an egg, so the easiest way to install (and compile)
Sassy is to do:

$ chicken-setup sassy 

If you don't want to compile Sassy (it can take a while), see below.


      2.2.2  Scheme48

Starting with version 0.2, Sassy now includes module definitions for
Scheme48's module system.

First unpack the archive, change directories, and load scheme48 with a
fairly large heap:

$ tar xfz sassy-0.2.tar.gz; cd sassy-0.2 
$ scheme48 -h 6000000 

Then:

> ,config ,load sassy-48.scm 
> ,open sassy 


      2.2.3  Other Schemes

To start up Sassy, unpack Sassy's distribution directory and enter it:

$ tar xfz sassy-0.2.tar.gz 
$ cd sassy-0.2 

Now you have to edit one line in the file |sassy.scm|. At the top of the
file, un-comment the line that loads the initialization file for the
Scheme interpreter you want to use, and comment out the others. Then
quit your editor and start the Scheme interpreter. Gauche users should
start gosh with |gosh -I.| in order to add the current directory to
gosh's load-path.

Then:

> (load "sassy.scm") 

Loading all the source files may take a few seconds. When your Scheme
prompt returns, Sassy is loaded and ready to go.

If you want to run the test-suite:

> (load "tests/run-tests.scm") 
> (sassy-run-tests 'all) 


      2.2.4  Caveats

    *

      The Scheme48 init file sets |char->integer| and |integer->char| to
      |char->ascii| and |ascii->char|.

    *

      The SCM init file sets |eval| to something that looks more like
      R5RS |eval|, but isn't actually compliant. It also changes the
      number of arguments to |make-hash-table|.


    2.3  Sassy and GNU Emacs

A minor mode with some syntax highlighting exists for editing sassy
files under GNU Emacs. See the file |sassy.el| in the top level of
Sassy's distribution directory.


    2.4  Porting Sassy

Sassy is written in R5RS Scheme
<http://schemers.org/Documents/Standards/R5RS/HTML/> with the addition
of the following:

    *

      SRFI 1 <http://srfi.schemers.org/srfi-1/>: List Library (make-list
      filter)

    *

      SRFI 9 <http://srfi.schemers.org/srfi-9/>: Defining Record Types
      (define-record-type)

    *

      SRFI 23 <http://srfi.schemers.org/srfi-23/>: Error reporting
      mechanism (error)

    *

      SRFI 56 <http://srfi.schemers.org/srfi-56/>: Binary I/O (this SRFI
      was withdrawn by its author. However Sassy's output modules and
      test-suite make use of write-byte and read-byte)

    *

      SRFI 60 <http://srfi.schemers.org/srfi-60/>: Integers as Bits
      (logand logior lognot ash bit-field logcount)

    *

      SRFI 69 <http://srfi.schemers.org/srfi-69/>: Basic hash tables
      (make-hash-table hash-table? hash-table-ref hash-table-set!
      alist->hash-table hash-table-values)

Sassy makes use of bignum and floating-point arithmetic (when you write
floating-point data) and the optional |(interaction-environment)| to
perform macro-expansion.

The included output modules also need:

-- procedure: *file-exists?* /file -> boolean/
-- procedure: *delete-file* /file/

Most (good) Scheme implementations provide a version of the underlying
functionality if they don't provide the SRFI itself. You only need to
write wrappers that implement the specified interfaces for just the
functions or syntax listed above.



About

x86 assembler in Scheme

License:Other


Languages

Language:Scheme 76.1%Language:Roff 12.9%Language:Assembly 8.7%Language:HTML 1.6%Language:Emacs Lisp 0.8%