mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-16 21:07:56 +00:00
1205 lines
60 KiB
Plaintext
1205 lines
60 KiB
Plaintext
Resolved forward reference FONT_HEX_PROTO to FONT_HEX_PROTO
|
|
Resolved forward reference FONT_HEX_PROTO to FONT_HEX_PROTO
|
|
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
|
|
Inlined call main::$0 = call toD018 SCREEN CHARSET
|
|
Inlined call call __init
|
|
|
|
CONTROL FLOW GRAPH SSA
|
|
|
|
void init_font_hex(byte* init_font_hex::charset)
|
|
init_font_hex: scope:[init_font_hex] from main::@2
|
|
init_font_hex::charset#6 = phi( main::@2/init_font_hex::charset#1 )
|
|
init_font_hex::proto_hi#0 = FONT_HEX_PROTO
|
|
init_font_hex::c#0 = 0
|
|
to:init_font_hex::@1
|
|
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
|
|
init_font_hex::c#6 = phi( init_font_hex/init_font_hex::c#0, init_font_hex::@5/init_font_hex::c#1 )
|
|
init_font_hex::proto_hi#6 = phi( init_font_hex/init_font_hex::proto_hi#0, init_font_hex::@5/init_font_hex::proto_hi#1 )
|
|
init_font_hex::charset#5 = phi( init_font_hex/init_font_hex::charset#6, init_font_hex::@5/init_font_hex::charset#7 )
|
|
init_font_hex::proto_lo#0 = FONT_HEX_PROTO
|
|
init_font_hex::c1#0 = 0
|
|
to:init_font_hex::@2
|
|
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
|
|
init_font_hex::c#5 = phi( init_font_hex::@1/init_font_hex::c#6, init_font_hex::@4/init_font_hex::c#3 )
|
|
init_font_hex::c1#4 = phi( init_font_hex::@1/init_font_hex::c1#0, init_font_hex::@4/init_font_hex::c1#1 )
|
|
init_font_hex::proto_lo#4 = phi( init_font_hex::@1/init_font_hex::proto_lo#0, init_font_hex::@4/init_font_hex::proto_lo#1 )
|
|
init_font_hex::proto_hi#4 = phi( init_font_hex::@1/init_font_hex::proto_hi#6, init_font_hex::@4/init_font_hex::proto_hi#5 )
|
|
init_font_hex::charset#2 = phi( init_font_hex::@1/init_font_hex::charset#5, init_font_hex::@4/init_font_hex::charset#0 )
|
|
init_font_hex::idx#0 = 0
|
|
init_font_hex::charset#2[init_font_hex::idx#0] = 0
|
|
init_font_hex::idx#1 = ++ init_font_hex::idx#0
|
|
init_font_hex::i#0 = 0
|
|
to:init_font_hex::@3
|
|
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
|
|
init_font_hex::c#4 = phi( init_font_hex::@2/init_font_hex::c#5, init_font_hex::@3/init_font_hex::c#4 )
|
|
init_font_hex::c1#3 = phi( init_font_hex::@2/init_font_hex::c1#4, init_font_hex::@3/init_font_hex::c1#3 )
|
|
init_font_hex::idx#5 = phi( init_font_hex::@2/init_font_hex::idx#1, init_font_hex::@3/init_font_hex::idx#2 )
|
|
init_font_hex::charset#3 = phi( init_font_hex::@2/init_font_hex::charset#2, init_font_hex::@3/init_font_hex::charset#3 )
|
|
init_font_hex::proto_lo#2 = phi( init_font_hex::@2/init_font_hex::proto_lo#4, init_font_hex::@3/init_font_hex::proto_lo#2 )
|
|
init_font_hex::i#2 = phi( init_font_hex::@2/init_font_hex::i#0, init_font_hex::@3/init_font_hex::i#1 )
|
|
init_font_hex::proto_hi#2 = phi( init_font_hex::@2/init_font_hex::proto_hi#4, init_font_hex::@3/init_font_hex::proto_hi#2 )
|
|
init_font_hex::$0 = init_font_hex::proto_hi#2[init_font_hex::i#2] << 4
|
|
init_font_hex::$1 = init_font_hex::proto_lo#2[init_font_hex::i#2] << 1
|
|
init_font_hex::$2 = init_font_hex::$0 | init_font_hex::$1
|
|
init_font_hex::charset#3[init_font_hex::idx#5] = init_font_hex::$2
|
|
init_font_hex::idx#2 = ++ init_font_hex::idx#5
|
|
init_font_hex::i#1 = init_font_hex::i#2 + rangenext(0,4)
|
|
init_font_hex::$3 = init_font_hex::i#1 != rangelast(0,4)
|
|
if(init_font_hex::$3) goto init_font_hex::@3
|
|
to:init_font_hex::@4
|
|
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
|
|
init_font_hex::c#3 = phi( init_font_hex::@3/init_font_hex::c#4 )
|
|
init_font_hex::proto_hi#5 = phi( init_font_hex::@3/init_font_hex::proto_hi#2 )
|
|
init_font_hex::c1#2 = phi( init_font_hex::@3/init_font_hex::c1#3 )
|
|
init_font_hex::proto_lo#3 = phi( init_font_hex::@3/init_font_hex::proto_lo#2 )
|
|
init_font_hex::idx#6 = phi( init_font_hex::@3/init_font_hex::idx#2 )
|
|
init_font_hex::charset#4 = phi( init_font_hex::@3/init_font_hex::charset#3 )
|
|
init_font_hex::charset#4[init_font_hex::idx#6] = 0
|
|
init_font_hex::idx#3 = ++ init_font_hex::idx#6
|
|
init_font_hex::charset#4[init_font_hex::idx#3] = 0
|
|
init_font_hex::idx#4 = ++ init_font_hex::idx#3
|
|
init_font_hex::proto_lo#1 = init_font_hex::proto_lo#3 + 5
|
|
init_font_hex::charset#0 = init_font_hex::charset#4 + 8
|
|
init_font_hex::c1#1 = init_font_hex::c1#2 + rangenext(0,$f)
|
|
init_font_hex::$4 = init_font_hex::c1#1 != rangelast(0,$f)
|
|
if(init_font_hex::$4) goto init_font_hex::@2
|
|
to:init_font_hex::@5
|
|
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
|
|
init_font_hex::charset#7 = phi( init_font_hex::@4/init_font_hex::charset#0 )
|
|
init_font_hex::c#2 = phi( init_font_hex::@4/init_font_hex::c#3 )
|
|
init_font_hex::proto_hi#3 = phi( init_font_hex::@4/init_font_hex::proto_hi#5 )
|
|
init_font_hex::proto_hi#1 = init_font_hex::proto_hi#3 + 5
|
|
init_font_hex::c#1 = init_font_hex::c#2 + rangenext(0,$f)
|
|
init_font_hex::$5 = init_font_hex::c#1 != rangelast(0,$f)
|
|
if(init_font_hex::$5) goto init_font_hex::@1
|
|
to:init_font_hex::@return
|
|
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
|
|
return
|
|
to:@return
|
|
|
|
void main()
|
|
main: scope:[main] from __start::@1
|
|
main::toD0181_screen#0 = SCREEN
|
|
main::toD0181_gfx#0 = CHARSET
|
|
to:main::toD0181
|
|
main::toD0181: scope:[main] from main
|
|
main::toD0181_gfx#1 = phi( main/main::toD0181_gfx#0 )
|
|
main::toD0181_screen#1 = phi( main/main::toD0181_screen#0 )
|
|
main::toD0181_$7 = (word)main::toD0181_screen#1
|
|
main::toD0181_$0 = main::toD0181_$7 & $3fff
|
|
main::toD0181_$1 = main::toD0181_$0 * 4
|
|
main::toD0181_$2 = > main::toD0181_$1
|
|
main::toD0181_$3 = > (word)main::toD0181_gfx#1
|
|
main::toD0181_$4 = main::toD0181_$3 / 4
|
|
main::toD0181_$5 = main::toD0181_$4 & $f
|
|
main::toD0181_$6 = main::toD0181_$2 | main::toD0181_$5
|
|
main::toD0181_return#0 = main::toD0181_$6
|
|
to:main::toD0181_@return
|
|
main::toD0181_@return: scope:[main] from main::toD0181
|
|
main::toD0181_return#2 = phi( main::toD0181/main::toD0181_return#0 )
|
|
main::toD0181_return#1 = main::toD0181_return#2
|
|
to:main::@2
|
|
main::@2: scope:[main] from main::toD0181_@return
|
|
main::toD0181_return#3 = phi( main::toD0181_@return/main::toD0181_return#1 )
|
|
main::$0 = main::toD0181_return#3
|
|
*D018 = main::$0
|
|
init_font_hex::charset#1 = CHARSET
|
|
call init_font_hex
|
|
to:main::@3
|
|
main::@3: scope:[main] from main::@2
|
|
main::c#0 = 0
|
|
to:main::@1
|
|
main::@1: scope:[main] from main::@1 main::@3
|
|
main::c#2 = phi( main::@1/main::c#1, main::@3/main::c#0 )
|
|
SCREEN[main::c#2] = main::c#2
|
|
main::c#1 = main::c#2 + rangenext(0,$ff)
|
|
main::$2 = main::c#1 != rangelast(0,$ff)
|
|
if(main::$2) goto main::@1
|
|
to:main::@return
|
|
main::@return: scope:[main] from main::@1
|
|
return
|
|
to:@return
|
|
|
|
void __start()
|
|
__start: scope:[__start] from
|
|
to:__start::__init1
|
|
__start::__init1: scope:[__start] from __start
|
|
to:__start::@1
|
|
__start::@1: scope:[__start] from __start::__init1
|
|
call main
|
|
to:__start::@2
|
|
__start::@2: scope:[__start] from __start::@1
|
|
to:__start::@return
|
|
__start::@return: scope:[__start] from __start::@2
|
|
return
|
|
to:@return
|
|
|
|
SYMBOL TABLE SSA
|
|
const byte* CHARSET = (byte*)$2000
|
|
const nomodify byte* D018 = (byte*)$d018
|
|
const byte* FONT_HEX_PROTO[] = { 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4 }
|
|
const byte* SCREEN = (byte*)$400
|
|
void __start()
|
|
void init_font_hex(byte* init_font_hex::charset)
|
|
byte~ init_font_hex::$0
|
|
byte~ init_font_hex::$1
|
|
byte~ init_font_hex::$2
|
|
bool~ init_font_hex::$3
|
|
bool~ init_font_hex::$4
|
|
bool~ init_font_hex::$5
|
|
byte init_font_hex::c
|
|
byte init_font_hex::c#0
|
|
byte init_font_hex::c#1
|
|
byte init_font_hex::c#2
|
|
byte init_font_hex::c#3
|
|
byte init_font_hex::c#4
|
|
byte init_font_hex::c#5
|
|
byte init_font_hex::c#6
|
|
byte init_font_hex::c1
|
|
byte init_font_hex::c1#0
|
|
byte init_font_hex::c1#1
|
|
byte init_font_hex::c1#2
|
|
byte init_font_hex::c1#3
|
|
byte init_font_hex::c1#4
|
|
byte* init_font_hex::charset
|
|
byte* init_font_hex::charset#0
|
|
byte* init_font_hex::charset#1
|
|
byte* init_font_hex::charset#2
|
|
byte* init_font_hex::charset#3
|
|
byte* init_font_hex::charset#4
|
|
byte* init_font_hex::charset#5
|
|
byte* init_font_hex::charset#6
|
|
byte* init_font_hex::charset#7
|
|
byte init_font_hex::i
|
|
byte init_font_hex::i#0
|
|
byte init_font_hex::i#1
|
|
byte init_font_hex::i#2
|
|
byte init_font_hex::idx
|
|
byte init_font_hex::idx#0
|
|
byte init_font_hex::idx#1
|
|
byte init_font_hex::idx#2
|
|
byte init_font_hex::idx#3
|
|
byte init_font_hex::idx#4
|
|
byte init_font_hex::idx#5
|
|
byte init_font_hex::idx#6
|
|
byte* init_font_hex::proto_hi
|
|
byte* init_font_hex::proto_hi#0
|
|
byte* init_font_hex::proto_hi#1
|
|
byte* init_font_hex::proto_hi#2
|
|
byte* init_font_hex::proto_hi#3
|
|
byte* init_font_hex::proto_hi#4
|
|
byte* init_font_hex::proto_hi#5
|
|
byte* init_font_hex::proto_hi#6
|
|
byte* init_font_hex::proto_lo
|
|
byte* init_font_hex::proto_lo#0
|
|
byte* init_font_hex::proto_lo#1
|
|
byte* init_font_hex::proto_lo#2
|
|
byte* init_font_hex::proto_lo#3
|
|
byte* init_font_hex::proto_lo#4
|
|
void main()
|
|
byte~ main::$0
|
|
bool~ main::$2
|
|
byte main::c
|
|
byte main::c#0
|
|
byte main::c#1
|
|
byte main::c#2
|
|
number~ main::toD0181_$0
|
|
number~ main::toD0181_$1
|
|
number~ main::toD0181_$2
|
|
byte~ main::toD0181_$3
|
|
number~ main::toD0181_$4
|
|
number~ main::toD0181_$5
|
|
number~ main::toD0181_$6
|
|
word~ main::toD0181_$7
|
|
byte* main::toD0181_gfx
|
|
byte* main::toD0181_gfx#0
|
|
byte* main::toD0181_gfx#1
|
|
byte main::toD0181_return
|
|
byte main::toD0181_return#0
|
|
byte main::toD0181_return#1
|
|
byte main::toD0181_return#2
|
|
byte main::toD0181_return#3
|
|
byte* main::toD0181_screen
|
|
byte* main::toD0181_screen#0
|
|
byte* main::toD0181_screen#1
|
|
|
|
Adding number conversion cast (unumber) 0 in init_font_hex::charset#2[init_font_hex::idx#0] = 0
|
|
Adding number conversion cast (unumber) 4 in init_font_hex::$0 = init_font_hex::proto_hi#2[init_font_hex::i#2] << 4
|
|
Adding number conversion cast (unumber) 1 in init_font_hex::$1 = init_font_hex::proto_lo#2[init_font_hex::i#2] << 1
|
|
Adding number conversion cast (unumber) 0 in init_font_hex::charset#4[init_font_hex::idx#6] = 0
|
|
Adding number conversion cast (unumber) 0 in init_font_hex::charset#4[init_font_hex::idx#3] = 0
|
|
Adding number conversion cast (unumber) 5 in init_font_hex::proto_lo#1 = init_font_hex::proto_lo#3 + 5
|
|
Adding number conversion cast (unumber) 8 in init_font_hex::charset#0 = init_font_hex::charset#4 + 8
|
|
Adding number conversion cast (unumber) 5 in init_font_hex::proto_hi#1 = init_font_hex::proto_hi#3 + 5
|
|
Adding number conversion cast (unumber) $3fff in main::toD0181_$0 = main::toD0181_$7 & $3fff
|
|
Adding number conversion cast (unumber) main::toD0181_$0 in main::toD0181_$0 = main::toD0181_$7 & (unumber)$3fff
|
|
Adding number conversion cast (unumber) 4 in main::toD0181_$1 = main::toD0181_$0 * 4
|
|
Adding number conversion cast (unumber) main::toD0181_$1 in main::toD0181_$1 = main::toD0181_$0 * (unumber)4
|
|
Adding number conversion cast (unumber) main::toD0181_$2 in main::toD0181_$2 = > main::toD0181_$1
|
|
Adding number conversion cast (unumber) 4 in main::toD0181_$4 = main::toD0181_$3 / 4
|
|
Adding number conversion cast (unumber) main::toD0181_$4 in main::toD0181_$4 = main::toD0181_$3 / (unumber)4
|
|
Adding number conversion cast (unumber) $f in main::toD0181_$5 = main::toD0181_$4 & $f
|
|
Adding number conversion cast (unumber) main::toD0181_$5 in main::toD0181_$5 = main::toD0181_$4 & (unumber)$f
|
|
Adding number conversion cast (unumber) main::toD0181_$6 in main::toD0181_$6 = main::toD0181_$2 | main::toD0181_$5
|
|
Successful SSA optimization PassNAddNumberTypeConversions
|
|
Inlining cast init_font_hex::charset#2[init_font_hex::idx#0] = (unumber)0
|
|
Inlining cast init_font_hex::charset#4[init_font_hex::idx#6] = (unumber)0
|
|
Inlining cast init_font_hex::charset#4[init_font_hex::idx#3] = (unumber)0
|
|
Successful SSA optimization Pass2InlineCast
|
|
Simplifying constant pointer cast (byte*) 53272
|
|
Simplifying constant pointer cast (byte*) 1024
|
|
Simplifying constant pointer cast (byte*) 8192
|
|
Simplifying constant integer cast 0
|
|
Simplifying constant integer cast 4
|
|
Simplifying constant integer cast 1
|
|
Simplifying constant integer cast 0
|
|
Simplifying constant integer cast 0
|
|
Simplifying constant integer cast 5
|
|
Simplifying constant integer cast 8
|
|
Simplifying constant integer cast 5
|
|
Simplifying constant integer cast $3fff
|
|
Simplifying constant integer cast 4
|
|
Simplifying constant integer cast 4
|
|
Simplifying constant integer cast $f
|
|
Successful SSA optimization PassNCastSimplification
|
|
Finalized unsigned number type (byte) 0
|
|
Finalized unsigned number type (byte) 4
|
|
Finalized unsigned number type (byte) 1
|
|
Finalized unsigned number type (byte) 0
|
|
Finalized unsigned number type (byte) 0
|
|
Finalized unsigned number type (byte) 5
|
|
Finalized unsigned number type (byte) 8
|
|
Finalized unsigned number type (byte) 5
|
|
Finalized unsigned number type (word) $3fff
|
|
Finalized unsigned number type (byte) 4
|
|
Finalized unsigned number type (byte) 4
|
|
Finalized unsigned number type (byte) $f
|
|
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
|
Inferred type updated to word in main::toD0181_$0 = main::toD0181_$7 & $3fff
|
|
Inferred type updated to word in main::toD0181_$1 = main::toD0181_$0 * 4
|
|
Inferred type updated to byte in main::toD0181_$2 = > main::toD0181_$1
|
|
Inferred type updated to byte in main::toD0181_$4 = main::toD0181_$3 / 4
|
|
Inferred type updated to byte in main::toD0181_$5 = main::toD0181_$4 & $f
|
|
Inferred type updated to byte in main::toD0181_$6 = main::toD0181_$2 | main::toD0181_$5
|
|
Alias init_font_hex::charset#3 = init_font_hex::charset#4
|
|
Alias init_font_hex::idx#2 = init_font_hex::idx#6
|
|
Alias init_font_hex::proto_lo#2 = init_font_hex::proto_lo#3
|
|
Alias init_font_hex::c1#2 = init_font_hex::c1#3
|
|
Alias init_font_hex::proto_hi#2 = init_font_hex::proto_hi#5 init_font_hex::proto_hi#3
|
|
Alias init_font_hex::c#2 = init_font_hex::c#3 init_font_hex::c#4
|
|
Alias init_font_hex::charset#0 = init_font_hex::charset#7
|
|
Alias main::toD0181_screen#0 = main::toD0181_screen#1
|
|
Alias main::toD0181_gfx#0 = main::toD0181_gfx#1
|
|
Alias main::toD0181_return#0 = main::toD0181_$6 main::toD0181_return#2 main::toD0181_return#1 main::toD0181_return#3 main::$0
|
|
Successful SSA optimization Pass2AliasElimination
|
|
Identical Phi Values init_font_hex::charset#6 init_font_hex::charset#1
|
|
Identical Phi Values init_font_hex::proto_hi#2 init_font_hex::proto_hi#4
|
|
Identical Phi Values init_font_hex::proto_lo#2 init_font_hex::proto_lo#4
|
|
Identical Phi Values init_font_hex::charset#3 init_font_hex::charset#2
|
|
Identical Phi Values init_font_hex::c1#2 init_font_hex::c1#4
|
|
Identical Phi Values init_font_hex::c#2 init_font_hex::c#5
|
|
Successful SSA optimization Pass2IdenticalPhiElimination
|
|
Identical Phi Values init_font_hex::proto_hi#4 init_font_hex::proto_hi#6
|
|
Identical Phi Values init_font_hex::c#5 init_font_hex::c#6
|
|
Successful SSA optimization Pass2IdenticalPhiElimination
|
|
Simple Condition init_font_hex::$3 [19] if(init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3
|
|
Simple Condition init_font_hex::$4 [28] if(init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2
|
|
Simple Condition init_font_hex::$5 [32] if(init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1
|
|
Simple Condition main::$2 [52] if(main::c#1!=rangelast(0,$ff)) goto main::@1
|
|
Successful SSA optimization Pass2ConditionalJumpSimplification
|
|
Constant init_font_hex::proto_hi#0 = FONT_HEX_PROTO
|
|
Constant init_font_hex::c#0 = 0
|
|
Constant init_font_hex::proto_lo#0 = FONT_HEX_PROTO
|
|
Constant init_font_hex::c1#0 = 0
|
|
Constant init_font_hex::idx#0 = 0
|
|
Constant init_font_hex::i#0 = 0
|
|
Constant main::toD0181_screen#0 = SCREEN
|
|
Constant main::toD0181_gfx#0 = CHARSET
|
|
Constant init_font_hex::charset#1 = CHARSET
|
|
Constant main::c#0 = 0
|
|
Successful SSA optimization Pass2ConstantIdentification
|
|
Constant main::toD0181_$7 = (word)main::toD0181_screen#0
|
|
Successful SSA optimization Pass2ConstantIdentification
|
|
Constant value identified (word)main::toD0181_gfx#0 in [40] main::toD0181_$3 = > (word)main::toD0181_gfx#0
|
|
Successful SSA optimization Pass2ConstantValues
|
|
Resolved ranged next value [17] init_font_hex::i#1 = ++ init_font_hex::i#2 to ++
|
|
Resolved ranged comparison value [19] if(init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3 to 5
|
|
Resolved ranged next value [26] init_font_hex::c1#1 = ++ init_font_hex::c1#4 to ++
|
|
Resolved ranged comparison value [28] if(init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2 to $10
|
|
Resolved ranged next value [30] init_font_hex::c#1 = ++ init_font_hex::c#6 to ++
|
|
Resolved ranged comparison value [32] if(init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1 to $10
|
|
Resolved ranged next value [50] main::c#1 = ++ main::c#2 to ++
|
|
Resolved ranged comparison value [52] if(main::c#1!=rangelast(0,$ff)) goto main::@1 to 0
|
|
Simplifying expression containing zero init_font_hex::charset#2 in [8] init_font_hex::charset#2[init_font_hex::idx#0] = 0
|
|
Successful SSA optimization PassNSimplifyExpressionWithZero
|
|
Eliminating unused variable init_font_hex::idx#4 and assignment [15] init_font_hex::idx#4 = ++ init_font_hex::idx#3
|
|
Successful SSA optimization PassNEliminateUnusedVars
|
|
Removing unused procedure __start
|
|
Removing unused procedure block __start
|
|
Removing unused procedure block __start::__init1
|
|
Removing unused procedure block __start::@1
|
|
Removing unused procedure block __start::@2
|
|
Removing unused procedure block __start::@return
|
|
Successful SSA optimization PassNEliminateEmptyStart
|
|
Adding number conversion cast (unumber) 5 in [11] if(init_font_hex::i#1!=5) goto init_font_hex::@3
|
|
Adding number conversion cast (unumber) $10 in [18] if(init_font_hex::c1#1!=$10) goto init_font_hex::@2
|
|
Adding number conversion cast (unumber) $10 in [21] if(init_font_hex::c#1!=$10) goto init_font_hex::@1
|
|
Adding number conversion cast (unumber) 0 in [35] if(main::c#1!=0) goto main::@1
|
|
Successful SSA optimization PassNAddNumberTypeConversions
|
|
Simplifying constant integer cast 5
|
|
Simplifying constant integer cast $10
|
|
Simplifying constant integer cast $10
|
|
Simplifying constant integer cast 0
|
|
Successful SSA optimization PassNCastSimplification
|
|
Finalized unsigned number type (byte) 5
|
|
Finalized unsigned number type (byte) $10
|
|
Finalized unsigned number type (byte) $10
|
|
Finalized unsigned number type (byte) 0
|
|
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
|
Constant right-side identified [3] init_font_hex::idx#1 = ++ init_font_hex::idx#0
|
|
Constant right-side identified [23] main::toD0181_$0 = main::toD0181_$7 & $3fff
|
|
Constant right-side identified [26] main::toD0181_$3 = > (word)main::toD0181_gfx#0
|
|
Successful SSA optimization Pass2ConstantRValueConsolidation
|
|
Constant init_font_hex::idx#1 = ++init_font_hex::idx#0
|
|
Constant main::toD0181_$0 = main::toD0181_$7&$3fff
|
|
Constant main::toD0181_$3 = >(word)main::toD0181_gfx#0
|
|
Successful SSA optimization Pass2ConstantIdentification
|
|
Constant right-side identified [22] main::toD0181_$1 = main::toD0181_$0 * 4
|
|
Constant right-side identified [24] main::toD0181_$4 = main::toD0181_$3 / 4
|
|
Successful SSA optimization Pass2ConstantRValueConsolidation
|
|
Constant main::toD0181_$1 = main::toD0181_$0*4
|
|
Constant main::toD0181_$4 = main::toD0181_$3/4
|
|
Successful SSA optimization Pass2ConstantIdentification
|
|
Constant right-side identified [22] main::toD0181_$2 = > main::toD0181_$1
|
|
Constant right-side identified [23] main::toD0181_$5 = main::toD0181_$4 & $f
|
|
Successful SSA optimization Pass2ConstantRValueConsolidation
|
|
Constant main::toD0181_$2 = >main::toD0181_$1
|
|
Constant main::toD0181_$5 = main::toD0181_$4&$f
|
|
Successful SSA optimization Pass2ConstantIdentification
|
|
Constant right-side identified [22] main::toD0181_return#0 = main::toD0181_$2 | main::toD0181_$5
|
|
Successful SSA optimization Pass2ConstantRValueConsolidation
|
|
Constant main::toD0181_return#0 = main::toD0181_$2|main::toD0181_$5
|
|
Successful SSA optimization Pass2ConstantIdentification
|
|
Inlining constant with var siblings init_font_hex::proto_hi#0
|
|
Inlining constant with var siblings init_font_hex::c#0
|
|
Inlining constant with var siblings init_font_hex::proto_lo#0
|
|
Inlining constant with var siblings init_font_hex::c1#0
|
|
Inlining constant with var siblings init_font_hex::idx#0
|
|
Inlining constant with var siblings init_font_hex::i#0
|
|
Inlining constant with var siblings init_font_hex::charset#1
|
|
Inlining constant with var siblings init_font_hex::idx#1
|
|
Inlining constant with var siblings main::c#0
|
|
Constant inlined main::toD0181_screen#0 = SCREEN
|
|
Constant inlined main::toD0181_gfx#0 = CHARSET
|
|
Constant inlined main::toD0181_$7 = (word)SCREEN
|
|
Constant inlined init_font_hex::proto_hi#0 = FONT_HEX_PROTO
|
|
Constant inlined main::toD0181_$2 = >(word)SCREEN&$3fff*4
|
|
Constant inlined main::toD0181_$1 = (word)SCREEN&$3fff*4
|
|
Constant inlined main::toD0181_$0 = (word)SCREEN&$3fff
|
|
Constant inlined init_font_hex::i#0 = 0
|
|
Constant inlined main::toD0181_$5 = >(word)CHARSET/4&$f
|
|
Constant inlined main::toD0181_$4 = >(word)CHARSET/4
|
|
Constant inlined main::toD0181_$3 = >(word)CHARSET
|
|
Constant inlined init_font_hex::charset#1 = CHARSET
|
|
Constant inlined init_font_hex::idx#1 = ++0
|
|
Constant inlined main::c#0 = 0
|
|
Constant inlined init_font_hex::idx#0 = 0
|
|
Constant inlined init_font_hex::proto_lo#0 = FONT_HEX_PROTO
|
|
Constant inlined init_font_hex::c#0 = 0
|
|
Constant inlined init_font_hex::c1#0 = 0
|
|
Successful SSA optimization Pass2ConstantInlining
|
|
Simplifying constant integer increment ++0
|
|
Successful SSA optimization Pass2ConstantSimplification
|
|
Added new block during phi lifting init_font_hex::@6(between init_font_hex::@5 and init_font_hex::@1)
|
|
Added new block during phi lifting init_font_hex::@7(between init_font_hex::@4 and init_font_hex::@2)
|
|
Added new block during phi lifting init_font_hex::@8(between init_font_hex::@3 and init_font_hex::@3)
|
|
Added new block during phi lifting main::@4(between main::@1 and main::@1)
|
|
Adding NOP phi() at start of main
|
|
Adding NOP phi() at start of main::toD0181
|
|
Adding NOP phi() at start of main::toD0181_@return
|
|
Adding NOP phi() at start of main::@3
|
|
Adding NOP phi() at start of init_font_hex
|
|
CALL GRAPH
|
|
Calls in [main] to init_font_hex:4
|
|
|
|
Created 9 initial phi equivalence classes
|
|
Coalesced [11] main::c#3 = main::c#1
|
|
Coalesced [14] init_font_hex::charset#9 = init_font_hex::charset#5
|
|
Coalesced [36] init_font_hex::charset#8 = init_font_hex::charset#0
|
|
Coalesced [37] init_font_hex::proto_hi#7 = init_font_hex::proto_hi#1
|
|
Coalesced [38] init_font_hex::c#7 = init_font_hex::c#1
|
|
Coalesced (already) [39] init_font_hex::charset#10 = init_font_hex::charset#0
|
|
Coalesced [40] init_font_hex::proto_lo#5 = init_font_hex::proto_lo#1
|
|
Coalesced [41] init_font_hex::c1#5 = init_font_hex::c1#1
|
|
Coalesced [42] init_font_hex::i#3 = init_font_hex::i#1
|
|
Coalesced [43] init_font_hex::idx#7 = init_font_hex::idx#2
|
|
Coalesced down to 8 phi equivalence classes
|
|
Culled Empty Block label main::toD0181_@return
|
|
Culled Empty Block label main::@3
|
|
Culled Empty Block label main::@4
|
|
Culled Empty Block label init_font_hex::@6
|
|
Culled Empty Block label init_font_hex::@7
|
|
Culled Empty Block label init_font_hex::@8
|
|
Adding NOP phi() at start of main
|
|
Adding NOP phi() at start of main::toD0181
|
|
Adding NOP phi() at start of init_font_hex
|
|
|
|
FINAL CONTROL FLOW GRAPH
|
|
|
|
void main()
|
|
main: scope:[main] from
|
|
[0] phi()
|
|
to:main::toD0181
|
|
main::toD0181: scope:[main] from main
|
|
[1] phi()
|
|
to:main::@2
|
|
main::@2: scope:[main] from main::toD0181
|
|
[2] *D018 = main::toD0181_return#0
|
|
[3] call init_font_hex
|
|
to:main::@1
|
|
main::@1: scope:[main] from main::@1 main::@2
|
|
[4] main::c#2 = phi( main::@1/main::c#1, main::@2/0 )
|
|
[5] SCREEN[main::c#2] = main::c#2
|
|
[6] main::c#1 = ++ main::c#2
|
|
[7] if(main::c#1!=0) goto main::@1
|
|
to:main::@return
|
|
main::@return: scope:[main] from main::@1
|
|
[8] return
|
|
to:@return
|
|
|
|
void init_font_hex(byte* init_font_hex::charset)
|
|
init_font_hex: scope:[init_font_hex] from main::@2
|
|
[9] phi()
|
|
to:init_font_hex::@1
|
|
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
|
|
[10] init_font_hex::c#6 = phi( init_font_hex/0, init_font_hex::@5/init_font_hex::c#1 )
|
|
[10] init_font_hex::proto_hi#6 = phi( init_font_hex/FONT_HEX_PROTO, init_font_hex::@5/init_font_hex::proto_hi#1 )
|
|
[10] init_font_hex::charset#5 = phi( init_font_hex/CHARSET, init_font_hex::@5/init_font_hex::charset#0 )
|
|
to:init_font_hex::@2
|
|
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
|
|
[11] init_font_hex::c1#4 = phi( init_font_hex::@1/0, init_font_hex::@4/init_font_hex::c1#1 )
|
|
[11] init_font_hex::proto_lo#4 = phi( init_font_hex::@1/FONT_HEX_PROTO, init_font_hex::@4/init_font_hex::proto_lo#1 )
|
|
[11] init_font_hex::charset#2 = phi( init_font_hex::@1/init_font_hex::charset#5, init_font_hex::@4/init_font_hex::charset#0 )
|
|
[12] *init_font_hex::charset#2 = 0
|
|
to:init_font_hex::@3
|
|
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
|
|
[13] init_font_hex::idx#5 = phi( init_font_hex::@2/1, init_font_hex::@3/init_font_hex::idx#2 )
|
|
[13] init_font_hex::i#2 = phi( init_font_hex::@2/0, init_font_hex::@3/init_font_hex::i#1 )
|
|
[14] init_font_hex::$0 = init_font_hex::proto_hi#6[init_font_hex::i#2] << 4
|
|
[15] init_font_hex::$1 = init_font_hex::proto_lo#4[init_font_hex::i#2] << 1
|
|
[16] init_font_hex::$2 = init_font_hex::$0 | init_font_hex::$1
|
|
[17] init_font_hex::charset#2[init_font_hex::idx#5] = init_font_hex::$2
|
|
[18] init_font_hex::idx#2 = ++ init_font_hex::idx#5
|
|
[19] init_font_hex::i#1 = ++ init_font_hex::i#2
|
|
[20] if(init_font_hex::i#1!=5) goto init_font_hex::@3
|
|
to:init_font_hex::@4
|
|
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
|
|
[21] init_font_hex::charset#2[init_font_hex::idx#2] = 0
|
|
[22] init_font_hex::idx#3 = ++ init_font_hex::idx#2
|
|
[23] init_font_hex::charset#2[init_font_hex::idx#3] = 0
|
|
[24] init_font_hex::proto_lo#1 = init_font_hex::proto_lo#4 + 5
|
|
[25] init_font_hex::charset#0 = init_font_hex::charset#2 + 8
|
|
[26] init_font_hex::c1#1 = ++ init_font_hex::c1#4
|
|
[27] if(init_font_hex::c1#1!=$10) goto init_font_hex::@2
|
|
to:init_font_hex::@5
|
|
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
|
|
[28] init_font_hex::proto_hi#1 = init_font_hex::proto_hi#6 + 5
|
|
[29] init_font_hex::c#1 = ++ init_font_hex::c#6
|
|
[30] if(init_font_hex::c#1!=$10) goto init_font_hex::@1
|
|
to:init_font_hex::@return
|
|
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
|
|
[31] return
|
|
to:@return
|
|
|
|
|
|
VARIABLE REGISTER WEIGHTS
|
|
void init_font_hex(byte* init_font_hex::charset)
|
|
byte~ init_font_hex::$0 10001.0
|
|
byte~ init_font_hex::$1 20002.0
|
|
byte~ init_font_hex::$2 20002.0
|
|
byte init_font_hex::c
|
|
byte init_font_hex::c#1 151.5
|
|
byte init_font_hex::c#6 10.631578947368421
|
|
byte init_font_hex::c1
|
|
byte init_font_hex::c1#1 1501.5
|
|
byte init_font_hex::c1#4 133.46666666666667
|
|
byte* init_font_hex::charset
|
|
byte* init_font_hex::charset#0 350.5
|
|
byte* init_font_hex::charset#2 1079.0714285714287
|
|
byte* init_font_hex::charset#5 202.0
|
|
byte init_font_hex::i
|
|
byte init_font_hex::i#1 15001.5
|
|
byte init_font_hex::i#2 6667.333333333333
|
|
byte init_font_hex::idx
|
|
byte init_font_hex::idx#2 5501.0
|
|
byte init_font_hex::idx#3 2002.0
|
|
byte init_font_hex::idx#5 6000.6
|
|
byte* init_font_hex::proto_hi
|
|
byte* init_font_hex::proto_hi#1 67.33333333333333
|
|
byte* init_font_hex::proto_hi#6 566.8333333333333
|
|
byte* init_font_hex::proto_lo
|
|
byte* init_font_hex::proto_lo#1 500.5
|
|
byte* init_font_hex::proto_lo#4 923.3076923076923
|
|
void main()
|
|
byte main::c
|
|
byte main::c#1 16.5
|
|
byte main::c#2 22.0
|
|
byte* main::toD0181_gfx
|
|
byte main::toD0181_return
|
|
byte* main::toD0181_screen
|
|
|
|
Initial phi equivalence classes
|
|
[ main::c#2 main::c#1 ]
|
|
[ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
|
|
[ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
[ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
|
|
[ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
|
|
[ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
[ init_font_hex::i#2 init_font_hex::i#1 ]
|
|
[ init_font_hex::idx#5 init_font_hex::idx#2 ]
|
|
Added variable init_font_hex::$0 to live range equivalence class [ init_font_hex::$0 ]
|
|
Added variable init_font_hex::$1 to live range equivalence class [ init_font_hex::$1 ]
|
|
Added variable init_font_hex::$2 to live range equivalence class [ init_font_hex::$2 ]
|
|
Added variable init_font_hex::idx#3 to live range equivalence class [ init_font_hex::idx#3 ]
|
|
Complete equivalence classes
|
|
[ main::c#2 main::c#1 ]
|
|
[ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
|
|
[ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
[ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
|
|
[ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
|
|
[ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
[ init_font_hex::i#2 init_font_hex::i#1 ]
|
|
[ init_font_hex::idx#5 init_font_hex::idx#2 ]
|
|
[ init_font_hex::$0 ]
|
|
[ init_font_hex::$1 ]
|
|
[ init_font_hex::$2 ]
|
|
[ init_font_hex::idx#3 ]
|
|
Allocated zp[1]:2 [ main::c#2 main::c#1 ]
|
|
Allocated zp[2]:3 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
|
|
Allocated zp[1]:5 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
Allocated zp[2]:6 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
|
|
Allocated zp[2]:8 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
|
|
Allocated zp[1]:10 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
Allocated zp[1]:11 [ init_font_hex::i#2 init_font_hex::i#1 ]
|
|
Allocated zp[1]:12 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
|
|
Allocated zp[1]:13 [ init_font_hex::$0 ]
|
|
Allocated zp[1]:14 [ init_font_hex::$1 ]
|
|
Allocated zp[1]:15 [ init_font_hex::$2 ]
|
|
Allocated zp[1]:16 [ init_font_hex::idx#3 ]
|
|
REGISTER UPLIFT POTENTIAL REGISTERS
|
|
Statement [2] *D018 = main::toD0181_return#0 [ ] ( [ ] { } ) always clobbers reg byte a
|
|
Statement [12] *init_font_hex::charset#2 = 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] { } ) always clobbers reg byte a reg byte y
|
|
Removing always clobbered register reg byte a as potential for zp[1]:5 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
Removing always clobbered register reg byte y as potential for zp[1]:5 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
Removing always clobbered register reg byte a as potential for zp[1]:10 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
Removing always clobbered register reg byte y as potential for zp[1]:10 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
Statement [14] init_font_hex::$0 = init_font_hex::proto_hi#6[init_font_hex::i#2] << 4 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] { } ) always clobbers reg byte a
|
|
Removing always clobbered register reg byte a as potential for zp[1]:11 [ init_font_hex::i#2 init_font_hex::i#1 ]
|
|
Removing always clobbered register reg byte a as potential for zp[1]:12 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
|
|
Statement [15] init_font_hex::$1 = init_font_hex::proto_lo#4[init_font_hex::i#2] << 1 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] { } ) always clobbers reg byte a
|
|
Removing always clobbered register reg byte a as potential for zp[1]:13 [ init_font_hex::$0 ]
|
|
Statement [21] init_font_hex::charset#2[init_font_hex::idx#2] = 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] { } ) always clobbers reg byte a
|
|
Statement [23] init_font_hex::charset#2[init_font_hex::idx#3] = 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] { } ) always clobbers reg byte a
|
|
Statement [24] init_font_hex::proto_lo#1 = init_font_hex::proto_lo#4 + 5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] { } ) always clobbers reg byte a
|
|
Statement [25] init_font_hex::charset#0 = init_font_hex::charset#2 + 8 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] { } ) always clobbers reg byte a
|
|
Statement [28] init_font_hex::proto_hi#1 = init_font_hex::proto_hi#6 + 5 [ init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::proto_hi#1 ] ( init_font_hex:3 [ init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::proto_hi#1 ] { } ) always clobbers reg byte a
|
|
Statement [2] *D018 = main::toD0181_return#0 [ ] ( [ ] { } ) always clobbers reg byte a
|
|
Statement [12] *init_font_hex::charset#2 = 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] { } ) always clobbers reg byte a reg byte y
|
|
Statement [14] init_font_hex::$0 = init_font_hex::proto_hi#6[init_font_hex::i#2] << 4 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] { } ) always clobbers reg byte a
|
|
Statement [15] init_font_hex::$1 = init_font_hex::proto_lo#4[init_font_hex::i#2] << 1 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] { } ) always clobbers reg byte a
|
|
Statement [21] init_font_hex::charset#2[init_font_hex::idx#2] = 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] { } ) always clobbers reg byte a
|
|
Statement [23] init_font_hex::charset#2[init_font_hex::idx#3] = 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] { } ) always clobbers reg byte a
|
|
Statement [24] init_font_hex::proto_lo#1 = init_font_hex::proto_lo#4 + 5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] { } ) always clobbers reg byte a
|
|
Statement [25] init_font_hex::charset#0 = init_font_hex::charset#2 + 8 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( init_font_hex:3 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] { } ) always clobbers reg byte a
|
|
Statement [28] init_font_hex::proto_hi#1 = init_font_hex::proto_hi#6 + 5 [ init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::proto_hi#1 ] ( init_font_hex:3 [ init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::proto_hi#1 ] { } ) always clobbers reg byte a
|
|
Potential registers zp[1]:2 [ main::c#2 main::c#1 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
|
|
Potential registers zp[2]:3 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] : zp[2]:3 ,
|
|
Potential registers zp[1]:5 [ init_font_hex::c#6 init_font_hex::c#1 ] : zp[1]:5 , reg byte x ,
|
|
Potential registers zp[2]:6 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] : zp[2]:6 ,
|
|
Potential registers zp[2]:8 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] : zp[2]:8 ,
|
|
Potential registers zp[1]:10 [ init_font_hex::c1#4 init_font_hex::c1#1 ] : zp[1]:10 , reg byte x ,
|
|
Potential registers zp[1]:11 [ init_font_hex::i#2 init_font_hex::i#1 ] : zp[1]:11 , reg byte x , reg byte y ,
|
|
Potential registers zp[1]:12 [ init_font_hex::idx#5 init_font_hex::idx#2 ] : zp[1]:12 , reg byte x , reg byte y ,
|
|
Potential registers zp[1]:13 [ init_font_hex::$0 ] : zp[1]:13 , reg byte x , reg byte y ,
|
|
Potential registers zp[1]:14 [ init_font_hex::$1 ] : zp[1]:14 , reg byte a , reg byte x , reg byte y ,
|
|
Potential registers zp[1]:15 [ init_font_hex::$2 ] : zp[1]:15 , reg byte a , reg byte x , reg byte y ,
|
|
Potential registers zp[1]:16 [ init_font_hex::idx#3 ] : zp[1]:16 , reg byte a , reg byte x , reg byte y ,
|
|
|
|
REGISTER UPLIFT SCOPES
|
|
Uplift Scope [init_font_hex] 21,668.83: zp[1]:11 [ init_font_hex::i#2 init_font_hex::i#1 ] 20,002: zp[1]:14 [ init_font_hex::$1 ] 20,002: zp[1]:15 [ init_font_hex::$2 ] 11,501.6: zp[1]:12 [ init_font_hex::idx#5 init_font_hex::idx#2 ] 10,001: zp[1]:13 [ init_font_hex::$0 ] 2,002: zp[1]:16 [ init_font_hex::idx#3 ] 1,634.97: zp[1]:10 [ init_font_hex::c1#4 init_font_hex::c1#1 ] 1,631.57: zp[2]:6 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] 1,423.81: zp[2]:8 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] 634.17: zp[2]:3 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] 162.13: zp[1]:5 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
Uplift Scope [main] 38.5: zp[1]:2 [ main::c#2 main::c#1 ]
|
|
Uplift Scope [MOS6526_CIA]
|
|
Uplift Scope [MOS6569_VICII]
|
|
Uplift Scope [MOS6581_SID]
|
|
Uplift Scope []
|
|
|
|
Uplifting [init_font_hex] best 83692 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp[1]:12 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp[1]:13 [ init_font_hex::$0 ] zp[1]:16 [ init_font_hex::idx#3 ] zp[1]:10 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp[2]:6 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp[2]:8 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp[2]:3 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp[1]:5 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
Limited combination testing to 100 combinations of 6912 possible.
|
|
Uplifting [main] best 83592 combination reg byte x [ main::c#2 main::c#1 ]
|
|
Uplifting [MOS6526_CIA] best 83592 combination
|
|
Uplifting [MOS6569_VICII] best 83592 combination
|
|
Uplifting [MOS6581_SID] best 83592 combination
|
|
Uplifting [] best 83592 combination
|
|
Attempting to uplift remaining variables inzp[1]:12 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
|
|
Uplifting [init_font_hex] best 83592 combination zp[1]:12 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
|
|
Attempting to uplift remaining variables inzp[1]:13 [ init_font_hex::$0 ]
|
|
Uplifting [init_font_hex] best 83592 combination zp[1]:13 [ init_font_hex::$0 ]
|
|
Attempting to uplift remaining variables inzp[1]:16 [ init_font_hex::idx#3 ]
|
|
Uplifting [init_font_hex] best 82992 combination reg byte y [ init_font_hex::idx#3 ]
|
|
Attempting to uplift remaining variables inzp[1]:10 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
Uplifting [init_font_hex] best 82992 combination zp[1]:10 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
Attempting to uplift remaining variables inzp[1]:5 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
Uplifting [init_font_hex] best 82992 combination zp[1]:5 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
Allocated (was zp[2]:3) zp[2]:2 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
|
|
Allocated (was zp[1]:5) zp[1]:4 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
Allocated (was zp[2]:6) zp[2]:5 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
|
|
Allocated (was zp[2]:8) zp[2]:7 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
|
|
Allocated (was zp[1]:10) zp[1]:9 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
Allocated (was zp[1]:12) zp[1]:10 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
|
|
Allocated (was zp[1]:13) zp[1]:11 [ init_font_hex::$0 ]
|
|
|
|
ASSEMBLER BEFORE OPTIMIZATION
|
|
// File Comments
|
|
// Shows a font where each char contains the number of the char (00-ff)
|
|
// Commodore 64 Registers and Constants
|
|
// The MOS 6526 Complex Interface Adapter (CIA)
|
|
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
|
|
// Upstart
|
|
// Commodore 64 PRG executable file
|
|
.file [name="font-hex-show.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 D018 = $d018
|
|
.label SCREEN = $400
|
|
.label CHARSET = $2000
|
|
.segment Code
|
|
// main
|
|
main: {
|
|
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
|
|
// [1] phi from main to main::toD0181 [phi:main->main::toD0181]
|
|
toD0181_from_main:
|
|
jmp toD0181
|
|
// main::toD0181
|
|
toD0181:
|
|
jmp __b2
|
|
// main::@2
|
|
__b2:
|
|
// [2] *D018 = main::toD0181_return#0 -- _deref_pbuc1=vbuc2
|
|
lda #toD0181_return
|
|
sta D018
|
|
// [3] call init_font_hex
|
|
// [9] phi from main::@2 to init_font_hex [phi:main::@2->init_font_hex]
|
|
init_font_hex_from___b2:
|
|
jsr init_font_hex
|
|
// [4] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
|
__b1_from___b2:
|
|
// [4] phi main::c#2 = 0 [phi:main::@2->main::@1#0] -- vbuxx=vbuc1
|
|
ldx #0
|
|
jmp __b1
|
|
// Show all chars on screen
|
|
// [4] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
|
|
__b1_from___b1:
|
|
// [4] phi main::c#2 = main::c#1 [phi:main::@1->main::@1#0] -- register_copy
|
|
jmp __b1
|
|
// main::@1
|
|
__b1:
|
|
// [5] SCREEN[main::c#2] = main::c#2 -- pbuc1_derefidx_vbuxx=vbuxx
|
|
txa
|
|
sta SCREEN,x
|
|
// [6] main::c#1 = ++ main::c#2 -- vbuxx=_inc_vbuxx
|
|
inx
|
|
// [7] if(main::c#1!=0) goto main::@1 -- vbuxx_neq_0_then_la1
|
|
cpx #0
|
|
bne __b1_from___b1
|
|
jmp __breturn
|
|
// main::@return
|
|
__breturn:
|
|
// [8] return
|
|
rts
|
|
}
|
|
// init_font_hex
|
|
// Make charset from proto chars
|
|
// init_font_hex(byte* zp(5) charset)
|
|
init_font_hex: {
|
|
.label __0 = $b
|
|
.label idx = $a
|
|
.label proto_lo = 7
|
|
.label charset = 5
|
|
.label c1 = 9
|
|
.label proto_hi = 2
|
|
.label c = 4
|
|
// [10] phi from init_font_hex to init_font_hex::@1 [phi:init_font_hex->init_font_hex::@1]
|
|
__b1_from_init_font_hex:
|
|
// [10] phi init_font_hex::c#6 = 0 [phi:init_font_hex->init_font_hex::@1#0] -- vbuz1=vbuc1
|
|
lda #0
|
|
sta.z c
|
|
// [10] phi init_font_hex::proto_hi#6 = FONT_HEX_PROTO [phi:init_font_hex->init_font_hex::@1#1] -- pbuz1=pbuc1
|
|
lda #<FONT_HEX_PROTO
|
|
sta.z proto_hi
|
|
lda #>FONT_HEX_PROTO
|
|
sta.z proto_hi+1
|
|
// [10] phi init_font_hex::charset#5 = CHARSET [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1
|
|
lda #<CHARSET
|
|
sta.z charset
|
|
lda #>CHARSET
|
|
sta.z charset+1
|
|
jmp __b1
|
|
// [10] phi from init_font_hex::@5 to init_font_hex::@1 [phi:init_font_hex::@5->init_font_hex::@1]
|
|
__b1_from___b5:
|
|
// [10] phi init_font_hex::c#6 = init_font_hex::c#1 [phi:init_font_hex::@5->init_font_hex::@1#0] -- register_copy
|
|
// [10] phi init_font_hex::proto_hi#6 = init_font_hex::proto_hi#1 [phi:init_font_hex::@5->init_font_hex::@1#1] -- register_copy
|
|
// [10] phi init_font_hex::charset#5 = init_font_hex::charset#0 [phi:init_font_hex::@5->init_font_hex::@1#2] -- register_copy
|
|
jmp __b1
|
|
// init_font_hex::@1
|
|
__b1:
|
|
// [11] phi from init_font_hex::@1 to init_font_hex::@2 [phi:init_font_hex::@1->init_font_hex::@2]
|
|
__b2_from___b1:
|
|
// [11] phi init_font_hex::c1#4 = 0 [phi:init_font_hex::@1->init_font_hex::@2#0] -- vbuz1=vbuc1
|
|
lda #0
|
|
sta.z c1
|
|
// [11] phi init_font_hex::proto_lo#4 = FONT_HEX_PROTO [phi:init_font_hex::@1->init_font_hex::@2#1] -- pbuz1=pbuc1
|
|
lda #<FONT_HEX_PROTO
|
|
sta.z proto_lo
|
|
lda #>FONT_HEX_PROTO
|
|
sta.z proto_lo+1
|
|
// [11] phi init_font_hex::charset#2 = init_font_hex::charset#5 [phi:init_font_hex::@1->init_font_hex::@2#2] -- register_copy
|
|
jmp __b2
|
|
// [11] phi from init_font_hex::@4 to init_font_hex::@2 [phi:init_font_hex::@4->init_font_hex::@2]
|
|
__b2_from___b4:
|
|
// [11] phi init_font_hex::c1#4 = init_font_hex::c1#1 [phi:init_font_hex::@4->init_font_hex::@2#0] -- register_copy
|
|
// [11] phi init_font_hex::proto_lo#4 = init_font_hex::proto_lo#1 [phi:init_font_hex::@4->init_font_hex::@2#1] -- register_copy
|
|
// [11] phi init_font_hex::charset#2 = init_font_hex::charset#0 [phi:init_font_hex::@4->init_font_hex::@2#2] -- register_copy
|
|
jmp __b2
|
|
// init_font_hex::@2
|
|
__b2:
|
|
// [12] *init_font_hex::charset#2 = 0 -- _deref_pbuz1=vbuc1
|
|
lda #0
|
|
ldy #0
|
|
sta (charset),y
|
|
// [13] phi from init_font_hex::@2 to init_font_hex::@3 [phi:init_font_hex::@2->init_font_hex::@3]
|
|
__b3_from___b2:
|
|
// [13] phi init_font_hex::idx#5 = 1 [phi:init_font_hex::@2->init_font_hex::@3#0] -- vbuz1=vbuc1
|
|
lda #1
|
|
sta.z idx
|
|
// [13] phi init_font_hex::i#2 = 0 [phi:init_font_hex::@2->init_font_hex::@3#1] -- vbuxx=vbuc1
|
|
ldx #0
|
|
jmp __b3
|
|
// [13] phi from init_font_hex::@3 to init_font_hex::@3 [phi:init_font_hex::@3->init_font_hex::@3]
|
|
__b3_from___b3:
|
|
// [13] phi init_font_hex::idx#5 = init_font_hex::idx#2 [phi:init_font_hex::@3->init_font_hex::@3#0] -- register_copy
|
|
// [13] phi init_font_hex::i#2 = init_font_hex::i#1 [phi:init_font_hex::@3->init_font_hex::@3#1] -- register_copy
|
|
jmp __b3
|
|
// init_font_hex::@3
|
|
__b3:
|
|
// [14] init_font_hex::$0 = init_font_hex::proto_hi#6[init_font_hex::i#2] << 4 -- vbuz1=pbuz2_derefidx_vbuxx_rol_4
|
|
txa
|
|
tay
|
|
lda (proto_hi),y
|
|
asl
|
|
asl
|
|
asl
|
|
asl
|
|
sta.z __0
|
|
// [15] init_font_hex::$1 = init_font_hex::proto_lo#4[init_font_hex::i#2] << 1 -- vbuaa=pbuz1_derefidx_vbuxx_rol_1
|
|
txa
|
|
tay
|
|
lda (proto_lo),y
|
|
asl
|
|
// [16] init_font_hex::$2 = init_font_hex::$0 | init_font_hex::$1 -- vbuaa=vbuz1_bor_vbuaa
|
|
ora.z __0
|
|
// [17] init_font_hex::charset#2[init_font_hex::idx#5] = init_font_hex::$2 -- pbuz1_derefidx_vbuz2=vbuaa
|
|
ldy.z idx
|
|
sta (charset),y
|
|
// [18] init_font_hex::idx#2 = ++ init_font_hex::idx#5 -- vbuz1=_inc_vbuz1
|
|
inc.z idx
|
|
// [19] init_font_hex::i#1 = ++ init_font_hex::i#2 -- vbuxx=_inc_vbuxx
|
|
inx
|
|
// [20] if(init_font_hex::i#1!=5) goto init_font_hex::@3 -- vbuxx_neq_vbuc1_then_la1
|
|
cpx #5
|
|
bne __b3_from___b3
|
|
jmp __b4
|
|
// init_font_hex::@4
|
|
__b4:
|
|
// [21] init_font_hex::charset#2[init_font_hex::idx#2] = 0 -- pbuz1_derefidx_vbuz2=vbuc1
|
|
lda #0
|
|
ldy.z idx
|
|
sta (charset),y
|
|
// [22] init_font_hex::idx#3 = ++ init_font_hex::idx#2 -- vbuyy=_inc_vbuz1
|
|
ldy.z idx
|
|
iny
|
|
// [23] init_font_hex::charset#2[init_font_hex::idx#3] = 0 -- pbuz1_derefidx_vbuyy=vbuc1
|
|
lda #0
|
|
sta (charset),y
|
|
// [24] init_font_hex::proto_lo#1 = init_font_hex::proto_lo#4 + 5 -- pbuz1=pbuz1_plus_vbuc1
|
|
lda #5
|
|
clc
|
|
adc.z proto_lo
|
|
sta.z proto_lo
|
|
bcc !+
|
|
inc.z proto_lo+1
|
|
!:
|
|
// [25] init_font_hex::charset#0 = init_font_hex::charset#2 + 8 -- pbuz1=pbuz1_plus_vbuc1
|
|
lda #8
|
|
clc
|
|
adc.z charset
|
|
sta.z charset
|
|
bcc !+
|
|
inc.z charset+1
|
|
!:
|
|
// [26] init_font_hex::c1#1 = ++ init_font_hex::c1#4 -- vbuz1=_inc_vbuz1
|
|
inc.z c1
|
|
// [27] if(init_font_hex::c1#1!=$10) goto init_font_hex::@2 -- vbuz1_neq_vbuc1_then_la1
|
|
lda #$10
|
|
cmp.z c1
|
|
bne __b2_from___b4
|
|
jmp __b5
|
|
// init_font_hex::@5
|
|
__b5:
|
|
// [28] init_font_hex::proto_hi#1 = init_font_hex::proto_hi#6 + 5 -- pbuz1=pbuz1_plus_vbuc1
|
|
lda #5
|
|
clc
|
|
adc.z proto_hi
|
|
sta.z proto_hi
|
|
bcc !+
|
|
inc.z proto_hi+1
|
|
!:
|
|
// [29] init_font_hex::c#1 = ++ init_font_hex::c#6 -- vbuz1=_inc_vbuz1
|
|
inc.z c
|
|
// [30] if(init_font_hex::c#1!=$10) goto init_font_hex::@1 -- vbuz1_neq_vbuc1_then_la1
|
|
lda #$10
|
|
cmp.z c
|
|
bne __b1_from___b5
|
|
jmp __breturn
|
|
// init_font_hex::@return
|
|
__breturn:
|
|
// [31] return
|
|
rts
|
|
}
|
|
// File Data
|
|
.segment Data
|
|
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
|
|
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
|
|
|
|
ASSEMBLER OPTIMIZATIONS
|
|
Removing instruction jmp toD0181
|
|
Removing instruction jmp __b2
|
|
Removing instruction jmp __b1
|
|
Removing instruction jmp __breturn
|
|
Removing instruction jmp __b1
|
|
Removing instruction jmp __b2
|
|
Removing instruction jmp __b3
|
|
Removing instruction jmp __b4
|
|
Removing instruction jmp __b5
|
|
Removing instruction jmp __breturn
|
|
Succesful ASM optimization Pass5NextJumpElimination
|
|
Replacing instruction ldy #0 with TAY
|
|
Removing instruction ldy.z idx
|
|
Removing instruction lda #0
|
|
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
|
Replacing label __b1_from___b1 with __b1
|
|
Replacing label __b3_from___b3 with __b3
|
|
Replacing label __b2_from___b4 with __b2
|
|
Replacing label __b1_from___b5 with __b1
|
|
Removing instruction toD0181_from_main:
|
|
Removing instruction toD0181:
|
|
Removing instruction __b1_from___b1:
|
|
Removing instruction __b1_from___b5:
|
|
Removing instruction __b2_from___b1:
|
|
Removing instruction __b2_from___b4:
|
|
Removing instruction __b3_from___b3:
|
|
Succesful ASM optimization Pass5RedundantLabelElimination
|
|
Removing instruction __b2:
|
|
Removing instruction init_font_hex_from___b2:
|
|
Removing instruction __b1_from___b2:
|
|
Removing instruction __breturn:
|
|
Removing instruction __b1_from_init_font_hex:
|
|
Removing instruction __b3_from___b2:
|
|
Removing instruction __b4:
|
|
Removing instruction __b5:
|
|
Removing instruction __breturn:
|
|
Succesful ASM optimization Pass5UnusedLabelElimination
|
|
Removing instruction jmp __b1
|
|
Removing instruction jmp __b1
|
|
Removing instruction jmp __b2
|
|
Removing instruction jmp __b3
|
|
Succesful ASM optimization Pass5NextJumpElimination
|
|
|
|
FINAL SYMBOL TABLE
|
|
const byte* CHARSET = (byte*) 8192
|
|
const nomodify byte* D018 = (byte*) 53272
|
|
const byte* FONT_HEX_PROTO[] = { 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4 }
|
|
const byte* SCREEN = (byte*) 1024
|
|
void init_font_hex(byte* init_font_hex::charset)
|
|
byte~ init_font_hex::$0 zp[1]:11 10001.0
|
|
byte~ init_font_hex::$1 reg byte a 20002.0
|
|
byte~ init_font_hex::$2 reg byte a 20002.0
|
|
byte init_font_hex::c
|
|
byte init_font_hex::c#1 c zp[1]:4 151.5
|
|
byte init_font_hex::c#6 c zp[1]:4 10.631578947368421
|
|
byte init_font_hex::c1
|
|
byte init_font_hex::c1#1 c1 zp[1]:9 1501.5
|
|
byte init_font_hex::c1#4 c1 zp[1]:9 133.46666666666667
|
|
byte* init_font_hex::charset
|
|
byte* init_font_hex::charset#0 charset zp[2]:5 350.5
|
|
byte* init_font_hex::charset#2 charset zp[2]:5 1079.0714285714287
|
|
byte* init_font_hex::charset#5 charset zp[2]:5 202.0
|
|
byte init_font_hex::i
|
|
byte init_font_hex::i#1 reg byte x 15001.5
|
|
byte init_font_hex::i#2 reg byte x 6667.333333333333
|
|
byte init_font_hex::idx
|
|
byte init_font_hex::idx#2 idx zp[1]:10 5501.0
|
|
byte init_font_hex::idx#3 reg byte y 2002.0
|
|
byte init_font_hex::idx#5 idx zp[1]:10 6000.6
|
|
byte* init_font_hex::proto_hi
|
|
byte* init_font_hex::proto_hi#1 proto_hi zp[2]:2 67.33333333333333
|
|
byte* init_font_hex::proto_hi#6 proto_hi zp[2]:2 566.8333333333333
|
|
byte* init_font_hex::proto_lo
|
|
byte* init_font_hex::proto_lo#1 proto_lo zp[2]:7 500.5
|
|
byte* init_font_hex::proto_lo#4 proto_lo zp[2]:7 923.3076923076923
|
|
void main()
|
|
byte main::c
|
|
byte main::c#1 reg byte x 16.5
|
|
byte main::c#2 reg byte x 22.0
|
|
byte* main::toD0181_gfx
|
|
byte main::toD0181_return
|
|
const byte main::toD0181_return#0 toD0181_return = >(word)SCREEN&$3fff*4|>(word)CHARSET/4&$f
|
|
byte* main::toD0181_screen
|
|
|
|
reg byte x [ main::c#2 main::c#1 ]
|
|
zp[2]:2 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
|
|
zp[1]:4 [ init_font_hex::c#6 init_font_hex::c#1 ]
|
|
zp[2]:5 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
|
|
zp[2]:7 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
|
|
zp[1]:9 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
|
|
reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ]
|
|
zp[1]:10 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
|
|
zp[1]:11 [ init_font_hex::$0 ]
|
|
reg byte a [ init_font_hex::$1 ]
|
|
reg byte a [ init_font_hex::$2 ]
|
|
reg byte y [ init_font_hex::idx#3 ]
|
|
|
|
|
|
FINAL ASSEMBLER
|
|
Score: 72379
|
|
|
|
// File Comments
|
|
// Shows a font where each char contains the number of the char (00-ff)
|
|
// Commodore 64 Registers and Constants
|
|
// The MOS 6526 Complex Interface Adapter (CIA)
|
|
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
|
|
// Upstart
|
|
// Commodore 64 PRG executable file
|
|
.file [name="font-hex-show.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 D018 = $d018
|
|
.label SCREEN = $400
|
|
.label CHARSET = $2000
|
|
.segment Code
|
|
// main
|
|
main: {
|
|
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
|
|
// [1] phi from main to main::toD0181 [phi:main->main::toD0181]
|
|
// main::toD0181
|
|
// main::@2
|
|
// *D018 = toD018(SCREEN, CHARSET)
|
|
// [2] *D018 = main::toD0181_return#0 -- _deref_pbuc1=vbuc2
|
|
lda #toD0181_return
|
|
sta D018
|
|
// init_font_hex(CHARSET)
|
|
// [3] call init_font_hex
|
|
// [9] phi from main::@2 to init_font_hex [phi:main::@2->init_font_hex]
|
|
jsr init_font_hex
|
|
// [4] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
|
// [4] phi main::c#2 = 0 [phi:main::@2->main::@1#0] -- vbuxx=vbuc1
|
|
ldx #0
|
|
// Show all chars on screen
|
|
// [4] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
|
|
// [4] phi main::c#2 = main::c#1 [phi:main::@1->main::@1#0] -- register_copy
|
|
// main::@1
|
|
__b1:
|
|
// SCREEN[c] = c
|
|
// [5] SCREEN[main::c#2] = main::c#2 -- pbuc1_derefidx_vbuxx=vbuxx
|
|
txa
|
|
sta SCREEN,x
|
|
// for (byte c: 0..255)
|
|
// [6] main::c#1 = ++ main::c#2 -- vbuxx=_inc_vbuxx
|
|
inx
|
|
// [7] if(main::c#1!=0) goto main::@1 -- vbuxx_neq_0_then_la1
|
|
cpx #0
|
|
bne __b1
|
|
// main::@return
|
|
// }
|
|
// [8] return
|
|
rts
|
|
}
|
|
// init_font_hex
|
|
// Make charset from proto chars
|
|
// init_font_hex(byte* zp(5) charset)
|
|
init_font_hex: {
|
|
.label __0 = $b
|
|
.label idx = $a
|
|
.label proto_lo = 7
|
|
.label charset = 5
|
|
.label c1 = 9
|
|
.label proto_hi = 2
|
|
.label c = 4
|
|
// [10] phi from init_font_hex to init_font_hex::@1 [phi:init_font_hex->init_font_hex::@1]
|
|
// [10] phi init_font_hex::c#6 = 0 [phi:init_font_hex->init_font_hex::@1#0] -- vbuz1=vbuc1
|
|
lda #0
|
|
sta.z c
|
|
// [10] phi init_font_hex::proto_hi#6 = FONT_HEX_PROTO [phi:init_font_hex->init_font_hex::@1#1] -- pbuz1=pbuc1
|
|
lda #<FONT_HEX_PROTO
|
|
sta.z proto_hi
|
|
lda #>FONT_HEX_PROTO
|
|
sta.z proto_hi+1
|
|
// [10] phi init_font_hex::charset#5 = CHARSET [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1
|
|
lda #<CHARSET
|
|
sta.z charset
|
|
lda #>CHARSET
|
|
sta.z charset+1
|
|
// [10] phi from init_font_hex::@5 to init_font_hex::@1 [phi:init_font_hex::@5->init_font_hex::@1]
|
|
// [10] phi init_font_hex::c#6 = init_font_hex::c#1 [phi:init_font_hex::@5->init_font_hex::@1#0] -- register_copy
|
|
// [10] phi init_font_hex::proto_hi#6 = init_font_hex::proto_hi#1 [phi:init_font_hex::@5->init_font_hex::@1#1] -- register_copy
|
|
// [10] phi init_font_hex::charset#5 = init_font_hex::charset#0 [phi:init_font_hex::@5->init_font_hex::@1#2] -- register_copy
|
|
// init_font_hex::@1
|
|
__b1:
|
|
// [11] phi from init_font_hex::@1 to init_font_hex::@2 [phi:init_font_hex::@1->init_font_hex::@2]
|
|
// [11] phi init_font_hex::c1#4 = 0 [phi:init_font_hex::@1->init_font_hex::@2#0] -- vbuz1=vbuc1
|
|
lda #0
|
|
sta.z c1
|
|
// [11] phi init_font_hex::proto_lo#4 = FONT_HEX_PROTO [phi:init_font_hex::@1->init_font_hex::@2#1] -- pbuz1=pbuc1
|
|
lda #<FONT_HEX_PROTO
|
|
sta.z proto_lo
|
|
lda #>FONT_HEX_PROTO
|
|
sta.z proto_lo+1
|
|
// [11] phi init_font_hex::charset#2 = init_font_hex::charset#5 [phi:init_font_hex::@1->init_font_hex::@2#2] -- register_copy
|
|
// [11] phi from init_font_hex::@4 to init_font_hex::@2 [phi:init_font_hex::@4->init_font_hex::@2]
|
|
// [11] phi init_font_hex::c1#4 = init_font_hex::c1#1 [phi:init_font_hex::@4->init_font_hex::@2#0] -- register_copy
|
|
// [11] phi init_font_hex::proto_lo#4 = init_font_hex::proto_lo#1 [phi:init_font_hex::@4->init_font_hex::@2#1] -- register_copy
|
|
// [11] phi init_font_hex::charset#2 = init_font_hex::charset#0 [phi:init_font_hex::@4->init_font_hex::@2#2] -- register_copy
|
|
// init_font_hex::@2
|
|
__b2:
|
|
// charset[idx++] = 0
|
|
// [12] *init_font_hex::charset#2 = 0 -- _deref_pbuz1=vbuc1
|
|
lda #0
|
|
tay
|
|
sta (charset),y
|
|
// [13] phi from init_font_hex::@2 to init_font_hex::@3 [phi:init_font_hex::@2->init_font_hex::@3]
|
|
// [13] phi init_font_hex::idx#5 = 1 [phi:init_font_hex::@2->init_font_hex::@3#0] -- vbuz1=vbuc1
|
|
lda #1
|
|
sta.z idx
|
|
// [13] phi init_font_hex::i#2 = 0 [phi:init_font_hex::@2->init_font_hex::@3#1] -- vbuxx=vbuc1
|
|
ldx #0
|
|
// [13] phi from init_font_hex::@3 to init_font_hex::@3 [phi:init_font_hex::@3->init_font_hex::@3]
|
|
// [13] phi init_font_hex::idx#5 = init_font_hex::idx#2 [phi:init_font_hex::@3->init_font_hex::@3#0] -- register_copy
|
|
// [13] phi init_font_hex::i#2 = init_font_hex::i#1 [phi:init_font_hex::@3->init_font_hex::@3#1] -- register_copy
|
|
// init_font_hex::@3
|
|
__b3:
|
|
// proto_hi[i]<<4
|
|
// [14] init_font_hex::$0 = init_font_hex::proto_hi#6[init_font_hex::i#2] << 4 -- vbuz1=pbuz2_derefidx_vbuxx_rol_4
|
|
txa
|
|
tay
|
|
lda (proto_hi),y
|
|
asl
|
|
asl
|
|
asl
|
|
asl
|
|
sta.z __0
|
|
// proto_lo[i]<<1
|
|
// [15] init_font_hex::$1 = init_font_hex::proto_lo#4[init_font_hex::i#2] << 1 -- vbuaa=pbuz1_derefidx_vbuxx_rol_1
|
|
txa
|
|
tay
|
|
lda (proto_lo),y
|
|
asl
|
|
// proto_hi[i]<<4 | proto_lo[i]<<1
|
|
// [16] init_font_hex::$2 = init_font_hex::$0 | init_font_hex::$1 -- vbuaa=vbuz1_bor_vbuaa
|
|
ora.z __0
|
|
// charset[idx++] = proto_hi[i]<<4 | proto_lo[i]<<1
|
|
// [17] init_font_hex::charset#2[init_font_hex::idx#5] = init_font_hex::$2 -- pbuz1_derefidx_vbuz2=vbuaa
|
|
ldy.z idx
|
|
sta (charset),y
|
|
// charset[idx++] = proto_hi[i]<<4 | proto_lo[i]<<1;
|
|
// [18] init_font_hex::idx#2 = ++ init_font_hex::idx#5 -- vbuz1=_inc_vbuz1
|
|
inc.z idx
|
|
// for( byte i: 0..4)
|
|
// [19] init_font_hex::i#1 = ++ init_font_hex::i#2 -- vbuxx=_inc_vbuxx
|
|
inx
|
|
// [20] if(init_font_hex::i#1!=5) goto init_font_hex::@3 -- vbuxx_neq_vbuc1_then_la1
|
|
cpx #5
|
|
bne __b3
|
|
// init_font_hex::@4
|
|
// charset[idx++] = 0
|
|
// [21] init_font_hex::charset#2[init_font_hex::idx#2] = 0 -- pbuz1_derefidx_vbuz2=vbuc1
|
|
lda #0
|
|
ldy.z idx
|
|
sta (charset),y
|
|
// charset[idx++] = 0;
|
|
// [22] init_font_hex::idx#3 = ++ init_font_hex::idx#2 -- vbuyy=_inc_vbuz1
|
|
iny
|
|
// charset[idx++] = 0
|
|
// [23] init_font_hex::charset#2[init_font_hex::idx#3] = 0 -- pbuz1_derefidx_vbuyy=vbuc1
|
|
sta (charset),y
|
|
// proto_lo += 5
|
|
// [24] init_font_hex::proto_lo#1 = init_font_hex::proto_lo#4 + 5 -- pbuz1=pbuz1_plus_vbuc1
|
|
lda #5
|
|
clc
|
|
adc.z proto_lo
|
|
sta.z proto_lo
|
|
bcc !+
|
|
inc.z proto_lo+1
|
|
!:
|
|
// charset += 8
|
|
// [25] init_font_hex::charset#0 = init_font_hex::charset#2 + 8 -- pbuz1=pbuz1_plus_vbuc1
|
|
lda #8
|
|
clc
|
|
adc.z charset
|
|
sta.z charset
|
|
bcc !+
|
|
inc.z charset+1
|
|
!:
|
|
// for( byte c: 0..15 )
|
|
// [26] init_font_hex::c1#1 = ++ init_font_hex::c1#4 -- vbuz1=_inc_vbuz1
|
|
inc.z c1
|
|
// [27] if(init_font_hex::c1#1!=$10) goto init_font_hex::@2 -- vbuz1_neq_vbuc1_then_la1
|
|
lda #$10
|
|
cmp.z c1
|
|
bne __b2
|
|
// init_font_hex::@5
|
|
// proto_hi += 5
|
|
// [28] init_font_hex::proto_hi#1 = init_font_hex::proto_hi#6 + 5 -- pbuz1=pbuz1_plus_vbuc1
|
|
lda #5
|
|
clc
|
|
adc.z proto_hi
|
|
sta.z proto_hi
|
|
bcc !+
|
|
inc.z proto_hi+1
|
|
!:
|
|
// for( byte c: 0..15 )
|
|
// [29] init_font_hex::c#1 = ++ init_font_hex::c#6 -- vbuz1=_inc_vbuz1
|
|
inc.z c
|
|
// [30] if(init_font_hex::c#1!=$10) goto init_font_hex::@1 -- vbuz1_neq_vbuc1_then_la1
|
|
lda #$10
|
|
cmp.z c
|
|
bne __b1
|
|
// init_font_hex::@return
|
|
// }
|
|
// [31] return
|
|
rts
|
|
}
|
|
// File Data
|
|
.segment Data
|
|
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
|
|
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
|
|
|