Giter VIP home page Giter VIP logo

assembler-with-python's Introduction

Assembler with python

converts assembly source code to machine code

Requirements

  • Python 3 ๐Ÿ

Usage

python main.py [source] [output]
  • [source] : Path to assembely source file. (REQUIRED)
  • [output] : Path to store program output file. i.e. binary code. If not specified, uses "binary.txt" as output file name (OPTINAL)

Example

python main.py c:\asm.txt
python main.py c:\asm.txt c:\binary.txt

input

ORG 100 /this is start
LDA SUB
CMA
INC
inc
ADD MIN
STA DIF
HLT
MIN,DEC 83
SUB,DEC -23
DIF,HEX 0
END

output

1000 0000 0	    0010 0001 0000 1000
1000 0000 1	    0111 0010 0000 0000
1000 0001 0	    0111 0000 0010 0000
1000 0001 1	    0111 0000 0010 0000
1000 0010 0	    0001 0001 0000 0111
1000 0010 1	    0011 0001 0000 1001
1000 0011 0	    0111 0000 0000 0001
1000 0011 1	    0000 0000 0101 0011
1000 0100 0	    1000 0000 0001 0111
1000 0100 1	    0000 0000 0000 0000

assembler-with-python's People

Contributors

amsanei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.