我有两个寄存器如下,
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
我无法像HL
那样直接比较DE
和if(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
我不确定我是否做得对。但是,如果是这样,可以将其中的三个简化?
无符号hl> de有两种情况:
h > d
h == d AND l > e