Git Product home page Git Product logo

assembler's Introduction

Build Status

Download latest Release

The most recent changes are listed in the release notes.

ASM 3

screnshot

In this repo you can find an assembler for a simulated 16 bit microprocessor which is realized as a Digital simulation. You can find the processor itself as one of the examples in the Digital repository or in the distributed zip file. The processor is a 16 bit harvard single cycle cpu and it is inspired by the MIPS architecture. Only the handling of long constants is a bit of a hack to avoid a 32 bit instruction memory.
The assembler supports pseudo instructions like push, pop, enter, leave or call and ret [n]. So it is also possible to program more like for a x86 cisc processor.
The assembler has a simple GUI and is able to control the simulator by using its TCP/IP interface. So it is easy to debug an assembly program within the simulator.

Interfacing the Simulator

If you are interested in how to interface the simulator you can take a look at this class. These are just a few lines of simple code, and it should be easy to translate it into any other language you want to use.

How it works

A list of the supported ASM instructions is included in the distributed zip file (instructions.pdf). If you are interested in modifying how the instructions are encoded, look at the file Opcode.java. The instructions and the associated flags used for the control unit are listed there. Some instructions are available in two variants: The mnemonics with a lower case 's' attached, describes the instruction with a special encoding for a short constant, which can be included in the instruction itself.

Usage

  • In the folder src/main/asm are some sample programs in assembler. The assembler creates a hex file to be loaded to the instruction memory of the simulated processor.
  • You only need to start the simulator and load the example processor. Then you can control the simulator by the assembler GUI.
  • You can find the assembler in the folder src/main/java

Set up?

  • You can find the processor in the Digital repo or release ZIP as one of the examples.
  • The assembler is implemented in Java and is build with maven. So you can build it calling mvn install on the command line.
  • Most Java-IDE's are able to import the pom.xml file. Best maven support you can get using NetBeans.

assembler's People

Contributors

hneemann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

assembler's Issues

Getting it working alongside Digital?

Hi again @hneemann,

Following on from my earlier issue #5, I've now got ASM3 running alongside Digital but I'm not quite sure exactly how to get it set up talking to an instance of Digital.

Firstly, in the README, you mention 'You can find the processor in the Digital repo or release ZIP as one of the examples' and I've got those of course, but the question is WHICH one? and how do I go about actually 'loading' one of the example programs into the memory? From what I am reading, I simply need to the start the right processor simulation and then I can use the 'Remote interface' to hook the two up but I can't quite get started.

Would you be able to knock up a quick step-by-step idiots' guide that I can follow through and then once I'm up and running my daughter and I are hoping to re-create all of our simple simple digital logic-related HTML5 'explainers' like this example using Digital simulations as the accompanying 'try it for yourself' resources.

BTW, Once I've been able to experiment a bit more with preparing actual secondary school lessons around Digital as the tool of choice, I expect to be able to contribute a whole collection of school-ready resources so that we can promote Digital into the UK secondary school system as a tool of choice. You'll notice how the example resource that I've sent you to above has a convenient 'snap to full screen' button - ideal for use in the classroom.

Nick and Evie

Assembler als Maven Artefakt veröffentlichen

Wäre es möglich, die enstehende JAR-Datei in ein Maven-Repository zu deployen? Über dieses Repository könnten dann andere Projekte die JAR-Dateien als Bibliothek verwenden und auf Assembler aufbauen.

Mein Anwendungsfall wäre das IntelliJ-Plugin. Die momentan einfachste Lösung wäre, die JAR-Datei im Repository mit abzulegen. Mit jeder neuen Version müsste die neue Datei dort aktualisiert werden und das Plugin neu gebaut werden. Der erste Schritt würde bei der Lösung mit dem Maven-Repository entfallen und das Releasen einer neuen Version vereinfachen.

"Branch out of range" Fehlermeldung verweist nicht auf Stelle

Ich arbeite an einem etwas größerem Programm und nun ist bei mir einmal der Fehler
ExpressionException; branch out of range
aufgetreten. Nur leider steht in dem Fehler nicht, welcher Branch denn out of range ist. Und durch den Fehler kann man sich leider auch nicht das Listing ansehen, um das selbst herauszufinden.
Also muss man raten und durch Auskommentieren herausfinden, welcher Branch das jetzt genau verursacht

Error when launching asm3 on windows 10

When attempting to launch asm3 on windows 10, I get this error: "Java Virtual Machine Launcher: Error: A JNI error has ocurred, please check your installation and try again" followed by: "Java Virtual Machine Launcher: A Java Exception has ocurred." and then nothing happens.
Can someone tell me what this means? Thank you.

Branch out of range bei langem Code mit vielen CALLs

Mitten während der Entwicklung an einem langen Programm mit vielen CALLs kam auf einmal eine branch out of range Exception, obwohl ich keinen Branch/Jump selbst verwendet habe. Als ich einen CALL auskommentiert habe, hat es wieder funktioniert.

Hier ist der Code, der den Fehler auslöst, so weit minimiert wie möglich: https://pastebin.com/u4UVh59t

VonNeumannTests failed on Windows 10 Home

VonNeumannTest.testHarvard:20 null expected:<v2.0 raw[
1400
5220
8041
1200
5200
5210
1400
1403]

but was:<v2.0 raw[
1400
5220
8041
1200
5200
5210
1400
1403
]

VonNeumannTest.testVonNeumann:33 null expected:<v2.0 raw[
41
41
0
1400
8000
1300]

but was:<v2.0 raw[
41
41
0
1400
8000
1300
]

Cannot get distribution to work on Windows

Hello,

This looks great for what I am trying to do but for some reason, I cannot get the distribution to work on my Windows 10 Pro (Intel(R) Core(TM) i5-6300U CPU © 2.40GHz 2.50 GHz 8.00 GB)

I have expanded the latest distribution archive into a local folder as directed.
I am able to run multiple other Java based projects but on trying to run the .exe on this one I get a message...

"Java Virtual Machine Launcher
Error: A JNI error has occurred, please check your installation
and try again"

I wondered if you might have any suggestions.

Thank you

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.