Skip to content

avmonte/forthpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

106 Commits
 
 
 
 
 
 
 
 

Repository files navigation

forthpy

A final project for CS130: Computer Organization, American University of Armenia, Fall 2022

Author: Gevorg Nersesian, gevorg_nersesian@edu.aua.am

Supervisor: Norayr Chilingaryan, nchilingaryan@aua.am

Usage

In a terminal window of a directory with your Forth file, type

python3 main.py [inputFileName].fs

In your directory you will find an executable of the inputted Forth script and a folder with the raw files (object and assembly files)

Dictionary

Integers are just being pushed to the top of the stack

+, -, *, /: does the given operation on elements and pushes the result to the the top of the stack

mod: calculates the reminder of division of two elements and pushes the result to the the top of the stack

dup: duplicates an element at the top of the stack

swap: swaps elements at the top of the stack

drop: drops one element from the top of the stack

.: prints out an element from the top of the stack

\[comment]: this is a comment, it is ignored by the compiler, not transfered to the .s (assembly) file

About

A simple Forth compiler in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published