如何在 Pep9 程序集中编写 if 语句?我想用 Pep9 汇编形式从 C 中编写这个 if 语句。
if ( (0 < weight) && (weight <= 1 ) ) {
printf("Light Weight\n");
}
else if((1 < weight) && (weight <= 3)){
printf("Medium Weight\n");
}
但是当输入大于 1 时我无法打印结果。这是我目前所拥有的:
if: LDWA weight,s ;if(0 < weight)
CPWA limit11,i
BRLT msg1
LDWA weight,s ;if(weight <= 1)
CPWA limit12,i
BRGT msg1
STRO cost1,d
cost1: .ASCII "Low Weight\n\x00"
msg1: .END
if: LDWA weight,s ;if(1 < weight)
CPWA limit21,i
BRLT msg2
LDWA weight,s ;if(weight <= 3)
CPWA limit22,i
BRGT msg2
STRO cost2,d
cost2: .ASCII "Medium Weight
第一个 if 语句工作正常。但第二个无法打印任何内容。你能指出问题出在哪里吗?