如何基于Out- Alu输出的值执行跳转指令 [英] How Jump instruction is executed based on value of Out- The Alu Output

查看:108
本文介绍了如何基于Out- Alu输出的值执行跳转指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自计算机系统元素(Nand2Tetris)的图

看看其中的情况

 j1 = 1 (out < 0 )
 j2 = 0 (out = 0 )
 j3 = 1 (out > 0 )

out< 0 out> 0 是正确的,而 out = 0 是错误的。 out 如何同时具有正值和负值?

How this scenario is possible as out < 0 is true as well as out > 0 but out = 0 is false. How out can have both positive and negative values at the same time?

换句话说,当 JNE 指令将要执行,尽管从理论上讲对我来说似乎可行,但实际上却不可能?

In other words when JNE instruction is going to execute although it theoretically seems possible to me but practically its not?

推荐答案

如果< 0,如果j1 = 1,则执行跳转。

If out < 0, the jump is executed if j1 = 1.

如果out = 0,则j2 = 1,执行跳转。

If out = 0, the jump is executed if j2 = 1.

如果out> 0,则在j3 = 1时执行跳转。

If out > 0, the jump is executed if j3 = 1.

希望现在您可以更好地理解该表。特别地,如果out不为零,则执行JNE,如果out为零,则跳过JNE。

Hopefully now you can understand the table better. In particular, JNE is executed if out is non-zero, and is skipped if out is zero.

这篇关于如何基于Out- Alu输出的值执行跳转指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆