https://github.com/acoshift/stackcpu_cpp
Stack CPU Simulator
https://github.com/acoshift/stackcpu_cpp
Last synced: 9 months ago
JSON representation
Stack CPU Simulator
- Host: GitHub
- URL: https://github.com/acoshift/stackcpu_cpp
- Owner: acoshift
- License: gpl-3.0
- Created: 2017-07-02T16:02:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-18T14:13:31.000Z (over 3 years ago)
- Last Synced: 2025-02-01T02:20:01.813Z (11 months ago)
- Language: C++
- Homepage:
- Size: 32.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stack CPU
Stack CPU Simulator
## Opcode List
```text
LIT - push memory to data stack
@ - pop data stack and load memory into data stack
! - store data from stack into memory
DROP - pop data stack
DUP - duplicate top of data stack
OVER - duplicate second of top of data stack
SWAP - swap top data stack
+ - add
- - minus
AND - and
OR - or
XOR - xor
IF - if top stack is 0, use next pc to jump
CALL - jump pc
EXIT - pop return stack then jump pc to poped data
HALT - end program
>R - pop data stack then push to return stack
R> - pop return stack then push to data stack
```
## License
GPL-3.0