fix typo in comparison function and in pointer optimization

This commit is contained in:
Irmen de Jong 2023-03-18 12:55:35 +01:00
parent 20dbdb20d2
commit e4764cd8a6
2 changed files with 2 additions and 2 deletions

View File

@ -979,7 +979,7 @@ $repeatLabel lda $counterVar
internal fun pointerViaIndexRegisterPossible(pointerOffsetExpr: PtExpression): Pair<PtExpression, PtExpression>? {
if(pointerOffsetExpr is PtBinaryExpression && pointerOffsetExpr.operator=="+") {
val leftDt = pointerOffsetExpr.left.type
val rightDt = pointerOffsetExpr.left.type
val rightDt = pointerOffsetExpr.right.type
if(leftDt == DataType.UWORD && rightDt == DataType.UBYTE)
return Pair(pointerOffsetExpr.left, pointerOffsetExpr.right)
if(leftDt == DataType.UBYTE && rightDt == DataType.UWORD)

View File

@ -657,7 +657,7 @@ internal class ExpressionsAsmGen(private val program: PtProgram,
"<=" -> {
when(dt) {
DataType.UBYTE -> asmgen.out(" jsr prog8_lib.equalzero_b")
DataType.BYTE -> asmgen.out(" jsr prog8_lib.lessequalzeros_b")
DataType.BYTE -> asmgen.out(" jsr prog8_lib.lessequalzero_sb")
DataType.UWORD -> asmgen.out(" jsr prog8_lib.equalzero_w")
DataType.WORD -> asmgen.out(" jsr prog8_lib.lessequalzero_sw")
DataType.FLOAT -> asmgen.out(" jsr floats.lessequal_zero")