https://github.com/darfink/computer
An extremely simple implementation of a virtual computer
https://github.com/darfink/computer
computer edaf25 emulator
Last synced: 2 months ago
JSON representation
An extremely simple implementation of a virtual computer
- Host: GitHub
- URL: https://github.com/darfink/computer
- Owner: darfink
- Created: 2018-03-19T09:36:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-19T09:43:33.000Z (about 7 years ago)
- Last Synced: 2025-01-21T18:48:56.078Z (4 months ago)
- Topics: computer, edaf25, emulator
- Language: Java
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Virtual Computer
An extremely simple implementation of a virtual computer.
```java
public class Factorial extends Program {
public Factorial() {
Address n = new Address(0);
Address fac = new Address(1);add(new Copy(new LongWord(5), n));
add(new Copy(new LongWord(1), fac));
add(new JumpEq(6, n, new LongWord(1)));
add(new Mul(fac, n, fac));
add(new Add(n, new LongWord(-1), n));
add(new Jump(2));
add(new Print(fac));
add(new Halt());
}
}
```