# =========================================
# Assembly -> Forth
# Written by Charles Childers
#
# For changelog, see the end of file. Notes
# are provided by each function
# =========================================


# =========================================
# Excise ^M from source code before conversion
# =========================================
s/
//g


# =========================================
# Take care of special cases
#   * Word names
#   * Variables
#   * Constants
# Numbers are a special case, but we 
# handle them later on.
# =========================================
# Word Names
s/: //g


s/call//g
s/upsh//g


# =========================================
# Convert RET into ;
# =========================================
s/ret/;/g


# =========================================
# Convert names into special symbols
# =========================================
s/minus/-/g
s/plus/+/g
s/multiply/*/g
s/divide/\//g
s/print/./g
s/lessthan/\</g
s/greaterthan/\>/g
s/equals/\=/g

# =========================================
# That's it! Your Forth code is now valid
# assembly using subroutine threading.
# =========================================



# =============================================================================
# This is part of the Retro Project, for details on the project and for
# updates, visit http://retro.tunes.org
# =============================================================================
# This is placed into the public domain
# There is no warranty
# =============================================================================

# =============================================================================
# Changelog |   If you modify this file, give details here
# -----------
#
#   DATE      WHO                       DETAILS
# --------    ---    --------------------------------------------
# 07/05/03    CRC    Began coding asm2forth (which converts forth2asm
#                    output back into Forth)
#=============================================================================
