Skip to content

Commit

Permalink
add more gif
Browse files Browse the repository at this point in the history
  • Loading branch information
ejunjsh committed Dec 17, 2021
1 parent 14d4bc6 commit cfec4cf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@

## 实例代码

下面指令程序都是可以跑在这个cpu上的
下面视频里面的指令程序都是可以跑在这个cpu上的

### 加法

Expand All @@ -156,6 +156,8 @@

上面代码相当于地址14里面的值和15里面的值相加, 然后显示2

<img src="https://github.com/ejunjsh/mycpu/raw/main/images/16.gif" width="50%" height="50%">

### 累加

````
Expand All @@ -169,6 +171,26 @@

上面代码相当于`i++`

<img src="https://github.com/ejunjsh/mycpu/raw/main/images/17.gif" width="50%" height="50%">

### 条件跳转测试

````
0:OUT 0000:1110 0000
1:ADD 15 0001:0010 1111
2:JC 4 0010:0111 0100
3:JMP 0 0011:0110 0000
4:SUB 15 0100:0011 1111
5:OUT 0101:1110 0000
6:JZ 0 0110:1000 0000
7:JMP 4 0111:0110 0100
15:1 1111:0000 0001
````

这段代码测试条件跳转指令`JZ``JC`

<img src="https://github.com/ejunjsh/mycpu/raw/main/images/18.gif" width="50%" height="50%">

### 乘法

````
Expand All @@ -190,7 +212,9 @@
15:y 1111:0000 0101
````

这里相当于`x = 2 ; y = 5 ; product = x * y`, 并显示`product`,上面动图显示的就是这个例子
这里相当于`x = 2 ; y = 5 ; product = x * y`, 并显示`product`

<img src="https://github.com/ejunjsh/mycpu/raw/main/images/15.gif" width="50%" height="50%">

-------------------------

Expand Down
Binary file added images/16.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/17.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/18.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cfec4cf

Please sign in to comment.