【发布时间】:2019-03-01 15:53:54
【问题描述】:
我有两个寄存器如下,
HL(consecutive), H holds 8-bit, L holds 8-bit so HL is 16-bit register pair
DE(consecutive), D holds 8-bit, E holds 8-bit so DE is 16-bit register pair
我无法像if(HL > DE) 那样直接比较HL 和DE。相反,我必须将寄存器分别比较为H, L, D, E。我构造if-else结构的可能性知道if(HL > DE)。
1.
if (l < e)
if(h > d)
do what I want
... if not checking other possibilities 2, 3
2.
if (l > e)
if(h > d)
do what I want
... if not checking other possibilities 1, 3
3.
if (h > d)
do what I want
... if not checking other possibilities 1, 2
我不确定我是否做对了。但是,如果是的话,可以将其中的三个简化吗?
【问题讨论】:
-
签名还是未签名?
-
@YvesDaoust 未签名
-
然后是 Iłya Bursov 的回答。
h > d or (h = d and l > e) -
@YvesDaoust 是的,先生,它就像一个魅力,但我想知道它们的使用方式是如何简化的。你能说吗?
-
你的提议太复杂了。
标签: algorithm if-statement logic boolean-logic