1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-10-10 20:23:47 +00:00

Fixed problem with volatiles reusing zero page addresses used by other variables. Closes #128

This commit is contained in:
jespergravgaard 2018-12-24 15:05:46 +01:00
parent 85c6f09590
commit 2be7b2ca2b
12 changed files with 607 additions and 85 deletions

View File

@ -1,5 +1,6 @@
package dk.camelot64.kickc.model;
import dk.camelot64.kickc.model.symbols.Variable;
import dk.camelot64.kickc.model.values.VariableRef;
import java.util.ArrayList;
@ -115,4 +116,35 @@ public class LiveRangeEquivalenceClass {
return s.toString();
}
/**
* If all the variables in the equivalence class is versions of the same variable this method returns it.
*/
public Variable getSingleVariableBase(Program program) {
String fullNameUnversioned = null;
for(VariableRef variable : variables) {
if(fullNameUnversioned ==null) {
fullNameUnversioned = variable.getFullNameUnversioned();
} else {
if(!variable.getFullNameUnversioned().equals(fullNameUnversioned)) {
return null;
}
}
}
// All variables had the same full name
return program.getScope().getVariable(new VariableRef(fullNameUnversioned));
}
/**
* Returns whether any variable in the equivalence class is declared as volatile
* @return true if there is a volatile variable
*/
public boolean hasVolatile(Program program) {
for(VariableRef varRef : variables) {
Variable variable = program.getScope().getVariable(varRef);
if(variable.isDeclaredVolatile()) {
return true;
}
}
return false;
}
}

View File

@ -1,6 +1,8 @@
package dk.camelot64.kickc.passes;
import dk.camelot64.kickc.model.*;
import dk.camelot64.kickc.model.symbols.Variable;
import dk.camelot64.kickc.model.symbols.VariableUnversioned;
import dk.camelot64.kickc.model.values.ScopeRef;
import java.util.LinkedHashSet;
@ -59,7 +61,6 @@ public class Pass4ZeroPageCoalesce extends Pass2Base {
/**
* Determines if two live range equivalence classes can be coalesced.
* This is possible if they are both allocated to zero page, have the same size and the resulting ASM has no live range overlaps or clobber issues.
*
* @param ec1 One equivalence class
* @param ec2 Another equivalence class
@ -68,6 +69,20 @@ public class Pass4ZeroPageCoalesce extends Pass2Base {
* @return True if the two equivalence classes can be coalesced into one without problems.
*/
public static boolean canCoalesce(LiveRangeEquivalenceClass ec1, LiveRangeEquivalenceClass ec2, Set<String> unknownFragments, Program program) {
return canCoalesceVolatile(ec1, ec2, program) && canCoalesceClobber(ec1, ec2, unknownFragments, program);
}
/**
* Determines if two live range equivalence classes can be coalesced without clobber.
* This is possible if they are both allocated to zero page, have the same size and the resulting ASM has no live range overlaps or clobber issues.
*
* @param ec1 One equivalence class
* @param ec2 Another equivalence class
* @param unknownFragments Receives information about any unknown fragments encountered during ASM generation
* @param program The program
* @return True if the two equivalence classes can be coalesced into one without problems.
*/
private static boolean canCoalesceClobber(LiveRangeEquivalenceClass ec1, LiveRangeEquivalenceClass ec2, Set<String> unknownFragments, Program program) {
Registers.Register register1 = ec1.getRegister();
Registers.Register register2 = ec2.getRegister();
if(register1.isZp() && register2.isZp() && register1.getType().equals(register2.getType())) {
@ -80,4 +95,28 @@ public class Pass4ZeroPageCoalesce extends Pass2Base {
return false;
}
/**
* Determines if any volatile varialbes prevents coalescing two equivalence classes
* @param ec1 One equivalence class
* @param ec2 Another equivalence class
* @param program The program
* @return True if the two equivalence classes can be coalesced into one without problems with volatility.
*/
private static boolean canCoalesceVolatile(LiveRangeEquivalenceClass ec1, LiveRangeEquivalenceClass ec2, Program program) {
// If any variable inside is volatile only allow coalesceing with itself
if(ec1.hasVolatile(program) || ec2.hasVolatile(program)) {
Variable baseVar1 = ec1.getSingleVariableBase(program);
Variable baseVar2 = ec2.getSingleVariableBase(program);
if(baseVar1==null || baseVar2==null) {
// One of the equivalence classes have different base variables inside
return false;
}
if(!baseVar1.equals(baseVar2)) {
// The two equivalence classes have different base variables
return false;
}
}
return true;
}
}

View File

@ -29,10 +29,10 @@
.const IRQ_RASTER_FIRST = $30
.label PLAYFIELD_SPRITE_PTRS = PLAYFIELD_SCREEN+SPRITE_PTRS
.const toSpritePtr1_return = PLAYFIELD_SPRITES>>6
.label irq_raster_next = 2
.label irq_sprite_ypos = 2
.label irq_sprite_ptr = 2
.label irq_cnt = 2
.label irq_raster_next = 3
.label irq_sprite_ypos = 4
.label irq_sprite_ptr = 5
.label irq_cnt = 6
lda #IRQ_RASTER_FIRST
sta irq_raster_next
lda #$32

View File

@ -2134,18 +2134,18 @@ Coalescing zero page register with common assignment [ zp ZP_BYTE:4 [ irq_raster
Coalescing zero page register with common assignment [ zp ZP_BYTE:6 [ irq_sprite_ypos#2 ] ] with [ zp ZP_BYTE:18 [ irq_sprite_ypos#6 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_BYTE:7 [ irq_sprite_ptr#2 ] ] with [ zp ZP_BYTE:19 [ irq_sprite_ptr#6 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_BYTE:8 [ irq_cnt#19 ] ] with [ zp ZP_BYTE:17 [ irq_cnt#23 ] ] - score: 1
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 ] ] with [ zp ZP_BYTE:4 [ irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 ] ] with [ zp ZP_BYTE:6 [ irq_sprite_ypos#2 irq_sprite_ypos#6 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 ] ] with [ zp ZP_BYTE:7 [ irq_sprite_ptr#2 irq_sprite_ptr#6 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 ] ] with [ zp ZP_BYTE:8 [ irq_cnt#19 irq_cnt#23 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 ] ] with [ zp ZP_BYTE:9 [ irq_raster_next#11 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 ] ] with [ zp ZP_BYTE:10 [ irq_sprite_ypos#11 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 irq_sprite_ypos#11 ] ] with [ zp ZP_BYTE:11 [ irq_sprite_ptr#3 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 irq_sprite_ypos#11 irq_sprite_ptr#3 ] ] with [ zp ZP_BYTE:12 [ irq_cnt#11 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 irq_sprite_ypos#11 irq_sprite_ptr#3 irq_cnt#11 ] ] with [ zp ZP_BYTE:20 [ irq_cnt#24 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 irq_sprite_ypos#11 irq_sprite_ptr#3 irq_cnt#11 irq_cnt#24 ] ] with [ zp ZP_BYTE:21 [ irq_sprite_ypos#26 ] ]
Coalescing zero page register [ zp ZP_BYTE:3 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 irq_sprite_ypos#11 irq_sprite_ptr#3 irq_cnt#11 irq_cnt#24 irq_sprite_ypos#26 ] ] with [ zp ZP_BYTE:22 [ irq_sprite_ptr#5 ] ]
Allocated (was zp ZP_BYTE:3) zp ZP_BYTE:2 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 irq_sprite_ypos#11 irq_sprite_ptr#3 irq_cnt#11 irq_cnt#24 irq_sprite_ypos#26 irq_sprite_ptr#5 ]
Coalescing zero page register [ zp ZP_BYTE:4 [ irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 ] ] with [ zp ZP_BYTE:9 [ irq_raster_next#11 ] ]
Coalescing zero page register [ zp ZP_BYTE:6 [ irq_sprite_ypos#2 irq_sprite_ypos#6 ] ] with [ zp ZP_BYTE:10 [ irq_sprite_ypos#11 ] ]
Coalescing zero page register [ zp ZP_BYTE:6 [ irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ypos#11 ] ] with [ zp ZP_BYTE:21 [ irq_sprite_ypos#26 ] ]
Coalescing zero page register [ zp ZP_BYTE:7 [ irq_sprite_ptr#2 irq_sprite_ptr#6 ] ] with [ zp ZP_BYTE:11 [ irq_sprite_ptr#3 ] ]
Coalescing zero page register [ zp ZP_BYTE:7 [ irq_sprite_ptr#2 irq_sprite_ptr#6 irq_sprite_ptr#3 ] ] with [ zp ZP_BYTE:22 [ irq_sprite_ptr#5 ] ]
Coalescing zero page register [ zp ZP_BYTE:8 [ irq_cnt#19 irq_cnt#23 ] ] with [ zp ZP_BYTE:12 [ irq_cnt#11 ] ]
Coalescing zero page register [ zp ZP_BYTE:8 [ irq_cnt#19 irq_cnt#23 irq_cnt#11 ] ] with [ zp ZP_BYTE:20 [ irq_cnt#24 ] ]
Allocated (was zp ZP_BYTE:3) zp ZP_BYTE:2 [ init_sprites::xpos#2 init_sprites::xpos#1 ]
Allocated (was zp ZP_BYTE:4) zp ZP_BYTE:3 [ irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_raster_next#11 ]
Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:4 [ irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ypos#11 irq_sprite_ypos#26 ]
Allocated (was zp ZP_BYTE:7) zp ZP_BYTE:5 [ irq_sprite_ptr#2 irq_sprite_ptr#6 irq_sprite_ptr#3 irq_sprite_ptr#5 ]
Allocated (was zp ZP_BYTE:8) zp ZP_BYTE:6 [ irq_cnt#19 irq_cnt#23 irq_cnt#11 irq_cnt#24 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 Basic Upstart
@ -2181,10 +2181,10 @@ ASSEMBLER BEFORE OPTIMIZATION
.const IRQ_RASTER_FIRST = $30
.label PLAYFIELD_SPRITE_PTRS = PLAYFIELD_SCREEN+SPRITE_PTRS
.const toSpritePtr1_return = PLAYFIELD_SPRITES>>6
.label irq_raster_next = 2
.label irq_sprite_ypos = 2
.label irq_sprite_ptr = 2
.label irq_cnt = 2
.label irq_raster_next = 3
.label irq_sprite_ypos = 4
.label irq_sprite_ptr = 5
.label irq_cnt = 6
//SEG2 @begin
bbegin:
jmp b6
@ -2761,26 +2761,26 @@ interrupt(KERNEL_MIN)(void()) irq()
(const byte) irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6
(byte*) irq::toSpritePtr2_sprite
(byte) irq_cnt
(byte) irq_cnt#11 irq_cnt zp ZP_BYTE:2 20.0
(byte) irq_cnt#19 irq_cnt zp ZP_BYTE:2 0.3076923076923077
(byte) irq_cnt#23 irq_cnt zp ZP_BYTE:2 4.0
(byte) irq_cnt#24 irq_cnt zp ZP_BYTE:2 20.0
(byte) irq_cnt#11 irq_cnt zp ZP_BYTE:6 20.0
(byte) irq_cnt#19 irq_cnt zp ZP_BYTE:6 0.3076923076923077
(byte) irq_cnt#23 irq_cnt zp ZP_BYTE:6 4.0
(byte) irq_cnt#24 irq_cnt zp ZP_BYTE:6 20.0
(byte) irq_raster_next
(byte) irq_raster_next#11 irq_raster_next zp ZP_BYTE:2 20.0
(byte) irq_raster_next#13 irq_raster_next zp ZP_BYTE:2 6.0
(byte) irq_raster_next#2 irq_raster_next zp ZP_BYTE:2 0.26666666666666666
(byte) irq_raster_next#20 irq_raster_next zp ZP_BYTE:2 1.0
(byte) irq_raster_next#6 irq_raster_next zp ZP_BYTE:2 1.3333333333333333
(byte) irq_raster_next#11 irq_raster_next zp ZP_BYTE:3 20.0
(byte) irq_raster_next#13 irq_raster_next zp ZP_BYTE:3 6.0
(byte) irq_raster_next#2 irq_raster_next zp ZP_BYTE:3 0.26666666666666666
(byte) irq_raster_next#20 irq_raster_next zp ZP_BYTE:3 1.0
(byte) irq_raster_next#6 irq_raster_next zp ZP_BYTE:3 1.3333333333333333
(byte) irq_sprite_ptr
(byte) irq_sprite_ptr#2 irq_sprite_ptr zp ZP_BYTE:2 0.3529411764705882
(byte) irq_sprite_ptr#3 irq_sprite_ptr zp ZP_BYTE:2 20.0
(byte) irq_sprite_ptr#5 irq_sprite_ptr zp ZP_BYTE:2 20.0
(byte) irq_sprite_ptr#6 irq_sprite_ptr zp ZP_BYTE:2 20.0
(byte) irq_sprite_ptr#2 irq_sprite_ptr zp ZP_BYTE:5 0.3529411764705882
(byte) irq_sprite_ptr#3 irq_sprite_ptr zp ZP_BYTE:5 20.0
(byte) irq_sprite_ptr#5 irq_sprite_ptr zp ZP_BYTE:5 20.0
(byte) irq_sprite_ptr#6 irq_sprite_ptr zp ZP_BYTE:5 20.0
(byte) irq_sprite_ypos
(byte) irq_sprite_ypos#11 irq_sprite_ypos zp ZP_BYTE:2 20.0
(byte) irq_sprite_ypos#2 irq_sprite_ypos zp ZP_BYTE:2 1.4375
(byte) irq_sprite_ypos#26 irq_sprite_ypos zp ZP_BYTE:2 20.0
(byte) irq_sprite_ypos#6 irq_sprite_ypos zp ZP_BYTE:2 20.0
(byte) irq_sprite_ypos#11 irq_sprite_ypos zp ZP_BYTE:4 20.0
(byte) irq_sprite_ypos#2 irq_sprite_ypos zp ZP_BYTE:4 1.4375
(byte) irq_sprite_ypos#26 irq_sprite_ypos zp ZP_BYTE:4 20.0
(byte) irq_sprite_ypos#6 irq_sprite_ypos zp ZP_BYTE:4 20.0
(void()) main()
(label) main::@2
(label) main::@7
@ -2793,7 +2793,11 @@ interrupt(KERNEL_MIN)(void()) irq()
(byte*) toSpritePtr1_sprite
reg byte x [ init_sprites::s#2 init_sprites::s#1 ]
zp ZP_BYTE:2 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 irq_sprite_ypos#11 irq_sprite_ptr#3 irq_cnt#11 irq_cnt#24 irq_sprite_ypos#26 irq_sprite_ptr#5 ]
zp ZP_BYTE:2 [ init_sprites::xpos#2 init_sprites::xpos#1 ]
zp ZP_BYTE:3 [ irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_raster_next#11 ]
zp ZP_BYTE:4 [ irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ypos#11 irq_sprite_ypos#26 ]
zp ZP_BYTE:5 [ irq_sprite_ptr#2 irq_sprite_ptr#6 irq_sprite_ptr#3 irq_sprite_ptr#5 ]
zp ZP_BYTE:6 [ irq_cnt#19 irq_cnt#23 irq_cnt#11 irq_cnt#24 ]
reg byte a [ init_sprites::s2#0 ]
reg byte x [ irq::ptr#0 ]
reg byte x [ irq::ptr#1 ]
@ -2836,10 +2840,10 @@ Score: 1182
.const IRQ_RASTER_FIRST = $30
.label PLAYFIELD_SPRITE_PTRS = PLAYFIELD_SCREEN+SPRITE_PTRS
.const toSpritePtr1_return = PLAYFIELD_SPRITES>>6
.label irq_raster_next = 2
.label irq_sprite_ypos = 2
.label irq_sprite_ptr = 2
.label irq_cnt = 2
.label irq_raster_next = 3
.label irq_sprite_ypos = 4
.label irq_sprite_ptr = 5
.label irq_cnt = 6
//SEG2 @begin
//SEG3 @6
//SEG4 [1] (byte) irq_raster_next#2 ← (const byte) IRQ_RASTER_FIRST#0 -- vbuz1=vbuc1

View File

@ -182,26 +182,26 @@ interrupt(KERNEL_MIN)(void()) irq()
(const byte) irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6
(byte*) irq::toSpritePtr2_sprite
(byte) irq_cnt
(byte) irq_cnt#11 irq_cnt zp ZP_BYTE:2 20.0
(byte) irq_cnt#19 irq_cnt zp ZP_BYTE:2 0.3076923076923077
(byte) irq_cnt#23 irq_cnt zp ZP_BYTE:2 4.0
(byte) irq_cnt#24 irq_cnt zp ZP_BYTE:2 20.0
(byte) irq_cnt#11 irq_cnt zp ZP_BYTE:6 20.0
(byte) irq_cnt#19 irq_cnt zp ZP_BYTE:6 0.3076923076923077
(byte) irq_cnt#23 irq_cnt zp ZP_BYTE:6 4.0
(byte) irq_cnt#24 irq_cnt zp ZP_BYTE:6 20.0
(byte) irq_raster_next
(byte) irq_raster_next#11 irq_raster_next zp ZP_BYTE:2 20.0
(byte) irq_raster_next#13 irq_raster_next zp ZP_BYTE:2 6.0
(byte) irq_raster_next#2 irq_raster_next zp ZP_BYTE:2 0.26666666666666666
(byte) irq_raster_next#20 irq_raster_next zp ZP_BYTE:2 1.0
(byte) irq_raster_next#6 irq_raster_next zp ZP_BYTE:2 1.3333333333333333
(byte) irq_raster_next#11 irq_raster_next zp ZP_BYTE:3 20.0
(byte) irq_raster_next#13 irq_raster_next zp ZP_BYTE:3 6.0
(byte) irq_raster_next#2 irq_raster_next zp ZP_BYTE:3 0.26666666666666666
(byte) irq_raster_next#20 irq_raster_next zp ZP_BYTE:3 1.0
(byte) irq_raster_next#6 irq_raster_next zp ZP_BYTE:3 1.3333333333333333
(byte) irq_sprite_ptr
(byte) irq_sprite_ptr#2 irq_sprite_ptr zp ZP_BYTE:2 0.3529411764705882
(byte) irq_sprite_ptr#3 irq_sprite_ptr zp ZP_BYTE:2 20.0
(byte) irq_sprite_ptr#5 irq_sprite_ptr zp ZP_BYTE:2 20.0
(byte) irq_sprite_ptr#6 irq_sprite_ptr zp ZP_BYTE:2 20.0
(byte) irq_sprite_ptr#2 irq_sprite_ptr zp ZP_BYTE:5 0.3529411764705882
(byte) irq_sprite_ptr#3 irq_sprite_ptr zp ZP_BYTE:5 20.0
(byte) irq_sprite_ptr#5 irq_sprite_ptr zp ZP_BYTE:5 20.0
(byte) irq_sprite_ptr#6 irq_sprite_ptr zp ZP_BYTE:5 20.0
(byte) irq_sprite_ypos
(byte) irq_sprite_ypos#11 irq_sprite_ypos zp ZP_BYTE:2 20.0
(byte) irq_sprite_ypos#2 irq_sprite_ypos zp ZP_BYTE:2 1.4375
(byte) irq_sprite_ypos#26 irq_sprite_ypos zp ZP_BYTE:2 20.0
(byte) irq_sprite_ypos#6 irq_sprite_ypos zp ZP_BYTE:2 20.0
(byte) irq_sprite_ypos#11 irq_sprite_ypos zp ZP_BYTE:4 20.0
(byte) irq_sprite_ypos#2 irq_sprite_ypos zp ZP_BYTE:4 1.4375
(byte) irq_sprite_ypos#26 irq_sprite_ypos zp ZP_BYTE:4 20.0
(byte) irq_sprite_ypos#6 irq_sprite_ypos zp ZP_BYTE:4 20.0
(void()) main()
(label) main::@2
(label) main::@7
@ -214,7 +214,11 @@ interrupt(KERNEL_MIN)(void()) irq()
(byte*) toSpritePtr1_sprite
reg byte x [ init_sprites::s#2 init_sprites::s#1 ]
zp ZP_BYTE:2 [ init_sprites::xpos#2 init_sprites::xpos#1 irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ptr#2 irq_sprite_ptr#6 irq_cnt#19 irq_cnt#23 irq_raster_next#11 irq_sprite_ypos#11 irq_sprite_ptr#3 irq_cnt#11 irq_cnt#24 irq_sprite_ypos#26 irq_sprite_ptr#5 ]
zp ZP_BYTE:2 [ init_sprites::xpos#2 init_sprites::xpos#1 ]
zp ZP_BYTE:3 [ irq_raster_next#13 irq_raster_next#6 irq_raster_next#20 irq_raster_next#2 irq_raster_next#11 ]
zp ZP_BYTE:4 [ irq_sprite_ypos#2 irq_sprite_ypos#6 irq_sprite_ypos#11 irq_sprite_ypos#26 ]
zp ZP_BYTE:5 [ irq_sprite_ptr#2 irq_sprite_ptr#6 irq_sprite_ptr#3 irq_sprite_ptr#5 ]
zp ZP_BYTE:6 [ irq_cnt#19 irq_cnt#23 irq_cnt#11 irq_cnt#24 ]
reg byte a [ init_sprites::s2#0 ]
reg byte x [ irq::ptr#0 ]
reg byte x [ irq::ptr#1 ]

View File

@ -4,7 +4,7 @@
.label KERNEL_IRQ = $314
.label SCREEN = $400
.label col1 = 2
.label col2 = 2
.label col2 = 3
lda #0
sta col1
lda #8

View File

@ -0,0 +1,25 @@
@begin: scope:[] from
[0] (byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
[1] (byte) col2#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
to:@2
@2: scope:[] from @begin
[2] phi()
[3] call main
to:@end
@end: scope:[] from @2
[4] phi()
main: scope:[main] from @2
[5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq()
to:main::@return
main::@return: scope:[main] from main
[6] return
to:@return
irq: scope:[irq] from
[7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) col1#0
[8] (byte) col1#1 ← ++ (byte) col1#0
[9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 41) ← (byte) col2#0
[10] (byte) col2#1 ← ++ (byte) col2#0
to:irq::@return
irq::@return: scope:[irq] from irq
[11] return
to:@return

View File

@ -1,14 +1,410 @@
parsing
flex pass 1
flex pass 2
flex pass 3
Output pass
Resolved forward reference irq to interrupt(KERNEL_MIN)(void()) irq()
Memory Map
----------
Default-segment:
$0801-$080c Basic
$080d-$0833 Program
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(void()**) KERNEL_IRQ#0 ← ((void()**)) (word/signed word/dword/signed dword) 788
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
(byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) col2#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
to:@2
main: scope:[main] from @2
(void()*~) main::$0 ← & interrupt(KERNEL_MIN)(void()) irq()
*((void()**) KERNEL_IRQ#0) ← (void()*~) main::$0
to:main::@return
main::@return: scope:[main] from main
return
to:@return
irq: scope:[irq] from
(byte) col2#3 ← phi( @2/(byte) col2#5 )
(byte) col1#3 ← phi( @2/(byte) col1#5 )
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) col1#3
(byte) col1#1 ← ++ (byte) col1#3
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 41) ← (byte) col2#3
(byte) col2#1 ← ++ (byte) col2#3
to:irq::@return
irq::@return: scope:[irq] from irq
(byte) col2#4 ← phi( irq/(byte) col2#1 )
(byte) col1#4 ← phi( irq/(byte) col1#1 )
(byte) col1#2 ← (byte) col1#4
(byte) col2#2 ← (byte) col2#4
return
to:@return
@2: scope:[] from @begin
(byte) col2#5 ← phi( @begin/(byte) col2#0 )
(byte) col1#5 ← phi( @begin/(byte) col1#0 )
call main
to:@3
@3: scope:[] from @2
to:@end
@end: scope:[] from @3
SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @begin
(label) @end
(void()**) KERNEL_IRQ
(void()**) KERNEL_IRQ#0
(byte*) SCREEN
(byte*) SCREEN#0
(byte) col1
(byte) col1#0
(byte) col1#1
(byte) col1#2
(byte) col1#3
(byte) col1#4
(byte) col1#5
(byte) col2
(byte) col2#0
(byte) col2#1
(byte) col2#2
(byte) col2#3
(byte) col2#4
(byte) col2#5
interrupt(KERNEL_MIN)(void()) irq()
(label) irq::@return
(void()) main()
(void()*~) main::$0
(label) main::@return
Culled Empty Block (label) @3
Successful SSA optimization Pass2CullEmptyBlocks
Alias (byte) col1#1 = (byte) col1#4 (byte) col1#2
Alias (byte) col2#1 = (byte) col2#4 (byte) col2#2
Alias (byte) col1#0 = (byte) col1#5
Alias (byte) col2#0 = (byte) col2#5
Successful SSA optimization Pass2AliasElimination
Redundant Phi (byte) col1#3 (byte) col1#0
Redundant Phi (byte) col2#3 (byte) col2#0
Successful SSA optimization Pass2RedundantPhiElimination
Constant (const void()**) KERNEL_IRQ#0 = ((void()**))788
Constant (const byte*) SCREEN#0 = ((byte*))1024
Constant (const void()*) main::$0 = &irq
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(SCREEN#0+40)
Consolidated array index constant in *(SCREEN#0+41)
Successful SSA optimization Pass2ConstantAdditionElimination
Constant inlined main::$0 = &interrupt(KERNEL_MIN)(void()) irq()
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:3
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] (byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
[1] (byte) col2#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
to:@2
@2: scope:[] from @begin
[2] phi()
[3] call main
to:@end
@end: scope:[] from @2
[4] phi()
main: scope:[main] from @2
[5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq()
to:main::@return
main::@return: scope:[main] from main
[6] return
to:@return
irq: scope:[irq] from
[7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) col1#0
[8] (byte) col1#1 ← ++ (byte) col1#0
[9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 41) ← (byte) col2#0
[10] (byte) col2#1 ← ++ (byte) col2#0
to:irq::@return
irq::@return: scope:[irq] from irq
[11] return
to:@return
VARIABLE REGISTER WEIGHTS
(void()**) KERNEL_IRQ
(byte*) SCREEN
(byte) col1
(byte) col1#0 6.0
(byte) col1#1 20.0
(byte) col2
(byte) col2#0 2.0
(byte) col2#1 20.0
interrupt(KERNEL_MIN)(void()) irq()
(void()) main()
Initial phi equivalence classes
Added variable col1#0 to zero page equivalence class [ col1#0 ]
Added variable col2#0 to zero page equivalence class [ col2#0 ]
Added variable col1#1 to zero page equivalence class [ col1#1 ]
Added variable col2#1 to zero page equivalence class [ col2#1 ]
Complete equivalence classes
[ col1#0 ]
[ col2#0 ]
[ col1#1 ]
[ col2#1 ]
Allocated zp ZP_BYTE:2 [ col1#0 ]
Allocated zp ZP_BYTE:3 [ col2#0 ]
Allocated zp ZP_BYTE:4 [ col1#1 ]
Allocated zp ZP_BYTE:5 [ col2#1 ]
INITIAL ASM
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
.label KERNEL_IRQ = $314
.label SCREEN = $400
.label col1 = 2
.label col2 = 3
.label col1_1 = 4
.label col2_1 = 5
//SEG2 @begin
bbegin:
//SEG3 [0] (byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
lda #0
sta col1
//SEG4 [1] (byte) col2#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuz1=vbuc1
lda #8
sta col2
//SEG5 [2] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG6 @2
b2:
//SEG7 [3] call main
jsr main
//SEG8 [4] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
//SEG11 [5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() -- _deref_pptc1=pprc2
lda #<irq
sta KERNEL_IRQ
lda #>irq
sta KERNEL_IRQ+1
jmp breturn
//SEG12 main::@return
breturn:
//SEG13 [6] return
rts
}
//SEG14 irq
irq: {
//SEG15 entry interrupt(KERNEL_MIN)
//SEG16 [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) col1#0 -- _deref_pbuc1=vbuz1
lda col1
sta SCREEN+$28
//SEG17 [8] (byte) col1#1 ← ++ (byte) col1#0 -- vbuz1=_inc_vbuz2
ldy col1
iny
sty col1_1
//SEG18 [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 41) ← (byte) col2#0 -- _deref_pbuc1=vbuz1
lda col2
sta SCREEN+$29
//SEG19 [10] (byte) col2#1 ← ++ (byte) col2#0 -- vbuz1=_inc_vbuz2
ldy col2
iny
sty col2_1
jmp breturn
//SEG20 irq::@return
breturn:
//SEG21 [11] return - exit interrupt(KERNEL_MIN)
jmp $ea81
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] (byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( ) always clobbers reg byte a
Statement [1] (byte) col2#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 [ ] ( ) always clobbers reg byte a
Statement [5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() [ ] ( main:3 [ ] ) always clobbers reg byte a
Statement [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) col1#0 [ col1#0 col2#0 ] ( ) always clobbers reg byte a
Statement [8] (byte) col1#1 ← ++ (byte) col1#0 [ col2#0 ] ( ) always clobbers reg byte y
Statement [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 41) ← (byte) col2#0 [ col2#0 ] ( ) always clobbers reg byte a
Statement [10] (byte) col2#1 ← ++ (byte) col2#0 [ ] ( ) always clobbers reg byte y
Potential registers zp ZP_BYTE:2 [ col1#0 ] : zp ZP_BYTE:2 ,
Potential registers zp ZP_BYTE:3 [ col2#0 ] : zp ZP_BYTE:3 ,
Potential registers zp ZP_BYTE:4 [ col1#1 ] : zp ZP_BYTE:4 ,
Potential registers zp ZP_BYTE:5 [ col2#1 ] : zp ZP_BYTE:5 ,
REGISTER UPLIFT SCOPES
Uplift Scope [] 20: zp ZP_BYTE:4 [ col1#1 ] 20: zp ZP_BYTE:5 [ col2#1 ] 6: zp ZP_BYTE:2 [ col1#0 ] 2: zp ZP_BYTE:3 [ col2#0 ]
Uplift Scope [main]
Uplift Scope [irq]
Uplifting [] best 79 combination zp ZP_BYTE:4 [ col1#1 ] zp ZP_BYTE:5 [ col2#1 ] zp ZP_BYTE:2 [ col1#0 ] zp ZP_BYTE:3 [ col2#0 ]
Uplifting [main] best 79 combination
Uplifting [irq] best 79 combination
Attempting to uplift remaining variables inzp ZP_BYTE:4 [ col1#1 ]
Uplifting [] best 79 combination zp ZP_BYTE:4 [ col1#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ col2#1 ]
Uplifting [] best 79 combination zp ZP_BYTE:5 [ col2#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:2 [ col1#0 ]
Uplifting [] best 79 combination zp ZP_BYTE:2 [ col1#0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:3 [ col2#0 ]
Uplifting [] best 79 combination zp ZP_BYTE:3 [ col2#0 ]
Coalescing zero page register with common assignment [ zp ZP_BYTE:2 [ col1#0 ] ] with [ zp ZP_BYTE:4 [ col1#1 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_BYTE:3 [ col2#0 ] ] with [ zp ZP_BYTE:5 [ col2#1 ] ] - score: 1
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
.label KERNEL_IRQ = $314
.label SCREEN = $400
.label col1 = 2
.label col2 = 3
//SEG2 @begin
bbegin:
//SEG3 [0] (byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
lda #0
sta col1
//SEG4 [1] (byte) col2#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuz1=vbuc1
lda #8
sta col2
//SEG5 [2] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG6 @2
b2:
//SEG7 [3] call main
jsr main
//SEG8 [4] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
//SEG11 [5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() -- _deref_pptc1=pprc2
lda #<irq
sta KERNEL_IRQ
lda #>irq
sta KERNEL_IRQ+1
jmp breturn
//SEG12 main::@return
breturn:
//SEG13 [6] return
rts
}
//SEG14 irq
irq: {
//SEG15 entry interrupt(KERNEL_MIN)
//SEG16 [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) col1#0 -- _deref_pbuc1=vbuz1
lda col1
sta SCREEN+$28
//SEG17 [8] (byte) col1#1 ← ++ (byte) col1#0 -- vbuz1=_inc_vbuz1
inc col1
//SEG18 [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 41) ← (byte) col2#0 -- _deref_pbuc1=vbuz1
lda col2
sta SCREEN+$29
//SEG19 [10] (byte) col2#1 ← ++ (byte) col2#0 -- vbuz1=_inc_vbuz1
inc col2
jmp breturn
//SEG20 irq::@return
breturn:
//SEG21 [11] return - exit interrupt(KERNEL_MIN)
jmp $ea81
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp bend
Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction b2_from_bbegin:
Removing instruction bend_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bbegin:
Removing instruction b2:
Removing instruction bend:
Removing instruction breturn:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(void()**) KERNEL_IRQ
(const void()**) KERNEL_IRQ#0 KERNEL_IRQ = ((void()**))(word/signed word/dword/signed dword) 788
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte) col1
(byte) col1#0 col1 zp ZP_BYTE:2 6.0
(byte) col1#1 col1 zp ZP_BYTE:2 20.0
(byte) col2
(byte) col2#0 col2 zp ZP_BYTE:3 2.0
(byte) col2#1 col2 zp ZP_BYTE:3 20.0
interrupt(KERNEL_MIN)(void()) irq()
(label) irq::@return
(void()) main()
(label) main::@return
zp ZP_BYTE:2 [ col1#0 col1#1 ]
zp ZP_BYTE:3 [ col2#0 col2#1 ]
FINAL ASSEMBLER
Score: 61
//SEG0 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG1 Global Constants & labels
.label KERNEL_IRQ = $314
.label SCREEN = $400
.label col1 = 2
.label col2 = 3
//SEG2 @begin
//SEG3 [0] (byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
lda #0
sta col1
//SEG4 [1] (byte) col2#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuz1=vbuc1
lda #8
sta col2
//SEG5 [2] phi from @begin to @2 [phi:@begin->@2]
//SEG6 @2
//SEG7 [3] call main
jsr main
//SEG8 [4] phi from @2 to @end [phi:@2->@end]
//SEG9 @end
//SEG10 main
main: {
//SEG11 [5] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) irq() -- _deref_pptc1=pprc2
lda #<irq
sta KERNEL_IRQ
lda #>irq
sta KERNEL_IRQ+1
//SEG12 main::@return
//SEG13 [6] return
rts
}
//SEG14 irq
irq: {
//SEG15 entry interrupt(KERNEL_MIN)
//SEG16 [7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 40) ← (byte) col1#0 -- _deref_pbuc1=vbuz1
lda col1
sta SCREEN+$28
//SEG17 [8] (byte) col1#1 ← ++ (byte) col1#0 -- vbuz1=_inc_vbuz1
inc col1
//SEG18 [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 41) ← (byte) col2#0 -- _deref_pbuc1=vbuz1
lda col2
sta SCREEN+$29
//SEG19 [10] (byte) col2#1 ← ++ (byte) col2#0 -- vbuz1=_inc_vbuz1
inc col2
//SEG20 irq::@return
//SEG21 [11] return - exit interrupt(KERNEL_MIN)
jmp $ea81
}
Writing prg file: /var/folders/j3/hvhhv4vs6291pncspymzkrfh0000gp/T/kickc-output2800452417889124972/bin/interrupt-volatile-reuse-problem1.prg
Writing Vice symbol file: /var/folders/j3/hvhhv4vs6291pncspymzkrfh0000gp/T/kickc-output2800452417889124972/bin/interrupt-volatile-reuse-problem1.vs

View File

@ -0,0 +1,20 @@
(label) @2
(label) @begin
(label) @end
(void()**) KERNEL_IRQ
(const void()**) KERNEL_IRQ#0 KERNEL_IRQ = ((void()**))(word/signed word/dword/signed dword) 788
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte) col1
(byte) col1#0 col1 zp ZP_BYTE:2 6.0
(byte) col1#1 col1 zp ZP_BYTE:2 20.0
(byte) col2
(byte) col2#0 col2 zp ZP_BYTE:3 2.0
(byte) col2#1 col2 zp ZP_BYTE:3 20.0
interrupt(KERNEL_MIN)(void()) irq()
(label) irq::@return
(void()) main()
(label) main::@return
zp ZP_BYTE:2 [ col1#0 col1#1 ]
zp ZP_BYTE:3 [ col2#0 col2#1 ]

View File

@ -4,7 +4,7 @@
.label KERNEL_IRQ = $314
.label IRQ_STATUS = $d019
.label SCREEN = $400
.label col1 = 2
.label col1 = 3
lda #0
sta col1
jsr main

View File

@ -472,8 +472,8 @@ Uplifting [] best 323340 combination zp ZP_BYTE:7 [ col1#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:5 [ col1#0 ]
Uplifting [] best 323340 combination zp ZP_BYTE:5 [ col1#0 ]
Coalescing zero page register with common assignment [ zp ZP_BYTE:5 [ col1#0 ] ] with [ zp ZP_BYTE:7 [ col1#1 ] ] - score: 1
Coalescing zero page register [ zp ZP_BYTE:3 [ main::y#4 main::y#1 ] ] with [ zp ZP_BYTE:5 [ col1#0 col1#1 ] ]
Allocated (was zp ZP_BYTE:3) zp ZP_BYTE:2 [ main::y#4 main::y#1 col1#0 col1#1 ]
Allocated (was zp ZP_BYTE:3) zp ZP_BYTE:2 [ main::y#4 main::y#1 ]
Allocated (was zp ZP_BYTE:5) zp ZP_BYTE:3 [ col1#0 col1#1 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 Basic Upstart
@ -484,7 +484,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.label KERNEL_IRQ = $314
.label IRQ_STATUS = $d019
.label SCREEN = $400
.label col1 = 2
.label col1 = 3
//SEG2 @begin
bbegin:
//SEG3 [0] (byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
@ -655,8 +655,8 @@ FINAL SYMBOL TABLE
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte) col1
(byte) col1#0 col1 zp ZP_BYTE:2 2.0
(byte) col1#1 col1 zp ZP_BYTE:2 20.0
(byte) col1#0 col1 zp ZP_BYTE:3 2.0
(byte) col1#1 col1 zp ZP_BYTE:3 20.0
interrupt(KERNEL_MIN)(void()) irq()
(label) irq::@return
(void()) main()
@ -678,8 +678,9 @@ interrupt(KERNEL_MIN)(void()) irq()
(byte) main::y#4 y zp ZP_BYTE:2 2000.4999999999998
reg byte x [ main::x#6 main::x#1 ]
zp ZP_BYTE:2 [ main::y#4 main::y#1 col1#0 col1#1 ]
zp ZP_BYTE:2 [ main::y#4 main::y#1 ]
reg byte y [ main::a#2 main::a#1 ]
zp ZP_BYTE:3 [ col1#0 col1#1 ]
reg byte a [ main::$1 ]
@ -694,7 +695,7 @@ Score: 223698
.label KERNEL_IRQ = $314
.label IRQ_STATUS = $d019
.label SCREEN = $400
.label col1 = 2
.label col1 = 3
//SEG2 @begin
//SEG3 [0] (byte) col1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
lda #0

View File

@ -9,8 +9,8 @@
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
(byte) col1
(byte) col1#0 col1 zp ZP_BYTE:2 2.0
(byte) col1#1 col1 zp ZP_BYTE:2 20.0
(byte) col1#0 col1 zp ZP_BYTE:3 2.0
(byte) col1#1 col1 zp ZP_BYTE:3 20.0
interrupt(KERNEL_MIN)(void()) irq()
(label) irq::@return
(void()) main()
@ -32,6 +32,7 @@ interrupt(KERNEL_MIN)(void()) irq()
(byte) main::y#4 y zp ZP_BYTE:2 2000.4999999999998
reg byte x [ main::x#6 main::x#1 ]
zp ZP_BYTE:2 [ main::y#4 main::y#1 col1#0 col1#1 ]
zp ZP_BYTE:2 [ main::y#4 main::y#1 ]
reg byte y [ main::a#2 main::a#1 ]
zp ZP_BYTE:3 [ col1#0 col1#1 ]
reg byte a [ main::$1 ]