我有以下两个寄存器,
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
我不确定我是否做对了。但是,如果这样,可以简化其中三个吗?
答案 0 :(得分:1)
无符号hl> de有两种情况:
h > d
h == d AND l > e