mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-11 20:37:40 +00:00
FlightControl fix for #678.
This commit is contained in:
parent
c5f260e882
commit
5c86d25057
@ -217,12 +217,6 @@ commaExpr
|
||||
| commaExpr COMMA expr #commaSimple
|
||||
;
|
||||
|
||||
|
||||
initExpr
|
||||
: (DOT expr ASSIGN)? expr
|
||||
;
|
||||
|
||||
|
||||
expr
|
||||
: PAR_BEGIN commaExpr PAR_END #exprPar
|
||||
| expr DOT NAME #exprDot
|
||||
@ -249,9 +243,10 @@ expr
|
||||
| expr ( '&&' ) expr #exprBinary
|
||||
| expr ( '||' ) expr #exprBinary
|
||||
| expr '?' expr COLON expr #exprTernary
|
||||
| <assoc=right> expr '=' expr #exprAssignment
|
||||
| <assoc=right> expr ASSIGN expr #exprAssignment
|
||||
| <assoc=right> expr ASSIGN_COMPOUND expr #exprAssignmentCompound
|
||||
| CURLY_BEGIN initExpr (COMMA initExpr )* COMMA? CURLY_END #initList
|
||||
| CURLY_BEGIN expr (COMMA expr )* COMMA? CURLY_END #initList
|
||||
| CURLY_BEGIN DOT NAME ASSIGN expr CURLY_END #initUnion
|
||||
| NAME #exprId
|
||||
| NUMBER #exprNumber
|
||||
| STRING+ #exprString
|
||||
|
@ -1,34 +0,0 @@
|
||||
struct M {
|
||||
unsigned int flight;
|
||||
signed char turn;
|
||||
unsigned char speed;
|
||||
};
|
||||
|
||||
struct T {
|
||||
signed char turn;
|
||||
unsigned char radius;
|
||||
unsigned char speed;
|
||||
};
|
||||
|
||||
struct E {
|
||||
unsigned char explode;
|
||||
};
|
||||
|
||||
union A {
|
||||
struct M move;
|
||||
struct T turn;
|
||||
struct E end;
|
||||
};
|
||||
|
||||
struct F {
|
||||
union A action;
|
||||
unsigned char type;
|
||||
unsigned char next;
|
||||
};
|
||||
|
||||
|
||||
struct F action_flightpath_001[] = {
|
||||
{ .move={ action_move_00 }, STAGE_ACTION_MOVE, 1 },
|
||||
{ { action_end } , STAGE_ACTION_END, 0 }
|
||||
};
|
||||
|
@ -159,51 +159,55 @@ public class Initializers {
|
||||
}
|
||||
}
|
||||
|
||||
boolean allConst = true;
|
||||
// Constantified values in a list
|
||||
List<RValue> constantifiedList = new ArrayList<>();
|
||||
// Map filled if all member values become constant
|
||||
LinkedHashMap<SymbolVariableRef, ConstantValue> constMemberMap = new LinkedHashMap<>();
|
||||
Iterator<Variable> memberDefIt = memberDefinitions.iterator();
|
||||
Iterator<RValue> valueIt = valueList.getList().iterator();
|
||||
for(int i = 0; i < structInitNeedSize; i++) {
|
||||
if(valueList instanceof ValueListUnionDesignator) {
|
||||
|
||||
ValueListUnionDesignator unionInit = (ValueListUnionDesignator) valueList;
|
||||
final String memberName = unionInit.getMemberName();
|
||||
final RValue initValue = unionInit.getList().get(0);
|
||||
|
||||
Variable memberDef = null;
|
||||
RValue memberValue = valueIt.next();
|
||||
if(structDefinition.isUnion()) {
|
||||
String memberUnionName = ((ValueStructList)valueList).getMember(memberValue);
|
||||
if(memberUnionName != null) {
|
||||
boolean found = false;
|
||||
while (memberDefIt.hasNext()) {
|
||||
memberDef = memberDefIt.next();
|
||||
if (memberDef.getLocalName().contentEquals(memberUnionName)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
throw new CompileError(
|
||||
"Union initializer cannot find member field " + memberUnionName + "\n" +
|
||||
" Union initializer: " + valueList.toString(program),
|
||||
source);
|
||||
} else {
|
||||
memberDef = memberDefIt.next();
|
||||
for(Variable definition : memberDefinitions) {
|
||||
if(definition.getLocalName().equals(memberName)) {
|
||||
memberDef = definition;
|
||||
}
|
||||
} else {
|
||||
memberDef = memberDefIt.next();
|
||||
}
|
||||
RValue constantifiedMemberValue = constantify(memberValue, new ValueTypeSpec(memberDef.getType()), program, source);
|
||||
constantifiedList.add(constantifiedMemberValue);
|
||||
if(constantifiedMemberValue instanceof ConstantValue)
|
||||
if(memberDef==null)
|
||||
throw new CompileError( "Union member not found", source);
|
||||
|
||||
RValue constantifiedMemberValue = constantify(initValue, new ValueTypeSpec(memberDef.getType()), program, source);
|
||||
if(constantifiedMemberValue instanceof ConstantValue) {
|
||||
LinkedHashMap<SymbolVariableRef, ConstantValue> constMemberMap = new LinkedHashMap<>();
|
||||
constMemberMap.put(memberDef.getRef(), (ConstantValue) constantifiedMemberValue);
|
||||
else
|
||||
allConst = false;
|
||||
}
|
||||
if(allConst) {
|
||||
// Constant struct
|
||||
return new ConstantStructValue(structType, constMemberMap);
|
||||
return new ConstantStructValue(structType, constMemberMap);
|
||||
} else {
|
||||
throw new CompileError( "Union initializer is not constant", source);
|
||||
}
|
||||
} else {
|
||||
// Constantified list with a cast
|
||||
return new CastValue(structType, new ValueList(constantifiedList));
|
||||
boolean allConst = true;
|
||||
// Constantified values in a list
|
||||
List<RValue> constantifiedList = new ArrayList<>();
|
||||
// Map filled if all member values become constant
|
||||
LinkedHashMap<SymbolVariableRef, ConstantValue> constMemberMap = new LinkedHashMap<>();
|
||||
Iterator<Variable> memberDefIt = memberDefinitions.iterator();
|
||||
Iterator<RValue> valueIt = valueList.getList().iterator();
|
||||
for(int i = 0; i < structInitNeedSize; i++) {
|
||||
Variable memberDef = memberDefIt.next();
|
||||
RValue memberValue = valueIt.next();
|
||||
RValue constantifiedMemberValue = constantify(memberValue, new ValueTypeSpec(memberDef.getType()), program, source);
|
||||
constantifiedList.add(constantifiedMemberValue);
|
||||
if(constantifiedMemberValue instanceof ConstantValue)
|
||||
constMemberMap.put(memberDef.getRef(), (ConstantValue) constantifiedMemberValue);
|
||||
else
|
||||
allConst = false;
|
||||
}
|
||||
if(allConst) {
|
||||
// Constant struct
|
||||
return new ConstantStructValue(structType, constMemberMap);
|
||||
} else {
|
||||
// Constantified list with a cast
|
||||
return new CastValue(structType, new ValueList(constantifiedList));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
package dk.camelot64.kickc.model.values;
|
||||
|
||||
import dk.camelot64.kickc.model.Program;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A union designator initializer.
|
||||
* <p>
|
||||
* The init list will have length one.
|
||||
*/
|
||||
public class ValueListUnionDesignator extends ValueList {
|
||||
|
||||
private String memberName;
|
||||
|
||||
public ValueListUnionDesignator(String memberName, RValue rValue) {
|
||||
super(asList(rValue));
|
||||
this.memberName = memberName;
|
||||
}
|
||||
|
||||
static List<RValue> asList(RValue rValue) {
|
||||
final ArrayList<RValue> list = new ArrayList<>();
|
||||
list.add(rValue);
|
||||
return list;
|
||||
}
|
||||
|
||||
public String getMemberName() { return memberName; }
|
||||
|
||||
@Override
|
||||
public String toString(Program program) {
|
||||
StringBuilder out = new StringBuilder();
|
||||
out.append("{ ");
|
||||
out.append(memberName);
|
||||
out.append("=");
|
||||
out.append(getList().get(0).toString(program));
|
||||
out.append(" }");
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return toString(null);
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
package dk.camelot64.kickc.model.values;
|
||||
|
||||
import dk.camelot64.kickc.model.Program;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A list of sub-values.
|
||||
* Used for struct value initializers.
|
||||
*/
|
||||
public class ValueStructList extends ValueList {
|
||||
|
||||
private HashMap<RValue, String> members;
|
||||
|
||||
public ValueStructList(HashMap<RValue, String> members, List<RValue> list) {
|
||||
super(list);
|
||||
this.members = members;
|
||||
}
|
||||
|
||||
public HashMap<RValue, String> getMembers() {
|
||||
return members;
|
||||
}
|
||||
public String getMember(RValue init) { return members.get(init); }
|
||||
|
||||
@Override
|
||||
public String toString(Program program) {
|
||||
StringBuilder out = new StringBuilder();
|
||||
boolean first = true;
|
||||
out.append("{ ");
|
||||
for(RValue constantValue : getList()) {
|
||||
if(!first) {
|
||||
out.append(", ");
|
||||
}
|
||||
first = false;
|
||||
out.append(constantValue.toString(program));
|
||||
}
|
||||
out.append(" }");
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return toString(null);
|
||||
}
|
||||
}
|
@ -1913,24 +1913,21 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RValue visitInitUnion(KickCParser.InitUnionContext ctx) {
|
||||
final String memberName = ctx.NAME().getText();
|
||||
final RValue rValue = (RValue) visit(ctx.expr());
|
||||
return new ValueListUnionDesignator(memberName, rValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RValue visitInitList(KickCParser.InitListContext ctx) {
|
||||
List<RValue> initValues = new ArrayList<>();
|
||||
HashMap<RValue, String> initDesignators = new HashMap<>();
|
||||
|
||||
for(KickCParser.InitExprContext initializer : ctx.initExpr()) {
|
||||
String initString = initializer.getText();
|
||||
if (initializer.expr().size() == 2) {
|
||||
RValue member = (RValue) visit(initializer.expr(0));
|
||||
RValue rValue = (RValue) visit(initializer.expr(1));
|
||||
initValues.add(rValue);
|
||||
initDesignators.put(rValue, member.toString());
|
||||
} else {
|
||||
RValue rValue = (RValue) visit(initializer.expr(0));
|
||||
for(KickCParser.ExprContext initializer : ctx.expr()) {
|
||||
RValue rValue = (RValue) visit(initializer);
|
||||
initValues.add(rValue);
|
||||
}
|
||||
}
|
||||
return new ValueStructList(initDesignators, initValues);
|
||||
return new ValueList(initValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2541,6 +2541,11 @@ public class TestProgramsFast extends TestPrograms {
|
||||
compileAndCompare("weeip-bbslist.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnion13() throws IOException {
|
||||
compileAndCompare("union-13.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnion12() throws IOException {
|
||||
compileAndCompare("union-12.c");
|
||||
|
20
src/test/kc/union-13.c
Normal file
20
src/test/kc/union-13.c
Normal file
@ -0,0 +1,20 @@
|
||||
// More extensive union with C99 style designator initialization behaviour using const expressions.
|
||||
|
||||
union A {
|
||||
unsigned char b;
|
||||
unsigned int w;
|
||||
};
|
||||
|
||||
union B {
|
||||
union A a;
|
||||
char b[4];
|
||||
};
|
||||
|
||||
union B b1 = { .a={ .b=1 } };
|
||||
|
||||
|
||||
char* const SCREEN = (char*)0x0400;
|
||||
|
||||
void main() {
|
||||
SCREEN[0] = b1.b[0];
|
||||
}
|
@ -1,7 +1,4 @@
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour.
|
||||
// Upstart
|
||||
.cpu _65c02
|
||||
// More extensive union with C99 style designator initialization behaviour of the second element.
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-10.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -10,20 +7,14 @@
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = data.m.f
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .byte 1, 2, 3, 4
|
8
src/test/ref/union-10.cfg
Normal file
8
src/test/ref/union-10.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)(struct Move *)&data)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
166
src/test/ref/union-10.log
Normal file
166
src/test/ref/union-10.log
Normal file
@ -0,0 +1,166 @@
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start
|
||||
SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
to:@return
|
||||
|
||||
void __start()
|
||||
__start: scope:[__start] from
|
||||
call main
|
||||
to:__start::@1
|
||||
__start::@1: scope:[__start] from __start
|
||||
to:__start::@return
|
||||
__start::@return: scope:[__start] from __start::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
__constant char OFFSET_STRUCT_MOVE_F = 0
|
||||
__constant char OFFSET_UNION_DATA_M = 0
|
||||
__constant char * const SCREEN = (char *)$400
|
||||
void __start()
|
||||
__loadstore union Data data = { t: { t: 1, s: 2, r: 3, d: 4 } }
|
||||
void main()
|
||||
|
||||
Adding number conversion cast (unumber) 0 in SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (char *) 1024
|
||||
Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (char) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Simplifying expression containing zero (char *)(struct Move *)&data+OFFSET_UNION_DATA_M in [0] SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
Simplifying expression containing zero (struct Move *)&data in [0] SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M)
|
||||
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = *((char *)(struct Move *)&data)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant OFFSET_UNION_DATA_M
|
||||
Eliminating unused constant OFFSET_STRUCT_MOVE_F
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
CALL GRAPH
|
||||
|
||||
Created 0 initial phi equivalence classes
|
||||
Coalesced down to 0 phi equivalence classes
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)(struct Move *)&data)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
__loadstore union Data data = { t: { t: 1, s: 2, r: 3, d: 4 } }
|
||||
void main()
|
||||
|
||||
Initial phi equivalence classes
|
||||
Added variable data to live range equivalence class [ data ]
|
||||
Complete equivalence classes
|
||||
[ data ]
|
||||
Allocated mem[4] [ data ]
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] *SCREEN = *((char *)(struct Move *)&data) [ ] ( [ ] { } ) always clobbers reg byte a
|
||||
Potential registers mem[4] [ data ] : mem[4] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [Move]
|
||||
Uplift Scope [Turn]
|
||||
Uplift Scope [Data]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [] 0: mem[4] [ data ]
|
||||
|
||||
Uplifting [Move] best 17 combination
|
||||
Uplifting [Turn] best 17 combination
|
||||
Uplifting [Data] best 17 combination
|
||||
Uplifting [main] best 17 combination
|
||||
Uplifting [] best 17 combination mem[4] [ data ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour of the second element.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-10.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .byte 1, 2, 3, 4
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp __breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction __breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union Data data = { t: { t: 1, s: 2, r: 3, d: 4 } } // mem[4]
|
||||
void main()
|
||||
|
||||
mem[4] [ data ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 14
|
||||
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour of the second element.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-10.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = data.m.f
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .byte 1, 2, 3, 4
|
||||
|
5
src/test/ref/union-10.sym
Normal file
5
src/test/ref/union-10.sym
Normal file
@ -0,0 +1,5 @@
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union Data data = { t: { t: 1, s: 2, r: 3, d: 4 } } // mem[4]
|
||||
void main()
|
||||
|
||||
mem[4] [ data ]
|
@ -1,7 +1,4 @@
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour.
|
||||
// Upstart
|
||||
.cpu _65c02
|
||||
// More extensive union with C99 style designator initialization behaviour of the first element.
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-11.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -10,21 +7,15 @@
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = data.m.f
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .byte 1, 2, 3
|
||||
.fill 1, 0
|
8
src/test/ref/union-11.cfg
Normal file
8
src/test/ref/union-11.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)(struct Move *)&data)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
168
src/test/ref/union-11.log
Normal file
168
src/test/ref/union-11.log
Normal file
@ -0,0 +1,168 @@
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start
|
||||
SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
to:@return
|
||||
|
||||
void __start()
|
||||
__start: scope:[__start] from
|
||||
call main
|
||||
to:__start::@1
|
||||
__start::@1: scope:[__start] from __start
|
||||
to:__start::@return
|
||||
__start::@return: scope:[__start] from __start::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
__constant char OFFSET_STRUCT_MOVE_F = 0
|
||||
__constant char OFFSET_UNION_DATA_M = 0
|
||||
__constant char * const SCREEN = (char *)$400
|
||||
void __start()
|
||||
__loadstore union Data data = { m: { f: 1, t: 2, s: 3 } }
|
||||
void main()
|
||||
|
||||
Adding number conversion cast (unumber) 0 in SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (char *) 1024
|
||||
Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (char) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Simplifying expression containing zero (char *)(struct Move *)&data+OFFSET_UNION_DATA_M in [0] SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
Simplifying expression containing zero (struct Move *)&data in [0] SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M)
|
||||
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = *((char *)(struct Move *)&data)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant OFFSET_UNION_DATA_M
|
||||
Eliminating unused constant OFFSET_STRUCT_MOVE_F
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
CALL GRAPH
|
||||
|
||||
Created 0 initial phi equivalence classes
|
||||
Coalesced down to 0 phi equivalence classes
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)(struct Move *)&data)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
__loadstore union Data data = { m: { f: 1, t: 2, s: 3 } }
|
||||
void main()
|
||||
|
||||
Initial phi equivalence classes
|
||||
Added variable data to live range equivalence class [ data ]
|
||||
Complete equivalence classes
|
||||
[ data ]
|
||||
Allocated mem[4] [ data ]
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] *SCREEN = *((char *)(struct Move *)&data) [ ] ( [ ] { } ) always clobbers reg byte a
|
||||
Potential registers mem[4] [ data ] : mem[4] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [Move]
|
||||
Uplift Scope [Turn]
|
||||
Uplift Scope [Data]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [] 0: mem[4] [ data ]
|
||||
|
||||
Uplifting [Move] best 17 combination
|
||||
Uplifting [Turn] best 17 combination
|
||||
Uplifting [Data] best 17 combination
|
||||
Uplifting [main] best 17 combination
|
||||
Uplifting [] best 17 combination mem[4] [ data ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour of the first element.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-11.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .byte 1, 2, 3
|
||||
.fill 1, 0
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp __breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction __breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union Data data = { m: { f: 1, t: 2, s: 3 } } // mem[4]
|
||||
void main()
|
||||
|
||||
mem[4] [ data ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 14
|
||||
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour of the first element.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-11.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = data.m.f
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .byte 1, 2, 3
|
||||
.fill 1, 0
|
||||
|
5
src/test/ref/union-11.sym
Normal file
5
src/test/ref/union-11.sym
Normal file
@ -0,0 +1,5 @@
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union Data data = { m: { f: 1, t: 2, s: 3 } } // mem[4]
|
||||
void main()
|
||||
|
||||
mem[4] [ data ]
|
@ -1,7 +1,4 @@
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour using const expressions.
|
||||
// Upstart
|
||||
.cpu _65c02
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-12.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -10,21 +7,15 @@
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = data.m.f
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
move: .byte 1, 2, 3
|
||||
data: .fill 1, 0
|
8
src/test/ref/union-12.cfg
Normal file
8
src/test/ref/union-12.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)(struct Move *)&data)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
170
src/test/ref/union-12.log
Normal file
170
src/test/ref/union-12.log
Normal file
@ -0,0 +1,170 @@
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start
|
||||
SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
to:@return
|
||||
|
||||
void __start()
|
||||
__start: scope:[__start] from
|
||||
call main
|
||||
to:__start::@1
|
||||
__start::@1: scope:[__start] from __start
|
||||
to:__start::@return
|
||||
__start::@return: scope:[__start] from __start::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
__constant char OFFSET_STRUCT_MOVE_F = 0
|
||||
__constant char OFFSET_UNION_DATA_M = 0
|
||||
__constant char * const SCREEN = (char *)$400
|
||||
void __start()
|
||||
__loadstore union Data data = { m: move }
|
||||
void main()
|
||||
__constant const struct Move move = { f: 1, t: 2, s: 3 }
|
||||
|
||||
Adding number conversion cast (unumber) 0 in SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (char *) 1024
|
||||
Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (char) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Simplifying expression containing zero (char *)(struct Move *)&data+OFFSET_UNION_DATA_M in [0] SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M+OFFSET_STRUCT_MOVE_F)
|
||||
Simplifying expression containing zero (struct Move *)&data in [0] SCREEN[0] = *((char *)(struct Move *)&data+OFFSET_UNION_DATA_M)
|
||||
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = *((char *)(struct Move *)&data)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant OFFSET_UNION_DATA_M
|
||||
Eliminating unused constant OFFSET_STRUCT_MOVE_F
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
CALL GRAPH
|
||||
|
||||
Created 0 initial phi equivalence classes
|
||||
Coalesced down to 0 phi equivalence classes
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)(struct Move *)&data)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
__loadstore union Data data = { m: move }
|
||||
void main()
|
||||
|
||||
Initial phi equivalence classes
|
||||
Added variable data to live range equivalence class [ data ]
|
||||
Complete equivalence classes
|
||||
[ data ]
|
||||
Allocated mem[4] [ data ]
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] *SCREEN = *((char *)(struct Move *)&data) [ ] ( [ ] { } ) always clobbers reg byte a
|
||||
Potential registers mem[4] [ data ] : mem[4] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [Move]
|
||||
Uplift Scope [Turn]
|
||||
Uplift Scope [Data]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [] 0: mem[4] [ data ]
|
||||
|
||||
Uplifting [Move] best 17 combination
|
||||
Uplifting [Turn] best 17 combination
|
||||
Uplifting [Data] best 17 combination
|
||||
Uplifting [main] best 17 combination
|
||||
Uplifting [] best 17 combination mem[4] [ data ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour using const expressions.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-12.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
move: .byte 1, 2, 3
|
||||
data: .fill 1, 0
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp __breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction __breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union Data data = { m: move } // mem[4]
|
||||
void main()
|
||||
__constant const struct Move move = { f: 1, t: 2, s: 3 }
|
||||
|
||||
mem[4] [ data ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 14
|
||||
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour using const expressions.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-12.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = data.m.f
|
||||
// [0] *SCREEN = *((char *)(struct Move *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
move: .byte 1, 2, 3
|
||||
data: .fill 1, 0
|
||||
|
6
src/test/ref/union-12.sym
Normal file
6
src/test/ref/union-12.sym
Normal file
@ -0,0 +1,6 @@
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union Data data = { m: move } // mem[4]
|
||||
void main()
|
||||
__constant const struct Move move = { f: 1, t: 2, s: 3 }
|
||||
|
||||
mem[4] [ data ]
|
22
src/test/ref/union-13.asm
Normal file
22
src/test/ref/union-13.asm
Normal file
@ -0,0 +1,22 @@
|
||||
// More extensive union with C99 style designator initialization behaviour using const expressions.
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-13.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
main: {
|
||||
// SCREEN[0] = b1.b[0]
|
||||
lda b1
|
||||
sta SCREEN
|
||||
// }
|
||||
rts
|
||||
}
|
||||
.segment Data
|
||||
b1: .byte 1
|
||||
.fill 1, 0
|
||||
.fill 2, 0
|
8
src/test/ref/union-13.cfg
Normal file
8
src/test/ref/union-13.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)&b1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
176
src/test/ref/union-13.log
Normal file
176
src/test/ref/union-13.log
Normal file
@ -0,0 +1,176 @@
|
||||
Fixing struct type size union B to 4
|
||||
Fixing struct type size union B to 4
|
||||
Fixing struct type SIZE_OF union B to 4
|
||||
Fixing struct type SIZE_OF union B to 4
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start
|
||||
SCREEN[0] = ((char *)&b1+OFFSET_UNION_B_B)[0]
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
to:@return
|
||||
|
||||
void __start()
|
||||
__start: scope:[__start] from
|
||||
call main
|
||||
to:__start::@1
|
||||
__start::@1: scope:[__start] from __start
|
||||
to:__start::@return
|
||||
__start::@return: scope:[__start] from __start::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
__constant char OFFSET_UNION_B_B = 0
|
||||
__constant char * const SCREEN = (char *)$400
|
||||
void __start()
|
||||
__loadstore union B b1 = { a: { b: 1 } }
|
||||
void main()
|
||||
|
||||
Adding number conversion cast (unumber) 0 in SCREEN[0] = ((char *)&b1+OFFSET_UNION_B_B)[0]
|
||||
Adding number conversion cast (unumber) 0 in SCREEN[0] = ((char *)&b1+OFFSET_UNION_B_B)[(unumber)0]
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (char *) 1024
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (char) 0
|
||||
Finalized unsigned number type (char) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Simplifying expression containing zero (char *)&b1+OFFSET_UNION_B_B in [0] SCREEN[0] = ((char *)&b1+OFFSET_UNION_B_B)[0]
|
||||
Simplifying expression containing zero (char *)&b1 in [0] SCREEN[0] = *((char *)&b1+OFFSET_UNION_B_B)
|
||||
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = *((char *)&b1)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant OFFSET_UNION_B_B
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Finalized unsigned number type (char) 4
|
||||
Finalized unsigned number type (char) 4
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
CALL GRAPH
|
||||
|
||||
Created 0 initial phi equivalence classes
|
||||
Coalesced down to 0 phi equivalence classes
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)&b1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
__loadstore union B b1 = { a: { b: 1 } }
|
||||
void main()
|
||||
|
||||
Initial phi equivalence classes
|
||||
Added variable b1 to live range equivalence class [ b1 ]
|
||||
Complete equivalence classes
|
||||
[ b1 ]
|
||||
Allocated mem[4] [ b1 ]
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] *SCREEN = *((char *)&b1) [ ] ( [ ] { } ) always clobbers reg byte a
|
||||
Potential registers mem[4] [ b1 ] : mem[4] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [A]
|
||||
Uplift Scope [B]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [] 0: mem[4] [ b1 ]
|
||||
|
||||
Uplifting [A] best 17 combination
|
||||
Uplifting [B] best 17 combination
|
||||
Uplifting [main] best 17 combination
|
||||
Uplifting [] best 17 combination mem[4] [ b1 ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour using const expressions.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-13.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// [0] *SCREEN = *((char *)&b1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda b1
|
||||
sta SCREEN
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
b1: .byte 1
|
||||
.fill 1, 0
|
||||
.fill 2, 0
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp __breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction __breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union B b1 = { a: { b: 1 } } // mem[4]
|
||||
void main()
|
||||
|
||||
mem[4] [ b1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 14
|
||||
|
||||
// File Comments
|
||||
// More extensive union with C99 style designator initialization behaviour using const expressions.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-13.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = b1.b[0]
|
||||
// [0] *SCREEN = *((char *)&b1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda b1
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
b1: .byte 1
|
||||
.fill 1, 0
|
||||
.fill 2, 0
|
||||
|
5
src/test/ref/union-13.sym
Normal file
5
src/test/ref/union-13.sym
Normal file
@ -0,0 +1,5 @@
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union B b1 = { a: { b: 1 } } // mem[4]
|
||||
void main()
|
||||
|
||||
mem[4] [ b1 ]
|
@ -1,7 +1,4 @@
|
||||
// File Comments
|
||||
// Minimal union with C-Standard behavior
|
||||
// Upstart
|
||||
.cpu _65c02
|
||||
// Minimal union with C99 style designator initialization behaviour.
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-9.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
@ -10,20 +7,14 @@
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = data.b
|
||||
// [0] *SCREEN = *((char *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .word $4d2
|
8
src/test/ref/union-9.cfg
Normal file
8
src/test/ref/union-9.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)&data)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
159
src/test/ref/union-9.log
Normal file
159
src/test/ref/union-9.log
Normal file
@ -0,0 +1,159 @@
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start
|
||||
SCREEN[0] = *((char *)&data+OFFSET_UNION_DATA_B)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
to:@return
|
||||
|
||||
void __start()
|
||||
__start: scope:[__start] from
|
||||
call main
|
||||
to:__start::@1
|
||||
__start::@1: scope:[__start] from __start
|
||||
to:__start::@return
|
||||
__start::@return: scope:[__start] from __start::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
__constant char OFFSET_UNION_DATA_B = 0
|
||||
__constant char * const SCREEN = (char *)$400
|
||||
void __start()
|
||||
__loadstore union Data data = { w: $4d2 }
|
||||
void main()
|
||||
|
||||
Adding number conversion cast (unumber) 0 in SCREEN[0] = *((char *)&data+OFFSET_UNION_DATA_B)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (char *) 1024
|
||||
Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (char) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Simplifying expression containing zero (char *)&data in [0] SCREEN[0] = *((char *)&data+OFFSET_UNION_DATA_B)
|
||||
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = *((char *)&data)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant OFFSET_UNION_DATA_B
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
CALL GRAPH
|
||||
|
||||
Created 0 initial phi equivalence classes
|
||||
Coalesced down to 0 phi equivalence classes
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
|
||||
void main()
|
||||
main: scope:[main] from
|
||||
[0] *SCREEN = *((char *)&data)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[1] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
__loadstore union Data data = { w: $4d2 }
|
||||
void main()
|
||||
|
||||
Initial phi equivalence classes
|
||||
Added variable data to live range equivalence class [ data ]
|
||||
Complete equivalence classes
|
||||
[ data ]
|
||||
Allocated mem[2] [ data ]
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [0] *SCREEN = *((char *)&data) [ ] ( [ ] { } ) always clobbers reg byte a
|
||||
Potential registers mem[2] [ data ] : mem[2] ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [Data]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [] 0: mem[2] [ data ]
|
||||
|
||||
Uplifting [Data] best 17 combination
|
||||
Uplifting [main] best 17 combination
|
||||
Uplifting [] best 17 combination mem[2] [ data ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Minimal union with C99 style designator initialization behaviour.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-9.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// [0] *SCREEN = *((char *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .word $4d2
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp __breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction __breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union Data data = { w: $4d2 } // mem[2]
|
||||
void main()
|
||||
|
||||
mem[2] [ data ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 14
|
||||
|
||||
// File Comments
|
||||
// Minimal union with C99 style designator initialization behaviour.
|
||||
// Upstart
|
||||
// Commodore 64 PRG executable file
|
||||
.file [name="union-9.prg", type="prg", segments="Program"]
|
||||
.segmentdef Program [segments="Basic, Code, Data"]
|
||||
.segmentdef Basic [start=$0801]
|
||||
.segmentdef Code [start=$80d]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segment Basic
|
||||
:BasicUpstart(main)
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.segment Code
|
||||
// main
|
||||
main: {
|
||||
// SCREEN[0] = data.b
|
||||
// [0] *SCREEN = *((char *)&data) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda data
|
||||
sta SCREEN
|
||||
// main::@return
|
||||
// }
|
||||
// [1] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
.segment Data
|
||||
data: .word $4d2
|
||||
|
5
src/test/ref/union-9.sym
Normal file
5
src/test/ref/union-9.sym
Normal file
@ -0,0 +1,5 @@
|
||||
__constant char * const SCREEN = (char *) 1024
|
||||
__loadstore union Data data = { w: $4d2 } // mem[2]
|
||||
void main()
|
||||
|
||||
mem[2] [ data ]
|
@ -1,67 +0,0 @@
|
||||
<C64debugger version="1.0">
|
||||
<Sources values="INDEX,FILE">
|
||||
0,KickAss.jar:/include/autoinclude.asm
|
||||
1,D:\Users\svenv\OneDrive\Documents\GitHub\kickc\src\test\target\union-10.asm
|
||||
</Sources>
|
||||
|
||||
<Segment name="Default" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
</Segment>
|
||||
|
||||
<Segment name="Program" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Basic">
|
||||
$0801,$0802,0,38,2,38,6
|
||||
$0803,$0804,0,39,5,39,9
|
||||
$0805,$0805,0,40,5,40,9
|
||||
$0806,$0809,0,41,2,41,6
|
||||
$080a,$080a,0,42,2,42,6
|
||||
$080b,$080c,0,44,5,44,9
|
||||
</Block>
|
||||
<Block name="Code">
|
||||
$080d,$080f,1,20,5,20,7
|
||||
$0810,$0812,1,21,5,21,7
|
||||
$0813,$0813,1,25,5,25,7
|
||||
</Block>
|
||||
<Block name="Data">
|
||||
$0814,$0817,1,29,9,29,13
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Basic" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Basic">
|
||||
$0801,$0802,0,38,2,38,6
|
||||
$0803,$0804,0,39,5,39,9
|
||||
$0805,$0805,0,40,5,40,9
|
||||
$0806,$0809,0,41,2,41,6
|
||||
$080a,$080a,0,42,2,42,6
|
||||
$080b,$080c,0,44,5,44,9
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Code" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Code">
|
||||
$080d,$080f,1,20,5,20,7
|
||||
$0810,$0812,1,21,5,21,7
|
||||
$0813,$0813,1,25,5,25,7
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Data" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Data">
|
||||
$0814,$0817,1,29,9,29,13
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Labels values="SEGMENT,ADDRESS,NAME,START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
Basic,$0400,SCREEN,1,14,10,14,15
|
||||
Code,$080d,main,1,17,1,17,5
|
||||
Basic,$080b,upstartEnd,0,43,1,43,11
|
||||
Data,$0814,data,1,29,3,29,7
|
||||
</Labels>
|
||||
|
||||
<Breakpoints values="SEGMENT,ADDRESS,ARGUMENT">
|
||||
</Breakpoints>
|
||||
|
||||
<Watchpoints values="SEGMENT,ADDRESS1,ADDRESS2,ARGUMENT">
|
||||
</Watchpoints>
|
||||
|
||||
</C64debugger>
|
@ -1,23 +0,0 @@
|
||||
Output dir: D:\Users\svenv\OneDrive\Documents\GitHub\kickc\src\test\target
|
||||
parsing
|
||||
flex pass 1
|
||||
flex pass 2
|
||||
flex pass 3
|
||||
Output pass
|
||||
Writing prg file: union-10.prg
|
||||
|
||||
Memory Map
|
||||
----------
|
||||
Program-segment:
|
||||
|
||||
Basic-segment:
|
||||
$0801-$080c Basic
|
||||
|
||||
Code-segment:
|
||||
$080d-$0813 Code
|
||||
|
||||
Data-segment:
|
||||
$0814-$0817 Data
|
||||
|
||||
Writing Vice symbol file: union-10.vs
|
||||
Writing Symbol file: union-10.sym
|
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
.label SCREEN=$400
|
||||
.label data=$814
|
||||
.label main=$80d {
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
al C:400 .SCREEN
|
||||
al C:814 .data
|
||||
al C:80b .upstartEnd
|
||||
al C:80d .main
|
@ -1,69 +0,0 @@
|
||||
<C64debugger version="1.0">
|
||||
<Sources values="INDEX,FILE">
|
||||
0,KickAss.jar:/include/autoinclude.asm
|
||||
1,D:\Users\svenv\OneDrive\Documents\GitHub\kickc\src\test\target\union-11.asm
|
||||
</Sources>
|
||||
|
||||
<Segment name="Default" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
</Segment>
|
||||
|
||||
<Segment name="Program" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Basic">
|
||||
$0801,$0802,0,38,2,38,6
|
||||
$0803,$0804,0,39,5,39,9
|
||||
$0805,$0805,0,40,5,40,9
|
||||
$0806,$0809,0,41,2,41,6
|
||||
$080a,$080a,0,42,2,42,6
|
||||
$080b,$080c,0,44,5,44,9
|
||||
</Block>
|
||||
<Block name="Code">
|
||||
$080d,$080f,1,20,5,20,7
|
||||
$0810,$0812,1,21,5,21,7
|
||||
$0813,$0813,1,25,5,25,7
|
||||
</Block>
|
||||
<Block name="Data">
|
||||
$0814,$0816,1,29,9,29,13
|
||||
$0817,$0817,1,30,3,30,7
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Basic" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Basic">
|
||||
$0801,$0802,0,38,2,38,6
|
||||
$0803,$0804,0,39,5,39,9
|
||||
$0805,$0805,0,40,5,40,9
|
||||
$0806,$0809,0,41,2,41,6
|
||||
$080a,$080a,0,42,2,42,6
|
||||
$080b,$080c,0,44,5,44,9
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Code" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Code">
|
||||
$080d,$080f,1,20,5,20,7
|
||||
$0810,$0812,1,21,5,21,7
|
||||
$0813,$0813,1,25,5,25,7
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Data" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Data">
|
||||
$0814,$0816,1,29,9,29,13
|
||||
$0817,$0817,1,30,3,30,7
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Labels values="SEGMENT,ADDRESS,NAME,START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
Basic,$0400,SCREEN,1,14,10,14,15
|
||||
Code,$080d,main,1,17,1,17,5
|
||||
Basic,$080b,upstartEnd,0,43,1,43,11
|
||||
Data,$0814,data,1,29,3,29,7
|
||||
</Labels>
|
||||
|
||||
<Breakpoints values="SEGMENT,ADDRESS,ARGUMENT">
|
||||
</Breakpoints>
|
||||
|
||||
<Watchpoints values="SEGMENT,ADDRESS1,ADDRESS2,ARGUMENT">
|
||||
</Watchpoints>
|
||||
|
||||
</C64debugger>
|
@ -1,23 +0,0 @@
|
||||
Output dir: D:\Users\svenv\OneDrive\Documents\GitHub\kickc\src\test\target
|
||||
parsing
|
||||
flex pass 1
|
||||
flex pass 2
|
||||
flex pass 3
|
||||
Output pass
|
||||
Writing prg file: union-11.prg
|
||||
|
||||
Memory Map
|
||||
----------
|
||||
Program-segment:
|
||||
|
||||
Basic-segment:
|
||||
$0801-$080c Basic
|
||||
|
||||
Code-segment:
|
||||
$080d-$0813 Code
|
||||
|
||||
Data-segment:
|
||||
$0814-$0817 Data
|
||||
|
||||
Writing Vice symbol file: union-11.vs
|
||||
Writing Symbol file: union-11.sym
|
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
.label SCREEN=$400
|
||||
.label data=$814
|
||||
.label main=$80d {
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
al C:400 .SCREEN
|
||||
al C:814 .data
|
||||
al C:80b .upstartEnd
|
||||
al C:80d .main
|
@ -1,70 +0,0 @@
|
||||
<C64debugger version="1.0">
|
||||
<Sources values="INDEX,FILE">
|
||||
0,KickAss.jar:/include/autoinclude.asm
|
||||
1,D:\Users\svenv\OneDrive\Documents\GitHub\kickc\src\test\target\union-12.asm
|
||||
</Sources>
|
||||
|
||||
<Segment name="Default" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
</Segment>
|
||||
|
||||
<Segment name="Program" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Basic">
|
||||
$0801,$0802,0,38,2,38,6
|
||||
$0803,$0804,0,39,5,39,9
|
||||
$0805,$0805,0,40,5,40,9
|
||||
$0806,$0809,0,41,2,41,6
|
||||
$080a,$080a,0,42,2,42,6
|
||||
$080b,$080c,0,44,5,44,9
|
||||
</Block>
|
||||
<Block name="Code">
|
||||
$080d,$080f,1,20,5,20,7
|
||||
$0810,$0812,1,21,5,21,7
|
||||
$0813,$0813,1,25,5,25,7
|
||||
</Block>
|
||||
<Block name="Data">
|
||||
$0814,$0816,1,29,9,29,13
|
||||
$0817,$0817,1,30,9,30,13
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Basic" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Basic">
|
||||
$0801,$0802,0,38,2,38,6
|
||||
$0803,$0804,0,39,5,39,9
|
||||
$0805,$0805,0,40,5,40,9
|
||||
$0806,$0809,0,41,2,41,6
|
||||
$080a,$080a,0,42,2,42,6
|
||||
$080b,$080c,0,44,5,44,9
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Code" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Code">
|
||||
$080d,$080f,1,20,5,20,7
|
||||
$0810,$0812,1,21,5,21,7
|
||||
$0813,$0813,1,25,5,25,7
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Data" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Data">
|
||||
$0814,$0816,1,29,9,29,13
|
||||
$0817,$0817,1,30,9,30,13
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Labels values="SEGMENT,ADDRESS,NAME,START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
Basic,$0400,SCREEN,1,14,10,14,15
|
||||
Code,$080d,main,1,17,1,17,5
|
||||
Basic,$080b,upstartEnd,0,43,1,43,11
|
||||
Data,$0814,move,1,29,3,29,7
|
||||
Data,$0817,data,1,30,3,30,7
|
||||
</Labels>
|
||||
|
||||
<Breakpoints values="SEGMENT,ADDRESS,ARGUMENT">
|
||||
</Breakpoints>
|
||||
|
||||
<Watchpoints values="SEGMENT,ADDRESS1,ADDRESS2,ARGUMENT">
|
||||
</Watchpoints>
|
||||
|
||||
</C64debugger>
|
@ -1,23 +0,0 @@
|
||||
Output dir: D:\Users\svenv\OneDrive\Documents\GitHub\kickc\src\test\target
|
||||
parsing
|
||||
flex pass 1
|
||||
flex pass 2
|
||||
flex pass 3
|
||||
Output pass
|
||||
Writing prg file: union-12.prg
|
||||
|
||||
Memory Map
|
||||
----------
|
||||
Program-segment:
|
||||
|
||||
Basic-segment:
|
||||
$0801-$080c Basic
|
||||
|
||||
Code-segment:
|
||||
$080d-$0813 Code
|
||||
|
||||
Data-segment:
|
||||
$0814-$0817 Data
|
||||
|
||||
Writing Vice symbol file: union-12.vs
|
||||
Writing Symbol file: union-12.sym
|
Binary file not shown.
@ -1,5 +0,0 @@
|
||||
.label move=$814
|
||||
.label SCREEN=$400
|
||||
.label data=$817
|
||||
.label main=$80d {
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
al C:814 .move
|
||||
al C:400 .SCREEN
|
||||
al C:817 .data
|
||||
al C:80b .upstartEnd
|
||||
al C:80d .main
|
@ -1,67 +0,0 @@
|
||||
<C64debugger version="1.0">
|
||||
<Sources values="INDEX,FILE">
|
||||
0,KickAss.jar:/include/autoinclude.asm
|
||||
1,D:\Users\svenv\OneDrive\Documents\GitHub\kickc\src\test\target\union-9.asm
|
||||
</Sources>
|
||||
|
||||
<Segment name="Default" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
</Segment>
|
||||
|
||||
<Segment name="Program" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Basic">
|
||||
$0801,$0802,0,38,2,38,6
|
||||
$0803,$0804,0,39,5,39,9
|
||||
$0805,$0805,0,40,5,40,9
|
||||
$0806,$0809,0,41,2,41,6
|
||||
$080a,$080a,0,42,2,42,6
|
||||
$080b,$080c,0,44,5,44,9
|
||||
</Block>
|
||||
<Block name="Code">
|
||||
$080d,$080f,1,20,5,20,7
|
||||
$0810,$0812,1,21,5,21,7
|
||||
$0813,$0813,1,25,5,25,7
|
||||
</Block>
|
||||
<Block name="Data">
|
||||
$0814,$0815,1,29,9,29,13
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Basic" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Basic">
|
||||
$0801,$0802,0,38,2,38,6
|
||||
$0803,$0804,0,39,5,39,9
|
||||
$0805,$0805,0,40,5,40,9
|
||||
$0806,$0809,0,41,2,41,6
|
||||
$080a,$080a,0,42,2,42,6
|
||||
$080b,$080c,0,44,5,44,9
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Code" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Code">
|
||||
$080d,$080f,1,20,5,20,7
|
||||
$0810,$0812,1,21,5,21,7
|
||||
$0813,$0813,1,25,5,25,7
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Segment name="Data" dest="" values="START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
<Block name="Data">
|
||||
$0814,$0815,1,29,9,29,13
|
||||
</Block>
|
||||
</Segment>
|
||||
|
||||
<Labels values="SEGMENT,ADDRESS,NAME,START,END,FILE_IDX,LINE1,COL1,LINE2,COL2">
|
||||
Basic,$0400,SCREEN,1,14,10,14,15
|
||||
Code,$080d,main,1,17,1,17,5
|
||||
Basic,$080b,upstartEnd,0,43,1,43,11
|
||||
Data,$0814,data,1,29,3,29,7
|
||||
</Labels>
|
||||
|
||||
<Breakpoints values="SEGMENT,ADDRESS,ARGUMENT">
|
||||
</Breakpoints>
|
||||
|
||||
<Watchpoints values="SEGMENT,ADDRESS1,ADDRESS2,ARGUMENT">
|
||||
</Watchpoints>
|
||||
|
||||
</C64debugger>
|
@ -1,23 +0,0 @@
|
||||
Output dir: D:\Users\svenv\OneDrive\Documents\GitHub\kickc\src\test\target
|
||||
parsing
|
||||
flex pass 1
|
||||
flex pass 2
|
||||
flex pass 3
|
||||
Output pass
|
||||
Writing prg file: union-9.prg
|
||||
|
||||
Memory Map
|
||||
----------
|
||||
Program-segment:
|
||||
|
||||
Basic-segment:
|
||||
$0801-$080c Basic
|
||||
|
||||
Code-segment:
|
||||
$080d-$0813 Code
|
||||
|
||||
Data-segment:
|
||||
$0814-$0815 Data
|
||||
|
||||
Writing Vice symbol file: union-9.vs
|
||||
Writing Symbol file: union-9.sym
|
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
.label SCREEN=$400
|
||||
.label data=$814
|
||||
.label main=$80d {
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
al C:400 .SCREEN
|
||||
al C:814 .data
|
||||
al C:80b .upstartEnd
|
||||
al C:80d .main
|
Loading…
x
Reference in New Issue
Block a user