Question Authors' Forum

Run Assembly Code ?

Run Assembly Code ?

by can oz -
Number of replies: 3

Is it possible to run assembly code by adding some java files to supported files of a question. For example with this project https://github.com/vivekannan/Rift  if i add this source files can i run assembly codes ?

In reply to can oz

Re: Run Assembly Code ?

by Richard Lobb -

You can do pretty much anything you like if you write your own high level script (template) to control the execution. One of our staff members here has questions in a compiler course where students submit their implementation of a simple compiler in Python. The script compiles a test program using the student's compiler. The output from that is JVM assembly code and the script then runs that code with the JVM.

To see how to script questions see http://coderunner.org.nz/mod/book/view.php?id=198&chapterid=831 or my second-to-last posting in this recent forum thread

Richard

In reply to Richard Lobb

Re: Run Assembly Code ?

by Paolo Tramonti -

Hi, I'm very interested on how to script questions that use assembly language, but your link (http://coderunner.org.nz/mod/book/view.php?id=198&chapterid=831) is no longer valid. How can I configure it?

In reply to Paolo Tramonti

Re: Run Assembly Code ?

by Richard Lobb -

The link was to this section of the documentation. That explains in general how to run some non built in language, which you must first install on the jobe server. But assembly language is going to be problematic because you need to generate output from each test. You will need a simulator for the target machine and you will have to figure out what sort of questions to ask that result in some well defined output from that simulator. Perhaps you can have a "printstate" function that displays the machine state and selected portions of memory and ask students to write code leading to particular required states?