代码拉取完成,页面将自动刷新
For quick start see HOW TO RUN.
instructions - 4 bits
| +-- addresses - 4 bits
v v
----***- <- 0 ----
--*-**-* <- 1 ---*
---***-- <- 2 --*-
---***** <- 3 --**
----***- <- 4 -*--
---***-* <- 5 -*-*
----**-- <- 6 -**-
---****- <- 7 -***
-***---* <- 8 *---
-*--**** <- 9 *--*
-------- <- 10 *-*-
-------- <- 11 *-**
-------- <- 12 **--
-------* <- 13 **-*
-------* <- 14 ***-
<OUTPUT> <- 15 ****
READ ----
- Copies the value at the specified address into register.WRITE ---*
- Copies value of the register to the specified address.ADD --*-
- Adds value at the specified address to the value of the register, and writes result to the register. If the result is bigger than the maximum possible value (255 = ********) then 255 gets written.SUBTRACT --**
- Subtracts value at the speicfied address from the value of the register, and writes result to the register. If the result is smaller than 0 then 0 gets written.JUMP -*--
- Changes the value of the program counter to the specified address, meaning that in the next cycle execution will continue at that address.IF MAX -*-*
- Jumps to the specified address if register has value 255 = ********
.IF MIN -**-
- Jumps to the specified address if register has value 0 = --------
.SHIFT R -***
- Moves every bit of the register one spot to the right. This way rightmost bit gets lost, and a leftmost becomes '-'. This is the only instruction that doesn't use the address part, making the last four bits irrelevant.READ ----
instruction.$ git clone https://github.com/gto76/comp-cpp.git
$ cd comp-cpp
$ ./run
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。