15 lines
820 B
Plaintext
15 lines
820 B
Plaintext
{{implementation|Computer/zero Assembly}}
|
|
{{omit from|Computer/zero Assembly}}
|
|
|
|
;Task:
|
|
Create a [[Computer/zero Assembly]] emulator. You may consider [http://edmundgriffiths.com/czero.html this webpage] as a reference implementation. Output the results of the sample programs "2+2" and "7*8" found there.
|
|
|
|
:* The virtual machine "bytecode" needs to be able to modify itself (or at least act as though it can) while the virtual machine is running, to be consistent with the reference implementation.
|
|
:* For output, it is sufficient to have the implementation of the <code>STP</code> opcode return the accumulator to your actual language, and then use your standard printing routines to output it.
|
|
|
|
;Bonus Points: Run all 5 sample programs at the aforementioned website and output their results.
|
|
|
|
|
|
<br><br>
|
|
|