GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - GithubRealFan/ABM-Compiler-Python

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
ABM Compiler.py
ABM Compiler.py
 
 
README.md
README.md
 
 

Repository files navigation

ABM-Compiler-Python

What is ABM language? : "Abstract Machine Language"

The grammar of ABM programming language:

  1. Stack Manipulation
  • "push c" Pushes c onto the stack
  • "rvalue l" Pushes contents of data location l onto the stack
  • "lvalue l" Pushes address of data location l onto the stack
  • "pop" Throws away value on top of the stack
  • ":=" Stack top is placed by the lvalue below it and both are popped
  • "copy" Pushes a copy of the top value on stack
  1. Control Flow
  • "label l" Targets of jumps to l
  • "goto l" Next instruction is taken from statement with label l
  • "gofalse l" Pops the top value of the stack and jumps if it is zero
  • "gotrue l" Pops the top value of the stack and jumps if if is nonzero
  • "halt" Stops execution
  1. Arithmetic Operators
  • "+" Adds top two values on stack and places result on stack
  • "−" Similar to +, but subtraction is performed
  • "∗" Similar to +, but multiplication is performed
  • "/" Similar to +, but integer division is performed
  • "div" Similar to +, but remainder of division is performed
  1. Logical Operators
  • "&" Logial AND the top two values on stack and places result on stack
  • "!" Negates the top of the stack
  • "|" Similar to &, but logical OR is performed
  1. Relational Operators
  • "<>" Returns 0 if top two values on stack are equal otherwise returns 1
  • "<=" Similar to <>, but tests if top minus one is less or equal top
  • ">=" Similar to <>, but tests if top minus one is greater or equal top
  • "<" Similar to <=, but tests if top minus one is less than top
  • ">" Similar to >=, but tests if top minus one is greater than top
  • "=" Similar to <>, but tests if top minus one is equal to top of stack
  1. Output
  • "print" Writes top of the stack contents to output device
  • "show" Writes a literal string to output device
  1. Subprogram Control
  • "begin" Marks the beginning of parameter passing and subroutine call
  • "end" Marks the end of parameter passing and subroutine call
  • "return" Returns from subroutine
  • "call" Subroutine call

This Python Code is ABM language compiler. Input data : ABM code. Output data : ABM running result.

About

No description or website provided.

Topics

abmcompilerlogicpython

Resources

Readme
Activity

Stars

8 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.