«previous next»

SWIFTFORTH DETAILS

Overview

Windows Interface (a)

Windows Interface (b)

Windows Interface (c)

Programming Aids & Features (a)

Programming Aids & Features (b)

Programming Aids & Features (c)

Object-Oriented Programming (SWOOP)

Forth Implementation Features (a)

Forth Implementation Features (b)

Multitasking

Demo Programs

SwiftForth Programming References

Release History

Download Free Evaluation Version


Programming Aids & Other Features

SwiftForth takes advantage of the Windows environment to provide a greatly enhanced user interface.

Complete system source

All purchased SwiftForth versions now include complete source for the entire system, including the kernel, Interactive Development Environment (IDE), and all features. The command LOCATE can display the source from which any word in the system is compiled.

Having the complete source available is incredibly valuable to anyone learning to program Windows, because you can see how all SwiftForth's user interface features are defined.

SwiftForth Pro now includes the cross compiler, which compiles the kernel, so you can customize the kernel to your needs. (NOTE: FORTH, Inc. cannot support modified kernels, however.)

Rule-based optimizer

SwiftForth can optimize more than 200 common high-level phrases. This optimizer is normally on, but can be turned off for debugging or comparison purposes. Consider the definition of DIGIT, which converts a small binary number to a digit:

: DIGIT ( u -- char)  DUP 9 > IF  7 +  THEN  [CHAR] 0 + ;

With the optimizer turned off, you would get:

SEE DIGIT
    4078BF   4 # EBP SUB                    83ED04
    4078C2   EBX 0 [EBP] MOV                895D00
    4078C5   4 # EBP SUB                    83ED04
    4078C8   EBX 0 [EBP] MOV                895D00
    4078CB   9 # EBX MOV                    BB09000000
    4078D0   403263 ( > ) CALL              E88EB9FFFF
    4078D5   EBX EBX OR                     09DB
    4078D7   0 [EBP] EBX MOV                8B5D00
    4078DA   4 [EBP] EBP LEA                8D6D04
    4078DD   4078F4 JZ                      0F8411000000
    4078E3   4 # EBP SUB                    83ED04
    4078E6   EBX 0 [EBP] MOV                895D00
    4078E9   7 # EBX MOV                    BB07000000
    4078EE   0 [EBP] EBX ADD                035D00
    4078F1   4 # EBP ADD                    83C504
    4078F4   4 # EBP SUB                    83ED04
    4078F7   EBX 0 [EBP] MOV                895D00
    4078FA   30 # EBX MOV                   BB30000000
    4078FF   0 [EBP] EBX ADD                035D00
    407902   4 # EBP ADD                    83C504
    407905   RET                            C3 ok

But with it turned on, you would get:

SEE DIGIT
    45A2D3   9 # EBX CMP                    83FB09
    45A2D6   45A2DF JLE                     0F8E03000000
    45A2DC   7 # EBX ADD                    83C307
    45A2DF   30 # EBX ADD                   83C330
    45A2E2   RET                            C3 ok

Single-step debugger

Allows you to step through source compiled from a file. A simple example of using it is reproduced below:

REQUIRES SINGLESTEP
      [DEBUG
      : 2X ( n -- n*2)   DUP + ;
      : 3X ( n -- n*3)   DUP 2X + ;
      : 4X ( n -- n*4)   DUP 2X SWAP 2X + ;
      : 5X ( n -- n*5)   DUP 3X SWAP 2X + ;
      DEBUG]

Assuming this source has been compiled, you may type 4 DEBUG 5X to cause a debug window to appear, as shown here:

The current stack is displayed at the bottom of the debug window. While this debug window is active, you may control it using the buttons at the bottom, which work as follows:

«previous next»