mirror of
https://github.com/irmen/prog8.git
synced 2024-12-26 14:29:35 +00:00
todo related to in-place assignment
This commit is contained in:
parent
fdfbb7bdf0
commit
7ac6c8f2d1
@ -192,7 +192,7 @@ private fun writeAssembly(programAst: Program, errors: ErrorReporter, outputDir:
|
||||
programAst.processAstBeforeAsmGeneration(errors)
|
||||
errors.handle()
|
||||
|
||||
// printAst(programAst)
|
||||
printAst(programAst) // TODO
|
||||
|
||||
val assembly = CompilationTarget.asmGenerator(
|
||||
programAst,
|
||||
|
@ -4,19 +4,50 @@
|
||||
%zeropage basicsafe
|
||||
%option enable_floats
|
||||
|
||||
; todo: add these to the Expression Simplifier so that all the below assignments become a simple in-place assignment:
|
||||
; (A +/- B) +/- C ==> A +/- ( B +/- C)
|
||||
; (A * / B) * / C ==> A * / ( B * / C)
|
||||
|
||||
|
||||
main {
|
||||
|
||||
float[] fa = [1,2,3,4]
|
||||
|
||||
sub start() {
|
||||
wot("asdfasdf")
|
||||
wot("asdfasdf")
|
||||
wot("asdfasdf1")
|
||||
}
|
||||
|
||||
sub wot(uword text) {
|
||||
c64scr.print(4.4, 1)
|
||||
c64.CHROUT('\n')
|
||||
ubyte wv
|
||||
ubyte wv2
|
||||
|
||||
wv *= wv2
|
||||
|
||||
wv += 10
|
||||
wv += 20
|
||||
wv += 30
|
||||
|
||||
wv += 1 + wv2
|
||||
wv += 2 + wv2
|
||||
wv += 3 + wv2
|
||||
|
||||
wv += wv2 + 1
|
||||
wv += wv2 + 2
|
||||
wv += wv2 + 3
|
||||
|
||||
wv = wv + 1 + wv2
|
||||
wv = wv + 2 + wv2
|
||||
wv = wv + 3 + wv2
|
||||
|
||||
wv = 1 + wv2 + wv
|
||||
wv = 2 + wv2 + wv
|
||||
wv = 3 + wv2 + wv
|
||||
|
||||
wv = wv + wv2 + 1
|
||||
wv = wv + wv2 + 2
|
||||
wv = wv + wv2 + 3
|
||||
|
||||
wv = wv2 + 1 + wv
|
||||
wv = wv2 + 2 + wv
|
||||
wv = wv2 + 3 + wv
|
||||
|
||||
wv = wv2 + wv + 1
|
||||
wv = wv2 + wv + 2
|
||||
wv = wv2 + wv + 3
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user