Skip to content

Commit

Permalink
Version 4.0c
Browse files Browse the repository at this point in the history
Set the version to 4.0c
Update README.md
Update bootstrap files
Update binary
  • Loading branch information
CheyenneWills committed Oct 21, 2023
1 parent 078381d commit edc09c4
Show file tree
Hide file tree
Showing 8 changed files with 8,013 additions and 7,516 deletions.
98 changes: 98 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Quick install instructions

## Installing the pre-built binary

The release tar file contains a pre-built binary in the bin directory.

To install the pre-built file:

make destprefix={destprefix} install

Where {destprefix} defaults to /usr/local

This installs:

* {destprefix}/bin/spitbol
* {destprefix}/share/spitbol/{demo files}
* {destprefix}/man/man1/spitbol.1

## Rebuilding spitbol from source

### Requirements:

* gcc compiler (other compilers might work, but they have not been tested)
* standard glibc library (review the C code in osint.c)
* nasm
* make

### The spitbol build steps

The source code from spitbol, `sbl.min`, is written in `minimal` which is an assembly language
for an abstract architecture. There is a `minimal` to x86_64 assembly language (nasm format)
translator `lex.sbl, asm.sbl` and `err.sbl` which are written in spitbol. In order to rebuild
from the minimal source requires that an existing spitbol compiler is available.

There are 2 methods to rebuild the spitbol binary from source

#### Using the prebuilt binary, bin/sbl

From the top level in the source directory, the `spitbol` target in the Makefile will use the
prebuilt spitbol compiler that is in the bin directory.

make spitbol

This will create a sbl binary in the top level of the source directory

#### Builting without an available spitbol compiler

If a spitbol compiler is not available, pre-translated assembly files are provided in
in the bootstrap directory.

From the top level in the source directory, the `bootsbl` target in the Makefile will
use the pre-translated assembly files.

make bootsbl

This produces a bootsbl binary that can be used to re-build the source

make BASEBOL=./bootsbl spitbol

This will create a sbl file in the top level of the source directory.

### Make targets and options

The following are the make targets:
<dl compact>
<dt>sbl</dt>
<dd>is the primary build target and builds the sbl binary. Requires an existing spitbol compiler</dd>

<dt>spitbol</dt>
<dd>an alias for the sbl target</dd>

<dt>bininst</dt>
<dd>copies sbl to bin/sbl</dd>

<dt>install</dt>
<dd>installs the spitbol compiler (from bin/sbl), the demo source and the man page to
the {destprefix} directories</dd>

<dt>bootsbl</dt>
<dd>builds the bootsbl binary just nasm and gcc. Does not require an existing spitbol compiler</dd>

<dt>checkboot</dt>
<dd>Developer target, verifies that the source files in bootstrap match the output of the
`minimal` to assembly conversion</dd>

<dt>makeboot</dt>
<dd>Copies the output of the `minimal` translation to the bootstrap directory</dd>

<dt>clean</dt>
<dd>cleans built items from the source directory</dd>
</dl>

The following make definition options that are used:
<dl compact>
<dt>destprefix</dt><dd>target directory where spitbol, the demo files and the man page will be installed, defaults to destprefix=/usr/local</dd>
<dt>debug</dt><dd>if set to non-zero, will build spitbol with debugging information for gdb, defaults to debug=0</dd>
<dt>BASEBOL</dt><dd>path to the spitbol compiler used during the build process, defaults to BASEBOL=./bin/sbl</dd>
</dl>
102 changes: 90 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,93 @@
# Unix SPITBOL V4.0a (Feburary 2023)
# SPITBOL is an extremely high performance implementation of the SNOBOL4 language
that brings raw power and speed to non-numeric computation.

SPITBOL is an extremely high performance implementation of the SNOBOL4 language that brings raw power and speed
to non-numeric computation.
SPITBOL is currently only available for 64-bit x86_64 processors running Unix
like systems.

SPITBOL V4.0a is currently only available for 64-bit x86_64 processors running Unix.
The latest version of SPITBOL can be found at
[github.com/spitbol/x64](http://github.com/spitbol/x64).

The latest version of SPITBOL V4.0 can be found at [github.com/spitbol/x64](http://github.com/spitbol/x64).
For comments, suggestions, and bug reports please open an issue in the github
repository.

For comments, suggestions, and bug reports please open an issue in the github repository.
## Unix SPITBOL V4.0c (Oct 2023)

## Language Changes
### Updates:

* Set default for &anchor to 0
* SIGQUIT and SIGHUP will cancel spitbol
* Set max number of floating point digits on output to 16
(e.g. 0.1234567890123456) plus 3 digits for any exponent.
* Extended test suite to include more math related tests.
* Quick install instructions in INSTALL.md

### Bugs fixed:

* Fix the end of run summary for regenerations statics to use the proper message
text
* Fix overflow detection for both integer and floating point
* Mark stack as non-executable (needed for hardened systems)
* Fix incorrect error handling within eval
* Fix using caret '^' for exponents (e.g. 2 ^ 2 => 4)

### Internal changes:

* Using more x86_64 registers for the internal workings of the minimal
instructions.
* R12 used for IA (integer accumulator)
* XMM12 used for RA (real accumulator)
* R13 used for CP
* R10 and R11 are used as work registers.
* XMM0, XMM1 are used as work registers for floating point
* MXCSR used to manage floating point operations and detecting floating
point errors

* Generate assembly code instead of calling C routines for some math and
arithmetic operations.

* Use 'test' instead of 'or' to check register values
* Use 'xor' to zero registers

* Use sigaction instead of signal.

* Eliminate some of the internal macros and just generate the assembly code
directly. Use internal helper routines to handle some of the larger generated
code blocks.

* General code formatting cleanup.
* Using spaces instead of tab characters
* Use standard C function declarations and definitions.
* Reindent all C code using clangd lsp (see osint/.clang-format for options
used)
* Makefile cleanup

* Fix parsing source linenumber in asm.sbl
* Fix ucase and letters in asm.sbl
* Clean up label generation in asm.sbl
* Explicitly set REL and BITS64 in generated assembly code

The above needs more general testing. Specific areas for testing are:

* Floating point operations and functions
* Integer "boundary" conditions

Thanks to Jeff Cooper for feedback, performing testing and providing additional
tests for arithmetic/math functions.

Note that the changes associated with the development release SPITBOL V4.0b
have been reworked into this release.

### Wish list items:

* Detection/and use of NAN and +/- INF for floating point.

## Unix SPITBOL V4.0b (Jun 2023)

Development release (see development branch in git repository)

## Unix SPITBOL V4.0a (Feb 2023)

### Language Changes

Version 4.0a contains minor bug fixes and clarifications

Expand Down Expand Up @@ -51,14 +129,14 @@ You can install it in `/usr/local/bin/spitbol` with the command:

Three tools are needed to build Spitbol:

1. A C compiler
2. A C runtime library
3. An assembler
1. Posix C compiler
2. Standard C runtime library
3. NASM assembler

SPITBOL uses the gcc compiler to compile C source files.

SPITBOL requires NASM, the Netwide ASseMbler: [nasm](http://www.nasm.us) to assemble the generated
x86_64 machine code.
SPITBOL requires NASM, the Netwide ASseMbler: [nasm](http://www.nasm.us) to
assemble the generated x86_64 machine code.


## Building SPITBOL
Expand Down
Binary file modified bin/sbl
Binary file not shown.
Loading

0 comments on commit edc09c4

Please sign in to comment.