mirror of
https://github.com/irmen/prog8.git
synced 2024-11-27 03:50:27 +00:00
fix crash in asm code generated for bitshift operation with memory address operand
This commit is contained in:
parent
2af86a10b2
commit
796d07a7f8
@ -313,7 +313,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
||||
sta (+) +1
|
||||
sty (+) +2
|
||||
lda $sourceName
|
||||
+ sta ${65535.toHex()} ; modified
|
||||
+ sta ${'$'}ffff ; modified
|
||||
""")
|
||||
}
|
||||
}
|
||||
@ -469,7 +469,7 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
||||
sta (+) +1
|
||||
lda $ESTACK_HI_HEX,x
|
||||
sta (+) +2
|
||||
+ sty ${65535.toHex()} ; modified
|
||||
+ sty ${'$'}ffff ; modified
|
||||
""")
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
sta (+) + 1
|
||||
lda $ESTACK_HI_HEX,x
|
||||
sta (+) + 2
|
||||
+ asl 0 ; modified
|
||||
+ asl ${'$'}ffff ; modified
|
||||
""")
|
||||
}
|
||||
}
|
||||
@ -205,7 +205,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
sta (+) + 1
|
||||
lda $ESTACK_HI_HEX,x
|
||||
sta (+) + 2
|
||||
+ lsr 0 ; modified
|
||||
+ lsr ${'$'}ffff ; modified
|
||||
""")
|
||||
}
|
||||
}
|
||||
@ -286,7 +286,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
sta (+) + 1
|
||||
lda $ESTACK_HI_HEX,x
|
||||
sta (+) + 2
|
||||
+ rol 0 ; modified
|
||||
+ rol ${'$'}ffff ; modified
|
||||
""")
|
||||
}
|
||||
}
|
||||
@ -397,7 +397,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
||||
sta (+) + 1
|
||||
lda $ESTACK_HI_HEX,x
|
||||
sta (+) + 2
|
||||
+ ror 0 ; modified
|
||||
+ ror ${'$'}ffff ; modified
|
||||
""") }
|
||||
}
|
||||
is RegisterExpr -> {
|
||||
|
@ -4,7 +4,8 @@ TODO
|
||||
|
||||
- option to load library files from a directory instead of the embedded ones
|
||||
- exit('message', returncode) function to immediately exit the program with this message (restores stack)
|
||||
- vector inc/dec/add/sub/lsl/asl/mul/div...?
|
||||
- vector inc/dec/add/sub/mul/div...?
|
||||
arrayvar++ / arrayvar-- / arrayvar += 2 / arrayvar -= 2 / arrayvar *= 3 / arrayvar /= 3
|
||||
|
||||
|
||||
Memory Block Operations integrated in language?
|
||||
|
@ -74,7 +74,7 @@ main {
|
||||
ror2(@(9999))
|
||||
rol2(@(9999))
|
||||
|
||||
lsl(@(9999+A)) ; TODO optimizer generates invalid code here -> crash
|
||||
lsl(@(9999+A))
|
||||
lsr(@(9999+A))
|
||||
ror(@(9999+A))
|
||||
rol(@(9999+A))
|
||||
|
@ -5,7 +5,13 @@ main {
|
||||
|
||||
sub start() {
|
||||
|
||||
byte[] barr = [22,-33,-44,55,66]
|
||||
lsr(@(9999+A))
|
||||
ror(@(9999+A))
|
||||
rol(@(9999+A))
|
||||
ror2(@(9999+A))
|
||||
rol2(@(9999+A))
|
||||
|
||||
c64scr.print_ub(X)
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user