kickc/src/test/ref/millfork-benchmarks/plasma-kc.log

3928 lines
173 KiB
Plaintext

Setting inferred volatile on symbol affected by address-of last_time
Inlined call vicSelectGfxBank::$0 = call toDd00(vicSelectGfxBank::gfx)
Inlined call call __init
CONTROL FLOW GRAPH SSA
void print_ln()
print_ln: scope:[print_ln] from end::@2
print_char_cursor#35 = phi( end::@2/print_char_cursor#10 )
print_line_cursor#18 = phi( end::@2/print_line_cursor#19 )
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
print_char_cursor#18 = phi( print_ln/print_char_cursor#35, print_ln::@1/print_char_cursor#18 )
print_line_cursor#9 = phi( print_ln/print_line_cursor#18, print_ln::@1/print_line_cursor#0 )
print_ln::$0 = print_line_cursor#9 + $28
print_line_cursor#0 = print_ln::$0
print_ln::$1 = print_line_cursor#0 < print_char_cursor#18
if(print_ln::$1) goto print_ln::@1
to:print_ln::@2
print_ln::@2: scope:[print_ln] from print_ln::@1
print_line_cursor#10 = phi( print_ln::@1/print_line_cursor#0 )
print_char_cursor#0 = print_line_cursor#10
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@2
print_char_cursor#19 = phi( print_ln::@2/print_char_cursor#0 )
print_line_cursor#11 = phi( print_ln::@2/print_line_cursor#10 )
print_line_cursor#1 = print_line_cursor#11
print_char_cursor#1 = print_char_cursor#19
return
to:@return
void print_uint(unsigned int w)
print_uint: scope:[print_uint] from end::@1
print_char_cursor#36 = phi( end::@1/print_char_cursor#38 )
print_uint::w#1 = phi( end::@1/print_uint::w#0 )
print_uint::$0 = byte1 print_uint::w#1
print_uchar::b#0 = print_uint::$0
call print_uchar
to:print_uint::@1
print_uint::@1: scope:[print_uint] from print_uint
print_uint::w#2 = phi( print_uint/print_uint::w#1 )
print_char_cursor#20 = phi( print_uint/print_char_cursor#7 )
print_char_cursor#2 = print_char_cursor#20
print_uint::$2 = byte0 print_uint::w#2
print_uchar::b#1 = print_uint::$2
call print_uchar
to:print_uint::@2
print_uint::@2: scope:[print_uint] from print_uint::@1
print_char_cursor#21 = phi( print_uint::@1/print_char_cursor#7 )
print_char_cursor#3 = print_char_cursor#21
to:print_uint::@return
print_uint::@return: scope:[print_uint] from print_uint::@2
print_char_cursor#22 = phi( print_uint::@2/print_char_cursor#3 )
print_char_cursor#4 = print_char_cursor#22
return
to:@return
void print_uchar(char b)
print_uchar: scope:[print_uchar] from print_uint print_uint::@1
print_char_cursor#37 = phi( print_uint/print_char_cursor#36, print_uint::@1/print_char_cursor#2 )
print_uchar::b#2 = phi( print_uint/print_uchar::b#0, print_uint::@1/print_uchar::b#1 )
print_uchar::$0 = print_uchar::b#2 >> 4
print_char::ch#0 = print_hextab[print_uchar::$0]
call print_char
to:print_uchar::@1
print_uchar::@1: scope:[print_uchar] from print_uchar
print_uchar::b#3 = phi( print_uchar/print_uchar::b#2 )
print_char_cursor#23 = phi( print_uchar/print_char_cursor#9 )
print_char_cursor#5 = print_char_cursor#23
print_uchar::$2 = print_uchar::b#3 & $f
print_char::ch#1 = print_hextab[print_uchar::$2]
call print_char
to:print_uchar::@2
print_uchar::@2: scope:[print_uchar] from print_uchar::@1
print_char_cursor#24 = phi( print_uchar::@1/print_char_cursor#9 )
print_char_cursor#6 = print_char_cursor#24
to:print_uchar::@return
print_uchar::@return: scope:[print_uchar] from print_uchar::@2
print_char_cursor#25 = phi( print_uchar::@2/print_char_cursor#6 )
print_char_cursor#7 = print_char_cursor#25
return
to:@return
void print_char(char ch)
print_char: scope:[print_char] from print_uchar print_uchar::@1
print_char_cursor#26 = phi( print_uchar/print_char_cursor#37, print_uchar::@1/print_char_cursor#5 )
print_char::ch#2 = phi( print_uchar/print_char::ch#0, print_uchar::@1/print_char::ch#1 )
*print_char_cursor#26 = print_char::ch#2
print_char_cursor#8 = ++ print_char_cursor#26
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
print_char_cursor#27 = phi( print_char/print_char_cursor#8 )
print_char_cursor#9 = print_char_cursor#27
return
to:@return
unsigned int rand()
rand: scope:[rand] from makechar::@7
rand::$0 = rand_state << 7
rand_state = rand_state ^ rand::$0
rand::$1 = rand_state >> 9
rand_state = rand_state ^ rand::$1
rand::$2 = rand_state << 8
rand_state = rand_state ^ rand::$2
rand::return#0 = rand_state
to:rand::@return
rand::@return: scope:[rand] from rand
rand::return#3 = phi( rand/rand::return#0 )
rand::return#1 = rand::return#3
return
to:@return
void start()
start: scope:[start] from end main::@4
asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
to:start::@return
start::@return: scope:[start] from start
return
to:@return
void end()
end: scope:[end] from main::@3
print_line_cursor#24 = phi( main::@3/print_line_cursor#20 )
print_char_cursor#41 = phi( main::@3/print_char_cursor#39 )
Ticks#0 = last_time
call start
to:end::@1
end::@1: scope:[end] from end
print_line_cursor#22 = phi( end/print_line_cursor#24 )
print_char_cursor#38 = phi( end/print_char_cursor#41 )
Ticks#8 = phi( end/Ticks#0 )
last_time = last_time - Ticks#8
Ticks#1 = last_time
print_uint::w#0 = Ticks#1
call print_uint
to:end::@2
end::@2: scope:[end] from end::@1
Ticks#17 = phi( end::@1/Ticks#1 )
print_line_cursor#19 = phi( end::@1/print_line_cursor#22 )
print_char_cursor#28 = phi( end::@1/print_char_cursor#4 )
print_char_cursor#10 = print_char_cursor#28
call print_ln
to:end::@3
end::@3: scope:[end] from end::@2
Ticks#14 = phi( end::@2/Ticks#17 )
print_char_cursor#29 = phi( end::@2/print_char_cursor#1 )
print_line_cursor#12 = phi( end::@2/print_line_cursor#1 )
print_line_cursor#2 = print_line_cursor#12
print_char_cursor#11 = print_char_cursor#29
to:end::@return
end::@return: scope:[end] from end::@3
print_line_cursor#13 = phi( end::@3/print_line_cursor#2 )
print_char_cursor#30 = phi( end::@3/print_char_cursor#11 )
Ticks#9 = phi( end::@3/Ticks#14 )
Ticks#2 = Ticks#9
print_char_cursor#12 = print_char_cursor#30
print_line_cursor#3 = print_line_cursor#13
return
to:@return
void doplasma(char *scrn)
doplasma: scope:[doplasma] from main::@2 main::@6
doplasma::scrn#13 = phi( main::@2/doplasma::scrn#1, main::@6/doplasma::scrn#2 )
doplasma::c1a#0 = 0
doplasma::c1b#0 = 0
doplasma::c2a#0 = 0
doplasma::c2b#0 = 0
doplasma::c1A#0 = 0
doplasma::c1B#0 = 0
doplasma::c2A#0 = 0
doplasma::c2B#0 = 0
doplasma::i#0 = 0
doplasma::ii#0 = 0
doplasma::j#0 = 0
doplasma::jj#0 = 0
doplasma::c1a#1 = doplasma::c1A#0
doplasma::c1b#1 = doplasma::c1B#0
doplasma::ii#1 = 0
to:doplasma::@1
doplasma::@1: scope:[doplasma] from doplasma doplasma::@2
doplasma::scrn#12 = phi( doplasma/doplasma::scrn#13, doplasma::@2/doplasma::scrn#14 )
doplasma::c2B#4 = phi( doplasma/doplasma::c2B#0, doplasma::@2/doplasma::c2B#6 )
doplasma::c2A#4 = phi( doplasma/doplasma::c2A#0, doplasma::@2/doplasma::c2A#6 )
doplasma::c1B#3 = phi( doplasma/doplasma::c1B#0, doplasma::@2/doplasma::c1B#4 )
doplasma::c1A#3 = phi( doplasma/doplasma::c1A#0, doplasma::@2/doplasma::c1A#4 )
doplasma::c1b#4 = phi( doplasma/doplasma::c1b#1, doplasma::@2/doplasma::c1b#2 )
doplasma::c1a#4 = phi( doplasma/doplasma::c1a#1, doplasma::@2/doplasma::c1a#2 )
doplasma::ii#3 = phi( doplasma/doplasma::ii#1, doplasma::@2/doplasma::ii#2 )
doplasma::$0 = doplasma::ii#3 < $19
if(doplasma::$0) goto doplasma::@2
to:doplasma::@3
doplasma::@2: scope:[doplasma] from doplasma::@1
doplasma::scrn#14 = phi( doplasma::@1/doplasma::scrn#12 )
doplasma::c2B#6 = phi( doplasma::@1/doplasma::c2B#4 )
doplasma::c2A#6 = phi( doplasma::@1/doplasma::c2A#4 )
doplasma::c1B#4 = phi( doplasma::@1/doplasma::c1B#3 )
doplasma::c1A#4 = phi( doplasma::@1/doplasma::c1A#3 )
doplasma::ii#4 = phi( doplasma::@1/doplasma::ii#3 )
doplasma::c1b#3 = phi( doplasma::@1/doplasma::c1b#4 )
doplasma::c1a#3 = phi( doplasma::@1/doplasma::c1a#4 )
doplasma::$1 = sinetable[doplasma::c1a#3] + sinetable[doplasma::c1b#3]
ybuf[doplasma::ii#4] = doplasma::$1
doplasma::c1a#2 = doplasma::c1a#3 + 4
doplasma::c1b#2 = doplasma::c1b#3 + 9
doplasma::ii#2 = ++ doplasma::ii#4
to:doplasma::@1
doplasma::@3: scope:[doplasma] from doplasma::@1
doplasma::scrn#10 = phi( doplasma::@1/doplasma::scrn#12 )
doplasma::c2B#2 = phi( doplasma::@1/doplasma::c2B#4 )
doplasma::c2A#2 = phi( doplasma::@1/doplasma::c2A#4 )
doplasma::c1B#2 = phi( doplasma::@1/doplasma::c1B#3 )
doplasma::c1A#2 = phi( doplasma::@1/doplasma::c1A#3 )
doplasma::c1A#1 = doplasma::c1A#2 + 3
doplasma::c1B#1 = doplasma::c1B#2 - 5
doplasma::c2a#1 = doplasma::c2A#2
doplasma::c2b#1 = doplasma::c2B#2
doplasma::i#1 = 0
to:doplasma::@4
doplasma::@4: scope:[doplasma] from doplasma::@3 doplasma::@5
doplasma::scrn#9 = phi( doplasma::@3/doplasma::scrn#10, doplasma::@5/doplasma::scrn#11 )
doplasma::c2B#5 = phi( doplasma::@3/doplasma::c2B#2, doplasma::@5/doplasma::c2B#7 )
doplasma::c2A#5 = phi( doplasma::@3/doplasma::c2A#2, doplasma::@5/doplasma::c2A#7 )
doplasma::c2b#4 = phi( doplasma::@3/doplasma::c2b#1, doplasma::@5/doplasma::c2b#2 )
doplasma::c2a#4 = phi( doplasma::@3/doplasma::c2a#1, doplasma::@5/doplasma::c2a#2 )
doplasma::i#3 = phi( doplasma::@3/doplasma::i#1, doplasma::@5/doplasma::i#2 )
doplasma::$2 = doplasma::i#3 < $28
if(doplasma::$2) goto doplasma::@5
to:doplasma::@6
doplasma::@5: scope:[doplasma] from doplasma::@4
doplasma::scrn#11 = phi( doplasma::@4/doplasma::scrn#9 )
doplasma::c2B#7 = phi( doplasma::@4/doplasma::c2B#5 )
doplasma::c2A#7 = phi( doplasma::@4/doplasma::c2A#5 )
doplasma::i#4 = phi( doplasma::@4/doplasma::i#3 )
doplasma::c2b#3 = phi( doplasma::@4/doplasma::c2b#4 )
doplasma::c2a#3 = phi( doplasma::@4/doplasma::c2a#4 )
doplasma::$3 = sinetable[doplasma::c2a#3] + sinetable[doplasma::c2b#3]
xbuf[doplasma::i#4] = doplasma::$3
doplasma::c2a#2 = doplasma::c2a#3 + 3
doplasma::c2b#2 = doplasma::c2b#3 + 7
doplasma::i#2 = ++ doplasma::i#4
to:doplasma::@4
doplasma::@6: scope:[doplasma] from doplasma::@4
doplasma::scrn#8 = phi( doplasma::@4/doplasma::scrn#9 )
doplasma::c2B#3 = phi( doplasma::@4/doplasma::c2B#5 )
doplasma::c2A#3 = phi( doplasma::@4/doplasma::c2A#5 )
doplasma::c2A#1 = doplasma::c2A#3 + 2
doplasma::c2B#1 = doplasma::c2B#3 - 3
doplasma::jj#1 = 0
to:doplasma::@7
doplasma::@7: scope:[doplasma] from doplasma::@11 doplasma::@6
doplasma::scrn#7 = phi( doplasma::@11/doplasma::scrn#0, doplasma::@6/doplasma::scrn#8 )
doplasma::jj#3 = phi( doplasma::@11/doplasma::jj#2, doplasma::@6/doplasma::jj#1 )
doplasma::$4 = doplasma::jj#3 < $19
if(doplasma::$4) goto doplasma::@8
to:doplasma::@return
doplasma::@8: scope:[doplasma] from doplasma::@7
doplasma::scrn#6 = phi( doplasma::@7/doplasma::scrn#7 )
doplasma::jj#7 = phi( doplasma::@7/doplasma::jj#3 )
doplasma::j#1 = 0
to:doplasma::@9
doplasma::@9: scope:[doplasma] from doplasma::@10 doplasma::@8
doplasma::scrn#5 = phi( doplasma::@10/doplasma::scrn#3, doplasma::@8/doplasma::scrn#6 )
doplasma::jj#6 = phi( doplasma::@10/doplasma::jj#4, doplasma::@8/doplasma::jj#7 )
doplasma::j#3 = phi( doplasma::@10/doplasma::j#2, doplasma::@8/doplasma::j#1 )
doplasma::$5 = doplasma::j#3 < $28
if(doplasma::$5) goto doplasma::@10
to:doplasma::@11
doplasma::@10: scope:[doplasma] from doplasma::@9
doplasma::scrn#3 = phi( doplasma::@9/doplasma::scrn#5 )
doplasma::jj#4 = phi( doplasma::@9/doplasma::jj#6 )
doplasma::j#4 = phi( doplasma::@9/doplasma::j#3 )
doplasma::$6 = xbuf[doplasma::j#4] + ybuf[doplasma::jj#4]
doplasma::scrn#3[doplasma::j#4] = doplasma::$6
doplasma::j#2 = ++ doplasma::j#4
to:doplasma::@9
doplasma::@11: scope:[doplasma] from doplasma::@9
doplasma::jj#5 = phi( doplasma::@9/doplasma::jj#6 )
doplasma::scrn#4 = phi( doplasma::@9/doplasma::scrn#5 )
doplasma::scrn#0 = doplasma::scrn#4 + $28
doplasma::jj#2 = ++ doplasma::jj#5
to:doplasma::@7
doplasma::@return: scope:[doplasma] from doplasma::@7
return
to:@return
void makechar()
makechar: scope:[makechar] from main
makechar::i#0 = 0
makechar::ii#0 = 0
makechar::b#0 = 0
makechar::s#0 = 0
makechar::c#0 = 0
makechar::c#1 = 0
to:makechar::@1
makechar::@1: scope:[makechar] from makechar makechar::@5
makechar::c#3 = phi( makechar/makechar::c#1, makechar::@5/makechar::c#2 )
makechar::$0 = makechar::c#3 < $100
if(makechar::$0) goto makechar::@2
to:makechar::@return
makechar::@2: scope:[makechar] from makechar::@1
makechar::c#4 = phi( makechar::@1/makechar::c#3 )
makechar::$9 = (char)makechar::c#4
makechar::s#1 = sinetable[makechar::$9]
makechar::i#1 = 0
to:makechar::@3
makechar::@3: scope:[makechar] from makechar::@2 makechar::@8
makechar::s#7 = phi( makechar::@2/makechar::s#1, makechar::@8/makechar::s#9 )
makechar::c#7 = phi( makechar::@2/makechar::c#4, makechar::@8/makechar::c#6 )
makechar::i#3 = phi( makechar::@2/makechar::i#1, makechar::@8/makechar::i#2 )
makechar::$1 = makechar::i#3 < 8
if(makechar::$1) goto makechar::@4
to:makechar::@5
makechar::@4: scope:[makechar] from makechar::@3
makechar::s#5 = phi( makechar::@3/makechar::s#7 )
makechar::i#6 = phi( makechar::@3/makechar::i#3 )
makechar::c#9 = phi( makechar::@3/makechar::c#7 )
makechar::b#1 = 0
makechar::ii#1 = 0
to:makechar::@6
makechar::@5: scope:[makechar] from makechar::@3
makechar::c#5 = phi( makechar::@3/makechar::c#7 )
makechar::c#2 = ++ makechar::c#5
to:makechar::@1
makechar::@6: scope:[makechar] from makechar::@4 makechar::@9
makechar::s#4 = phi( makechar::@4/makechar::s#5, makechar::@9/makechar::s#6 )
makechar::b#5 = phi( makechar::@4/makechar::b#1, makechar::@9/makechar::b#7 )
makechar::i#5 = phi( makechar::@4/makechar::i#6, makechar::@9/makechar::i#7 )
makechar::c#8 = phi( makechar::@4/makechar::c#9, makechar::@9/makechar::c#10 )
makechar::ii#3 = phi( makechar::@4/makechar::ii#1, makechar::@9/makechar::ii#2 )
makechar::$2 = makechar::ii#3 < 8
if(makechar::$2) goto makechar::@7
to:makechar::@8
makechar::@7: scope:[makechar] from makechar::@6
makechar::i#10 = phi( makechar::@6/makechar::i#5 )
makechar::c#13 = phi( makechar::@6/makechar::c#8 )
makechar::b#8 = phi( makechar::@6/makechar::b#5 )
makechar::ii#7 = phi( makechar::@6/makechar::ii#3 )
makechar::s#3 = phi( makechar::@6/makechar::s#4 )
call rand
rand::return#2 = rand::return#1
to:makechar::@11
makechar::@11: scope:[makechar] from makechar::@7
makechar::i#9 = phi( makechar::@7/makechar::i#10 )
makechar::c#12 = phi( makechar::@7/makechar::c#13 )
makechar::b#6 = phi( makechar::@7/makechar::b#8 )
makechar::ii#6 = phi( makechar::@7/makechar::ii#7 )
makechar::s#2 = phi( makechar::@7/makechar::s#3 )
rand::return#4 = phi( makechar::@7/rand::return#2 )
makechar::$3 = rand::return#4
makechar::$4 = makechar::$3 & $ff
makechar::$5 = makechar::$4 > makechar::s#2
makechar::$6 = ! makechar::$5
if(makechar::$6) goto makechar::@9
to:makechar::@10
makechar::@8: scope:[makechar] from makechar::@6
makechar::s#9 = phi( makechar::@6/makechar::s#4 )
makechar::b#3 = phi( makechar::@6/makechar::b#5 )
makechar::i#4 = phi( makechar::@6/makechar::i#5 )
makechar::c#6 = phi( makechar::@6/makechar::c#8 )
makechar::$7 = makechar::c#6 << 3
makechar::$8 = makechar::$7 + makechar::i#4
((char *)CHARSET)[makechar::$8] = makechar::b#3
makechar::i#2 = ++ makechar::i#4
to:makechar::@3
makechar::@9: scope:[makechar] from makechar::@10 makechar::@11
makechar::s#6 = phi( makechar::@10/makechar::s#8, makechar::@11/makechar::s#2 )
makechar::b#7 = phi( makechar::@10/makechar::b#2, makechar::@11/makechar::b#6 )
makechar::i#7 = phi( makechar::@10/makechar::i#8, makechar::@11/makechar::i#9 )
makechar::c#10 = phi( makechar::@10/makechar::c#11, makechar::@11/makechar::c#12 )
makechar::ii#4 = phi( makechar::@10/makechar::ii#5, makechar::@11/makechar::ii#6 )
makechar::ii#2 = ++ makechar::ii#4
to:makechar::@6
makechar::@10: scope:[makechar] from makechar::@11
makechar::s#8 = phi( makechar::@11/makechar::s#2 )
makechar::i#8 = phi( makechar::@11/makechar::i#9 )
makechar::c#11 = phi( makechar::@11/makechar::c#12 )
makechar::ii#5 = phi( makechar::@11/makechar::ii#6 )
makechar::b#4 = phi( makechar::@11/makechar::b#6 )
makechar::b#2 = makechar::b#4 | bittab[makechar::ii#5]
to:makechar::@9
makechar::@return: scope:[makechar] from makechar::@1
return
to:@return
int main()
main: scope:[main] from __start::@1
print_line_cursor#29 = phi( __start::@1/print_line_cursor#21 )
print_char_cursor#47 = phi( __start::@1/print_char_cursor#40 )
Ticks#23 = phi( __start::@1/Ticks#16 )
main::v#0 = 0
main::block#0 = 0
main::count#0 = $1f4
call makechar
to:main::@4
main::@4: scope:[main] from main
print_line_cursor#27 = phi( main/print_line_cursor#29 )
print_char_cursor#45 = phi( main/print_char_cursor#47 )
Ticks#21 = phi( main/Ticks#23 )
main::count#6 = phi( main/main::count#0 )
call start
to:main::@5
main::@5: scope:[main] from main::@4
print_line_cursor#25 = phi( main::@4/print_line_cursor#27 )
print_char_cursor#43 = phi( main::@4/print_char_cursor#45 )
Ticks#19 = phi( main::@4/Ticks#21 )
main::count#4 = phi( main::@4/main::count#6 )
main::block#1 = *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A)
main::tmp#0 = 0
main::$2 = main::block#1 & $fc
main::tmp#1 = main::$2
main::tmp#2 = main::tmp#1 | (char)(unsigned int)SCREEN1>>$e^3
*((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = main::tmp#2
main::v#1 = *VICII_MEMORY
to:main::@1
main::@1: scope:[main] from main::@5 main::@7
print_line_cursor#23 = phi( main::@5/print_line_cursor#25, main::@7/print_line_cursor#26 )
print_char_cursor#42 = phi( main::@5/print_char_cursor#43, main::@7/print_char_cursor#44 )
Ticks#18 = phi( main::@5/Ticks#19, main::@7/Ticks#20 )
main::block#3 = phi( main::@5/main::block#1, main::@7/main::block#4 )
main::v#3 = phi( main::@5/main::v#1, main::@7/main::v#4 )
main::count#2 = phi( main::@5/main::count#4, main::@7/main::count#1 )
main::$6 = 0 != main::count#2
if(main::$6) goto main::@2
to:main::@3
main::@2: scope:[main] from main::@1
print_line_cursor#30 = phi( main::@1/print_line_cursor#23 )
print_char_cursor#48 = phi( main::@1/print_char_cursor#42 )
Ticks#24 = phi( main::@1/Ticks#18 )
main::block#6 = phi( main::@1/main::block#3 )
main::v#6 = phi( main::@1/main::v#3 )
main::count#7 = phi( main::@1/main::count#2 )
doplasma::scrn#1 = (char *)SCREEN1
call doplasma
to:main::@6
main::@6: scope:[main] from main::@2
print_line_cursor#28 = phi( main::@2/print_line_cursor#30 )
print_char_cursor#46 = phi( main::@2/print_char_cursor#48 )
Ticks#22 = phi( main::@2/Ticks#24 )
main::block#5 = phi( main::@2/main::block#6 )
main::v#5 = phi( main::@2/main::v#6 )
main::count#5 = phi( main::@2/main::count#7 )
*VICII_MEMORY = PAGE1
doplasma::scrn#2 = (char *)SCREEN2
call doplasma
to:main::@7
main::@7: scope:[main] from main::@6
print_line_cursor#26 = phi( main::@6/print_line_cursor#28 )
print_char_cursor#44 = phi( main::@6/print_char_cursor#46 )
Ticks#20 = phi( main::@6/Ticks#22 )
main::block#4 = phi( main::@6/main::block#5 )
main::v#4 = phi( main::@6/main::v#5 )
main::count#3 = phi( main::@6/main::count#5 )
*VICII_MEMORY = PAGE2
main::count#1 = -- main::count#3
to:main::@1
main::@3: scope:[main] from main::@1
print_line_cursor#20 = phi( main::@1/print_line_cursor#23 )
print_char_cursor#39 = phi( main::@1/print_char_cursor#42 )
Ticks#15 = phi( main::@1/Ticks#18 )
main::block#2 = phi( main::@1/main::block#3 )
main::v#2 = phi( main::@1/main::v#3 )
*VICII_MEMORY = main::v#2
*((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = main::block#2
call end
to:main::@8
main::@8: scope:[main] from main::@3
print_line_cursor#14 = phi( main::@3/print_line_cursor#3 )
print_char_cursor#31 = phi( main::@3/print_char_cursor#12 )
Ticks#10 = phi( main::@3/Ticks#2 )
Ticks#3 = Ticks#10
print_char_cursor#13 = print_char_cursor#31
print_line_cursor#4 = print_line_cursor#14
main::return#0 = 0
to:main::@return
main::@return: scope:[main] from main::@8
print_line_cursor#15 = phi( main::@8/print_line_cursor#4 )
print_char_cursor#32 = phi( main::@8/print_char_cursor#13 )
Ticks#11 = phi( main::@8/Ticks#3 )
main::return#3 = phi( main::@8/main::return#0 )
main::return#1 = main::return#3
Ticks#4 = Ticks#11
print_char_cursor#14 = print_char_cursor#32
print_line_cursor#5 = print_line_cursor#15
return
to:@return
void __start()
__start: scope:[__start] from
to:__start::__init1
__start::__init1: scope:[__start] from __start
rand_state = 1
print_screen#0 = (char *)$400
print_line_cursor#6 = print_screen#0
print_char_cursor#15 = print_line_cursor#6
last_time = 0
Ticks#5 = 0
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
print_screen#4 = phi( __start::__init1/print_screen#0 )
print_line_cursor#21 = phi( __start::__init1/print_line_cursor#6 )
print_char_cursor#40 = phi( __start::__init1/print_char_cursor#15 )
Ticks#16 = phi( __start::__init1/Ticks#5 )
call main
main::return#2 = main::return#1
to:__start::@2
__start::@2: scope:[__start] from __start::@1
print_screen#3 = phi( __start::@1/print_screen#4 )
print_line_cursor#16 = phi( __start::@1/print_line_cursor#5 )
print_char_cursor#33 = phi( __start::@1/print_char_cursor#14 )
Ticks#12 = phi( __start::@1/Ticks#4 )
Ticks#6 = Ticks#12
print_char_cursor#16 = print_char_cursor#33
print_line_cursor#7 = print_line_cursor#16
to:__start::@return
__start::@return: scope:[__start] from __start::@2
Ticks#13 = phi( __start::@2/Ticks#6 )
print_char_cursor#34 = phi( __start::@2/print_char_cursor#16 )
print_line_cursor#17 = phi( __start::@2/print_line_cursor#7 )
print_screen#2 = phi( __start::@2/print_screen#3 )
print_screen#1 = print_screen#2
print_line_cursor#8 = print_line_cursor#17
print_char_cursor#17 = print_char_cursor#34
Ticks#7 = Ticks#13
return
to:@return
SYMBOL TABLE SSA
__constant char * const CHARSET = (char *)$e800
__constant struct MOS6526_CIA * const CIA2 = (struct MOS6526_CIA *)$dd00
__constant char OFFSET_STRUCT_MOS6526_CIA_PORT_A = 0
__constant const char PAGE1 = (char)(unsigned int)SCREEN1>>6&$f0|(unsigned int)CHARSET>>$a&$e
__constant const char PAGE2 = (char)(unsigned int)SCREEN2>>6&$f0|(unsigned int)CHARSET>>$a&$e
__constant char RADIX::BINARY = 2
__constant char RADIX::DECIMAL = $a
__constant char RADIX::HEXADECIMAL = $10
__constant char RADIX::OCTAL = 8
__constant char * const SCREEN1 = (char *)$e000
__constant char * const SCREEN2 = (char *)$e400
unsigned int Ticks
unsigned int Ticks#0
unsigned int Ticks#1
unsigned int Ticks#10
unsigned int Ticks#11
unsigned int Ticks#12
unsigned int Ticks#13
unsigned int Ticks#14
unsigned int Ticks#15
unsigned int Ticks#16
unsigned int Ticks#17
unsigned int Ticks#18
unsigned int Ticks#19
unsigned int Ticks#2
unsigned int Ticks#20
unsigned int Ticks#21
unsigned int Ticks#22
unsigned int Ticks#23
unsigned int Ticks#24
unsigned int Ticks#3
unsigned int Ticks#4
unsigned int Ticks#5
unsigned int Ticks#6
unsigned int Ticks#7
unsigned int Ticks#8
unsigned int Ticks#9
__constant char * const VICII_MEMORY = (char *)$d018
void __start()
__constant const char bittab[] = { 1, 2, 4, 8, $10, $20, $40, $80 }
void doplasma(char *scrn)
bool doplasma::$0
char doplasma::$1
bool doplasma::$2
char doplasma::$3
bool doplasma::$4
bool doplasma::$5
char doplasma::$6
char doplasma::c1A
char doplasma::c1A#0
char doplasma::c1A#1
char doplasma::c1A#2
char doplasma::c1A#3
char doplasma::c1A#4
char doplasma::c1B
char doplasma::c1B#0
char doplasma::c1B#1
char doplasma::c1B#2
char doplasma::c1B#3
char doplasma::c1B#4
char doplasma::c1a
char doplasma::c1a#0
char doplasma::c1a#1
char doplasma::c1a#2
char doplasma::c1a#3
char doplasma::c1a#4
char doplasma::c1b
char doplasma::c1b#0
char doplasma::c1b#1
char doplasma::c1b#2
char doplasma::c1b#3
char doplasma::c1b#4
char doplasma::c2A
char doplasma::c2A#0
char doplasma::c2A#1
char doplasma::c2A#2
char doplasma::c2A#3
char doplasma::c2A#4
char doplasma::c2A#5
char doplasma::c2A#6
char doplasma::c2A#7
char doplasma::c2B
char doplasma::c2B#0
char doplasma::c2B#1
char doplasma::c2B#2
char doplasma::c2B#3
char doplasma::c2B#4
char doplasma::c2B#5
char doplasma::c2B#6
char doplasma::c2B#7
char doplasma::c2a
char doplasma::c2a#0
char doplasma::c2a#1
char doplasma::c2a#2
char doplasma::c2a#3
char doplasma::c2a#4
char doplasma::c2b
char doplasma::c2b#0
char doplasma::c2b#1
char doplasma::c2b#2
char doplasma::c2b#3
char doplasma::c2b#4
char doplasma::i
char doplasma::i#0
char doplasma::i#1
char doplasma::i#2
char doplasma::i#3
char doplasma::i#4
char doplasma::ii
char doplasma::ii#0
char doplasma::ii#1
char doplasma::ii#2
char doplasma::ii#3
char doplasma::ii#4
char doplasma::j
char doplasma::j#0
char doplasma::j#1
char doplasma::j#2
char doplasma::j#3
char doplasma::j#4
char doplasma::jj
char doplasma::jj#0
char doplasma::jj#1
char doplasma::jj#2
char doplasma::jj#3
char doplasma::jj#4
char doplasma::jj#5
char doplasma::jj#6
char doplasma::jj#7
char *doplasma::scrn
char *doplasma::scrn#0
char *doplasma::scrn#1
char *doplasma::scrn#10
char *doplasma::scrn#11
char *doplasma::scrn#12
char *doplasma::scrn#13
char *doplasma::scrn#14
char *doplasma::scrn#2
char *doplasma::scrn#3
char *doplasma::scrn#4
char *doplasma::scrn#5
char *doplasma::scrn#6
char *doplasma::scrn#7
char *doplasma::scrn#8
char *doplasma::scrn#9
void end()
__loadstore volatile unsigned int last_time
int main()
number main::$2
bool main::$6
char main::block
char main::block#0
char main::block#1
char main::block#2
char main::block#3
char main::block#4
char main::block#5
char main::block#6
unsigned int main::count
unsigned int main::count#0
unsigned int main::count#1
unsigned int main::count#2
unsigned int main::count#3
unsigned int main::count#4
unsigned int main::count#5
unsigned int main::count#6
unsigned int main::count#7
int main::return
int main::return#0
int main::return#1
int main::return#2
int main::return#3
char main::tmp
char main::tmp#0
char main::tmp#1
char main::tmp#2
char main::v
char main::v#0
char main::v#1
char main::v#2
char main::v#3
char main::v#4
char main::v#5
char main::v#6
void makechar()
bool makechar::$0
bool makechar::$1
bool makechar::$2
unsigned int makechar::$3
number makechar::$4
bool makechar::$5
bool makechar::$6
unsigned int makechar::$7
unsigned int makechar::$8
char makechar::$9
char makechar::b
char makechar::b#0
char makechar::b#1
char makechar::b#2
char makechar::b#3
char makechar::b#4
char makechar::b#5
char makechar::b#6
char makechar::b#7
char makechar::b#8
unsigned int makechar::c
unsigned int makechar::c#0
unsigned int makechar::c#1
unsigned int makechar::c#10
unsigned int makechar::c#11
unsigned int makechar::c#12
unsigned int makechar::c#13
unsigned int makechar::c#2
unsigned int makechar::c#3
unsigned int makechar::c#4
unsigned int makechar::c#5
unsigned int makechar::c#6
unsigned int makechar::c#7
unsigned int makechar::c#8
unsigned int makechar::c#9
char makechar::i
char makechar::i#0
char makechar::i#1
char makechar::i#10
char makechar::i#2
char makechar::i#3
char makechar::i#4
char makechar::i#5
char makechar::i#6
char makechar::i#7
char makechar::i#8
char makechar::i#9
char makechar::ii
char makechar::ii#0
char makechar::ii#1
char makechar::ii#2
char makechar::ii#3
char makechar::ii#4
char makechar::ii#5
char makechar::ii#6
char makechar::ii#7
char makechar::s
char makechar::s#0
char makechar::s#1
char makechar::s#2
char makechar::s#3
char makechar::s#4
char makechar::s#5
char makechar::s#6
char makechar::s#7
char makechar::s#8
char makechar::s#9
void print_char(char ch)
char print_char::ch
char print_char::ch#0
char print_char::ch#1
char print_char::ch#2
char *print_char_cursor
char *print_char_cursor#0
char *print_char_cursor#1
char *print_char_cursor#10
char *print_char_cursor#11
char *print_char_cursor#12
char *print_char_cursor#13
char *print_char_cursor#14
char *print_char_cursor#15
char *print_char_cursor#16
char *print_char_cursor#17
char *print_char_cursor#18
char *print_char_cursor#19
char *print_char_cursor#2
char *print_char_cursor#20
char *print_char_cursor#21
char *print_char_cursor#22
char *print_char_cursor#23
char *print_char_cursor#24
char *print_char_cursor#25
char *print_char_cursor#26
char *print_char_cursor#27
char *print_char_cursor#28
char *print_char_cursor#29
char *print_char_cursor#3
char *print_char_cursor#30
char *print_char_cursor#31
char *print_char_cursor#32
char *print_char_cursor#33
char *print_char_cursor#34
char *print_char_cursor#35
char *print_char_cursor#36
char *print_char_cursor#37
char *print_char_cursor#38
char *print_char_cursor#39
char *print_char_cursor#4
char *print_char_cursor#40
char *print_char_cursor#41
char *print_char_cursor#42
char *print_char_cursor#43
char *print_char_cursor#44
char *print_char_cursor#45
char *print_char_cursor#46
char *print_char_cursor#47
char *print_char_cursor#48
char *print_char_cursor#5
char *print_char_cursor#6
char *print_char_cursor#7
char *print_char_cursor#8
char *print_char_cursor#9
__constant const char print_hextab[] = "0123456789abcdef"z
char *print_line_cursor
char *print_line_cursor#0
char *print_line_cursor#1
char *print_line_cursor#10
char *print_line_cursor#11
char *print_line_cursor#12
char *print_line_cursor#13
char *print_line_cursor#14
char *print_line_cursor#15
char *print_line_cursor#16
char *print_line_cursor#17
char *print_line_cursor#18
char *print_line_cursor#19
char *print_line_cursor#2
char *print_line_cursor#20
char *print_line_cursor#21
char *print_line_cursor#22
char *print_line_cursor#23
char *print_line_cursor#24
char *print_line_cursor#25
char *print_line_cursor#26
char *print_line_cursor#27
char *print_line_cursor#28
char *print_line_cursor#29
char *print_line_cursor#3
char *print_line_cursor#30
char *print_line_cursor#4
char *print_line_cursor#5
char *print_line_cursor#6
char *print_line_cursor#7
char *print_line_cursor#8
char *print_line_cursor#9
void print_ln()
char *print_ln::$0
bool print_ln::$1
char *print_screen
char *print_screen#0
char *print_screen#1
char *print_screen#2
char *print_screen#3
char *print_screen#4
void print_uchar(char b)
char print_uchar::$0
number print_uchar::$2
char print_uchar::b
char print_uchar::b#0
char print_uchar::b#1
char print_uchar::b#2
char print_uchar::b#3
void print_uint(unsigned int w)
char print_uint::$0
char print_uint::$2
unsigned int print_uint::w
unsigned int print_uint::w#0
unsigned int print_uint::w#1
unsigned int print_uint::w#2
unsigned int rand()
unsigned int rand::$0
unsigned int rand::$1
unsigned int rand::$2
unsigned int rand::return
unsigned int rand::return#0
unsigned int rand::return#1
unsigned int rand::return#2
unsigned int rand::return#3
unsigned int rand::return#4
__loadstore volatile unsigned int rand_state
__constant const char sinetable[$100] = { $80, $7d, $7a, $77, $74, $70, $6d, $6a, $67, $64, $61, $5e, $5b, $58, $55, $52, $4f, $4d, $4a, $47, $44, $41, $3f, $3c, $39, $37, $34, $32, $2f, $2d, $2b, $28, $26, $24, $22, $20, $1e, $1c, $1a, $18, $16, $15, $13, $11, $10, $f, $d, $c, $b, $a, 8, 7, 6, 6, 5, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 6, 7, 8, $a, $b, $c, $d, $f, $10, $11, $13, $15, $16, $18, $1a, $1c, $1e, $20, $22, $24, $26, $28, $2b, $2d, $2f, $32, $34, $37, $39, $3c, $3f, $41, $44, $47, $4a, $4d, $4f, $52, $55, $58, $5b, $5e, $61, $64, $67, $6a, $6d, $70, $74, $77, $7a, $7d, $80, $83, $86, $89, $8c, $90, $93, $96, $99, $9c, $9f, $a2, $a5, $a8, $ab, $ae, $b1, $b3, $b6, $b9, $bc, $bf, $c1, $c4, $c7, $c9, $cc, $ce, $d1, $d3, $d5, $d8, $da, $dc, $de, $e0, $e2, $e4, $e6, $e8, $ea, $eb, $ed, $ef, $f0, $f1, $f3, $f4, $f5, $f6, $f8, $f9, $fa, $fa, $fb, $fc, $fd, $fd, $fe, $fe, $fe, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $fe, $fe, $fe, $fd, $fd, $fc, $fb, $fa, $fa, $f9, $f8, $f6, $f5, $f4, $f3, $f1, $f0, $ef, $ed, $eb, $ea, $e8, $e6, $e4, $e2, $e0, $de, $dc, $da, $d8, $d5, $d3, $d1, $ce, $cc, $c9, $c7, $c4, $c1, $bf, $bc, $b9, $b6, $b3, $b1, $ae, $ab, $a8, $a5, $a2, $9f, $9c, $99, $96, $93, $90, $8c, $89, $86, $83 }
void start()
__constant unsigned int * const start::LAST_TIME = &last_time
__constant char xbuf[$28] = { fill( $28, 0) }
__constant char ybuf[$19] = { fill( $19, 0) }
Adding number conversion cast (unumber) $f0 in
Adding number conversion cast (unumber) 6 in
Adding number conversion cast (unumber) $e in
Adding number conversion cast (unumber) $a in
Adding number conversion cast (unumber) $f0 in
Adding number conversion cast (unumber) 6 in
Adding number conversion cast (unumber) $e in
Adding number conversion cast (unumber) $a in
Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#9 + $28
Adding number conversion cast (unumber) 4 in print_uchar::$0 = print_uchar::b#2 >> 4
Adding number conversion cast (unumber) $f in print_uchar::$2 = print_uchar::b#3 & $f
Adding number conversion cast (unumber) print_uchar::$2 in print_uchar::$2 = print_uchar::b#3 & (unumber)$f
Adding number conversion cast (unumber) 7 in rand::$0 = rand_state << 7
Adding number conversion cast (unumber) 9 in rand::$1 = rand_state >> 9
Adding number conversion cast (unumber) 8 in rand::$2 = rand_state << 8
Adding number conversion cast (unumber) 0 in doplasma::ii#1 = 0
Adding number conversion cast (unumber) $19 in doplasma::$0 = doplasma::ii#3 < $19
Adding number conversion cast (unumber) 4 in doplasma::c1a#2 = doplasma::c1a#3 + 4
Adding number conversion cast (unumber) 9 in doplasma::c1b#2 = doplasma::c1b#3 + 9
Adding number conversion cast (unumber) 3 in doplasma::c1A#1 = doplasma::c1A#2 + 3
Adding number conversion cast (unumber) 5 in doplasma::c1B#1 = doplasma::c1B#2 - 5
Adding number conversion cast (unumber) 0 in doplasma::i#1 = 0
Adding number conversion cast (unumber) $28 in doplasma::$2 = doplasma::i#3 < $28
Adding number conversion cast (unumber) 3 in doplasma::c2a#2 = doplasma::c2a#3 + 3
Adding number conversion cast (unumber) 7 in doplasma::c2b#2 = doplasma::c2b#3 + 7
Adding number conversion cast (unumber) 2 in doplasma::c2A#1 = doplasma::c2A#3 + 2
Adding number conversion cast (unumber) 3 in doplasma::c2B#1 = doplasma::c2B#3 - 3
Adding number conversion cast (unumber) 0 in doplasma::jj#1 = 0
Adding number conversion cast (unumber) $19 in doplasma::$4 = doplasma::jj#3 < $19
Adding number conversion cast (unumber) 0 in doplasma::j#1 = 0
Adding number conversion cast (unumber) $28 in doplasma::$5 = doplasma::j#3 < $28
Adding number conversion cast (unumber) $28 in doplasma::scrn#0 = doplasma::scrn#4 + $28
Adding number conversion cast (unumber) 0 in makechar::c#1 = 0
Adding number conversion cast (unumber) $100 in makechar::$0 = makechar::c#3 < $100
Adding number conversion cast (unumber) 0 in makechar::i#1 = 0
Adding number conversion cast (unumber) 8 in makechar::$1 = makechar::i#3 < 8
Adding number conversion cast (unumber) 0 in makechar::b#1 = 0
Adding number conversion cast (unumber) 0 in makechar::ii#1 = 0
Adding number conversion cast (unumber) 8 in makechar::$2 = makechar::ii#3 < 8
Adding number conversion cast (unumber) $ff in makechar::$4 = makechar::$3 & $ff
Adding number conversion cast (unumber) makechar::$4 in makechar::$4 = makechar::$3 & (unumber)$ff
Adding number conversion cast (unumber) 3 in makechar::$7 = makechar::c#6 << 3
Adding number conversion cast (unumber) $fc in main::$2 = main::block#1 & $fc
Adding number conversion cast (unumber) main::$2 in main::$2 = main::block#1 & (unumber)$fc
Adding number conversion cast (unumber) 3 in main::tmp#2 = main::tmp#1 | (char)(unsigned int)SCREEN1>>$e^3
Adding number conversion cast (unumber) $e in main::tmp#2 = main::tmp#1 | (char)(unsigned int)SCREEN1>>$e^(unumber)3
Adding number conversion cast (unumber) 0 in main::$6 = 0 != main::count#2
Adding number conversion cast (snumber) 0 in main::return#0 = 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast doplasma::ii#1 = (unumber)0
Inlining cast doplasma::i#1 = (unumber)0
Inlining cast doplasma::jj#1 = (unumber)0
Inlining cast doplasma::j#1 = (unumber)0
Inlining cast makechar::c#1 = (unumber)0
Inlining cast makechar::i#1 = (unumber)0
Inlining cast makechar::b#1 = (unumber)0
Inlining cast makechar::ii#1 = (unumber)0
Inlining cast main::return#0 = (snumber)0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (char *) 53272
Simplifying constant pointer cast (struct MOS6526_CIA *) 56576
Simplifying constant pointer cast (char *) 57344
Simplifying constant pointer cast (char *) 58368
Simplifying constant pointer cast (char *) 59392
Simplifying constant integer cast 6
Simplifying constant integer cast $f0
Simplifying constant integer cast $a
Simplifying constant integer cast $e
Simplifying constant integer cast 6
Simplifying constant integer cast $f0
Simplifying constant integer cast $a
Simplifying constant integer cast $e
Simplifying constant integer cast $28
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 7
Simplifying constant integer cast 9
Simplifying constant integer cast 8
Simplifying constant integer cast 0
Simplifying constant integer cast $19
Simplifying constant integer cast 4
Simplifying constant integer cast 9
Simplifying constant integer cast 3
Simplifying constant integer cast 5
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Simplifying constant integer cast 3
Simplifying constant integer cast 7
Simplifying constant integer cast 2
Simplifying constant integer cast 3
Simplifying constant integer cast 0
Simplifying constant integer cast $19
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Simplifying constant integer cast 0
Simplifying constant integer cast $100
Simplifying constant integer cast 0
Simplifying constant integer cast 8
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 8
Simplifying constant integer cast $ff
Simplifying constant integer cast 3
Simplifying constant integer cast CHARSET
Simplifying constant integer cast $fc
Simplifying constant integer cast $e
Simplifying constant integer cast 3
Simplifying constant integer cast 0
Simplifying constant integer cast SCREEN1
Simplifying constant integer cast SCREEN2
Simplifying constant integer cast 0
Simplifying constant pointer cast (char *) 1024
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 6
Finalized unsigned number type (char) $f0
Finalized unsigned number type (char) $a
Finalized unsigned number type (char) $e
Finalized unsigned number type (char) 6
Finalized unsigned number type (char) $f0
Finalized unsigned number type (char) $a
Finalized unsigned number type (char) $e
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) $f
Finalized unsigned number type (char) 7
Finalized unsigned number type (char) 9
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $19
Finalized unsigned number type (char) 4
Finalized unsigned number type (char) 9
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) 5
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) 7
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $19
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) 0
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) $ff
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) $fc
Finalized unsigned number type (char) $e
Finalized unsigned number type (char) 3
Finalized unsigned number type (char) 0
Finalized signed number type (signed char) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to char in print_uchar::$2 = print_uchar::b#3 & $f
Inferred type updated to char in makechar::$4 = makechar::$3 & $ff
Inferred type updated to char in main::$2 = main::block#1 & $fc
Inversing boolean not [168] makechar::$6 = makechar::$4 <= makechar::s#2 from [167] makechar::$5 = makechar::$4 > makechar::s#2
Successful SSA optimization Pass2UnaryNotSimplification
Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#10 print_char_cursor#0 print_line_cursor#11 print_char_cursor#19 print_line_cursor#1 print_char_cursor#1
Alias print_uchar::b#0 = print_uint::$0
Alias print_uint::w#1 = print_uint::w#2
Alias print_char_cursor#2 = print_char_cursor#20
Alias print_uchar::b#1 = print_uint::$2
Alias print_char_cursor#21 = print_char_cursor#3 print_char_cursor#22 print_char_cursor#4
Alias print_uchar::b#2 = print_uchar::b#3
Alias print_char_cursor#23 = print_char_cursor#5
Alias print_char_cursor#24 = print_char_cursor#6 print_char_cursor#25 print_char_cursor#7
Alias print_char_cursor#27 = print_char_cursor#8 print_char_cursor#9
Alias rand::return#0 = rand::return#3 rand::return#1
Alias Ticks#0 = Ticks#8
Alias print_char_cursor#38 = print_char_cursor#41
Alias print_line_cursor#19 = print_line_cursor#22 print_line_cursor#24
Alias Ticks#1 = Ticks#17 Ticks#14 Ticks#9 Ticks#2
Alias print_char_cursor#10 = print_char_cursor#28
Alias print_line_cursor#12 = print_line_cursor#2 print_line_cursor#13 print_line_cursor#3
Alias print_char_cursor#11 = print_char_cursor#29 print_char_cursor#30 print_char_cursor#12
Alias doplasma::c1a#1 = doplasma::c1A#0
Alias doplasma::c1b#1 = doplasma::c1B#0
Alias doplasma::c1a#3 = doplasma::c1a#4
Alias doplasma::c1b#3 = doplasma::c1b#4
Alias doplasma::ii#3 = doplasma::ii#4
Alias doplasma::c1A#2 = doplasma::c1A#4 doplasma::c1A#3
Alias doplasma::c1B#2 = doplasma::c1B#4 doplasma::c1B#3
Alias doplasma::c2A#2 = doplasma::c2A#6 doplasma::c2A#4 doplasma::c2a#1
Alias doplasma::c2B#2 = doplasma::c2B#6 doplasma::c2B#4 doplasma::c2b#1
Alias doplasma::scrn#10 = doplasma::scrn#14 doplasma::scrn#12
Alias doplasma::c2a#3 = doplasma::c2a#4
Alias doplasma::c2b#3 = doplasma::c2b#4
Alias doplasma::i#3 = doplasma::i#4
Alias doplasma::c2A#3 = doplasma::c2A#7 doplasma::c2A#5
Alias doplasma::c2B#3 = doplasma::c2B#7 doplasma::c2B#5
Alias doplasma::scrn#11 = doplasma::scrn#9 doplasma::scrn#8
Alias doplasma::jj#3 = doplasma::jj#7
Alias doplasma::scrn#6 = doplasma::scrn#7
Alias doplasma::j#3 = doplasma::j#4
Alias doplasma::jj#4 = doplasma::jj#6 doplasma::jj#5
Alias doplasma::scrn#3 = doplasma::scrn#5 doplasma::scrn#4
Alias makechar::c#3 = makechar::c#4
Alias makechar::c#5 = makechar::c#9 makechar::c#7
Alias makechar::i#3 = makechar::i#6
Alias makechar::s#5 = makechar::s#7
Alias makechar::s#2 = makechar::s#3 makechar::s#4 makechar::s#9 makechar::s#8
Alias makechar::ii#3 = makechar::ii#7 makechar::ii#6 makechar::ii#5
Alias makechar::b#3 = makechar::b#8 makechar::b#5 makechar::b#6 makechar::b#4
Alias makechar::c#11 = makechar::c#13 makechar::c#8 makechar::c#12 makechar::c#6
Alias makechar::i#10 = makechar::i#5 makechar::i#9 makechar::i#4 makechar::i#8
Alias rand::return#2 = rand::return#4
Alias main::count#0 = main::count#6 main::count#4
Alias Ticks#19 = Ticks#21 Ticks#23
Alias print_char_cursor#43 = print_char_cursor#45 print_char_cursor#47
Alias print_line_cursor#25 = print_line_cursor#27 print_line_cursor#29
Alias main::tmp#1 = main::$2
Alias main::count#2 = main::count#7 main::count#5 main::count#3
Alias main::v#2 = main::v#6 main::v#3 main::v#5 main::v#4
Alias main::block#2 = main::block#6 main::block#3 main::block#5 main::block#4
Alias Ticks#15 = Ticks#24 Ticks#18 Ticks#22 Ticks#20
Alias print_char_cursor#39 = print_char_cursor#48 print_char_cursor#42 print_char_cursor#46 print_char_cursor#44
Alias print_line_cursor#20 = print_line_cursor#30 print_line_cursor#23 print_line_cursor#28 print_line_cursor#26
Alias Ticks#10 = Ticks#3 Ticks#11 Ticks#4
Alias print_char_cursor#13 = print_char_cursor#31 print_char_cursor#32 print_char_cursor#14
Alias print_line_cursor#14 = print_line_cursor#4 print_line_cursor#15 print_line_cursor#5
Alias main::return#0 = main::return#3 main::return#1
Alias print_screen#0 = print_line_cursor#6 print_char_cursor#15 print_char_cursor#40 print_line_cursor#21 print_screen#4 print_screen#3 print_screen#2 print_screen#1
Alias Ticks#16 = Ticks#5
Alias Ticks#12 = Ticks#6 Ticks#13 Ticks#7
Alias print_char_cursor#16 = print_char_cursor#33 print_char_cursor#34 print_char_cursor#17
Alias print_line_cursor#16 = print_line_cursor#7 print_line_cursor#17 print_line_cursor#8
Successful SSA optimization Pass2AliasElimination
Alias makechar::ii#3 = makechar::ii#4
Alias makechar::c#10 = makechar::c#11
Alias makechar::i#10 = makechar::i#7
Alias makechar::s#2 = makechar::s#6
Successful SSA optimization Pass2AliasElimination
Identical Phi Values print_line_cursor#18 print_line_cursor#19
Identical Phi Values print_char_cursor#35 print_char_cursor#10
Identical Phi Values print_char_cursor#18 print_char_cursor#35
Identical Phi Values print_uint::w#1 print_uint::w#0
Identical Phi Values print_char_cursor#36 print_char_cursor#38
Identical Phi Values print_char_cursor#2 print_char_cursor#24
Identical Phi Values print_char_cursor#21 print_char_cursor#24
Identical Phi Values print_char_cursor#23 print_char_cursor#27
Identical Phi Values print_char_cursor#24 print_char_cursor#27
Identical Phi Values print_char_cursor#38 print_char_cursor#39
Identical Phi Values print_line_cursor#19 print_line_cursor#20
Identical Phi Values print_char_cursor#10 print_char_cursor#21
Identical Phi Values print_line_cursor#12 print_line_cursor#0
Identical Phi Values print_char_cursor#11 print_line_cursor#0
Identical Phi Values doplasma::c1A#2 doplasma::c1a#1
Identical Phi Values doplasma::c1B#2 doplasma::c1b#1
Identical Phi Values doplasma::c2A#2 doplasma::c2A#0
Identical Phi Values doplasma::c2B#2 doplasma::c2B#0
Identical Phi Values doplasma::scrn#10 doplasma::scrn#13
Identical Phi Values doplasma::c2A#3 doplasma::c2A#2
Identical Phi Values doplasma::c2B#3 doplasma::c2B#2
Identical Phi Values doplasma::scrn#11 doplasma::scrn#10
Identical Phi Values doplasma::jj#4 doplasma::jj#3
Identical Phi Values doplasma::scrn#3 doplasma::scrn#6
Identical Phi Values makechar::c#10 makechar::c#5
Identical Phi Values makechar::i#10 makechar::i#3
Identical Phi Values makechar::s#2 makechar::s#5
Identical Phi Values Ticks#19 Ticks#16
Identical Phi Values print_char_cursor#43 print_screen#0
Identical Phi Values print_line_cursor#25 print_screen#0
Identical Phi Values main::v#2 main::v#1
Identical Phi Values main::block#2 main::block#1
Identical Phi Values Ticks#15 Ticks#19
Identical Phi Values print_char_cursor#39 print_char_cursor#43
Identical Phi Values print_line_cursor#20 print_line_cursor#25
Identical Phi Values Ticks#10 Ticks#1
Identical Phi Values print_char_cursor#13 print_char_cursor#11
Identical Phi Values print_line_cursor#14 print_line_cursor#12
Identical Phi Values Ticks#12 Ticks#10
Identical Phi Values print_char_cursor#16 print_char_cursor#13
Identical Phi Values print_line_cursor#16 print_line_cursor#14
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values makechar::c#5 makechar::c#3
Identical Phi Values makechar::s#5 makechar::s#1
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition print_ln::$1 [4] if(print_line_cursor#0<print_char_cursor#27) goto print_ln::@1
Simple Condition doplasma::$0 [65] if(doplasma::ii#3<$19) goto doplasma::@2
Simple Condition doplasma::$2 [76] if(doplasma::i#3<$28) goto doplasma::@5
Simple Condition doplasma::$4 [87] if(doplasma::jj#3<$19) goto doplasma::@8
Simple Condition doplasma::$5 [91] if(doplasma::j#3<$28) goto doplasma::@10
Simple Condition makechar::$0 [106] if(makechar::c#3<$100) goto makechar::@2
Simple Condition makechar::$1 [112] if(makechar::i#3<8) goto makechar::@4
Simple Condition makechar::$2 [118] if(makechar::ii#3<8) goto makechar::@7
Simple Condition makechar::$6 [124] if(makechar::$4<=makechar::s#1) goto makechar::@9
Simple Condition main::$6 [147] if(0!=main::count#2) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant doplasma::c1a#0 = 0
Constant doplasma::c1b#0 = 0
Constant doplasma::c2a#0 = 0
Constant doplasma::c2b#0 = 0
Constant doplasma::c1a#1 = 0
Constant doplasma::c1b#1 = 0
Constant doplasma::c2A#0 = 0
Constant doplasma::c2B#0 = 0
Constant doplasma::i#0 = 0
Constant doplasma::ii#0 = 0
Constant doplasma::j#0 = 0
Constant doplasma::jj#0 = 0
Constant doplasma::ii#1 = 0
Constant doplasma::i#1 = 0
Constant doplasma::jj#1 = 0
Constant doplasma::j#1 = 0
Constant makechar::i#0 = 0
Constant makechar::ii#0 = 0
Constant makechar::b#0 = 0
Constant makechar::s#0 = 0
Constant makechar::c#0 = 0
Constant makechar::c#1 = 0
Constant makechar::i#1 = 0
Constant makechar::b#1 = 0
Constant makechar::ii#1 = 0
Constant main::v#0 = 0
Constant main::block#0 = 0
Constant main::count#0 = $1f4
Constant main::tmp#0 = 0
Constant doplasma::scrn#1 = SCREEN1
Constant doplasma::scrn#2 = SCREEN2
Constant main::return#0 = 0
Constant print_screen#0 = (char *) 1024
Constant Ticks#16 = 0
Successful SSA optimization Pass2ConstantIdentification
Constant main::return#2 = main::return#0
Successful SSA optimization Pass2ConstantIdentification
De-inlining pointer[w] to *(pointer+w) [127] CHARSET[makechar::$8] = makechar::b#3
Successful SSA optimization Pass2DeInlineWordDerefIdx
Simplifying constant evaluating to zero (char)(unsigned int)SCREEN1>>$e^3 in [142] main::tmp#2 = main::tmp#1 | (char)(unsigned int)SCREEN1>>$e^3
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero 3 in [71] doplasma::c1A#1 = doplasma::c1a#1 + 3
Simplifying expression containing zero 5 in [72] doplasma::c1B#1 = doplasma::c1b#1 - 5
Simplifying expression containing zero 2 in [82] doplasma::c2A#1 = doplasma::c2A#0 + 2
Simplifying expression containing zero 3 in [83] doplasma::c2B#1 = doplasma::c2B#0 - 3
Simplifying expression containing zero (char *)CIA2 in [139] main::block#1 = *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Simplifying expression containing zero main::tmp#1 in [142] main::tmp#2 = main::tmp#1 | 0
Simplifying expression containing zero (char *)CIA2 in [143] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = main::tmp#2
Simplifying expression containing zero (char *)CIA2 in [156] *((char *)CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A) = main::block#1
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable doplasma::c1A#1 and assignment [47] doplasma::c1A#1 = 3
Eliminating unused variable doplasma::c1B#1 and assignment [48] doplasma::c1B#1 = 5
Eliminating unused variable doplasma::c2A#1 and assignment [56] doplasma::c2A#1 = 2
Eliminating unused variable doplasma::c2B#1 and assignment [57] doplasma::c2B#1 = 3
Eliminating unused constant doplasma::c1a#0
Eliminating unused constant doplasma::c1b#0
Eliminating unused constant doplasma::c2a#0
Eliminating unused constant doplasma::c2b#0
Eliminating unused constant doplasma::i#0
Eliminating unused constant doplasma::ii#0
Eliminating unused constant doplasma::j#0
Eliminating unused constant doplasma::jj#0
Eliminating unused constant makechar::i#0
Eliminating unused constant makechar::ii#0
Eliminating unused constant makechar::b#0
Eliminating unused constant makechar::s#0
Eliminating unused constant makechar::c#0
Eliminating unused constant main::v#0
Eliminating unused constant main::block#0
Eliminating unused constant main::tmp#0
Eliminating unused constant main::return#2
Eliminating unused constant OFFSET_STRUCT_MOS6526_CIA_PORT_A
Eliminating unused constant Ticks#16
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant main::return#0
Successful SSA optimization PassNEliminateUnusedVars
Simplifying constant integer cast (unsigned int)SCREEN1>>6&$f0|(unsigned int)CHARSET>>$a&$e
Simplifying constant integer cast (unsigned int)SCREEN2>>6&$f0|(unsigned int)CHARSET>>$a&$e
Successful SSA optimization PassNCastSimplification
Alias main::tmp#1 = main::tmp#2
Successful SSA optimization Pass2AliasElimination
Inlining constant with var siblings doplasma::c1a#1
Inlining constant with var siblings doplasma::c1b#1
Inlining constant with var siblings doplasma::ii#1
Inlining constant with var siblings doplasma::i#1
Inlining constant with var siblings doplasma::jj#1
Inlining constant with var siblings doplasma::j#1
Inlining constant with var siblings doplasma::scrn#1
Inlining constant with var siblings doplasma::scrn#2
Inlining constant with var siblings makechar::c#1
Inlining constant with var siblings makechar::i#1
Inlining constant with var siblings makechar::b#1
Inlining constant with var siblings makechar::ii#1
Inlining constant with var siblings main::count#0
Constant inlined makechar::c#1 = 0
Constant inlined makechar::b#1 = 0
Constant inlined doplasma::i#1 = 0
Constant inlined makechar::ii#1 = 0
Constant inlined doplasma::j#1 = 0
Constant inlined doplasma::ii#1 = 0
Constant inlined doplasma::jj#1 = 0
Constant inlined main::count#0 = $1f4
Constant inlined doplasma::scrn#2 = SCREEN2
Constant inlined doplasma::scrn#1 = SCREEN1
Constant inlined doplasma::c1a#1 = 0
Constant inlined doplasma::c1b#1 = 0
Constant inlined makechar::i#1 = 0
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) $a
Finalized unsigned number type (char) $10
Finalized unsigned number type (unsigned int) $100
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) $28
Finalized unsigned number type (char) $19
Finalized unsigned number type (char) $19
Successful SSA optimization PassNFinalizeNumberTypeConversions
Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1)
Added new block during phi lifting makechar::@12(between makechar::@11 and makechar::@9)
Adding NOP phi() at start of __start
Adding NOP phi() at start of __start::@1
Adding NOP phi() at start of __start::@2
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::@8
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of makechar
Adding NOP phi() at start of makechar::@4
Adding NOP phi() at start of makechar::@7
Adding NOP phi() at start of end::@2
Adding NOP phi() at start of end::@3
Adding NOP phi() at start of doplasma::@3
Adding NOP phi() at start of doplasma::@8
Adding NOP phi() at start of print_uint::@2
Adding NOP phi() at start of print_ln
Adding NOP phi() at start of print_ln::@2
Adding NOP phi() at start of print_uchar::@2
CALL GRAPH
Calls in [__start] to main:4
Calls in [main] to makechar:8 start:10 end:19 doplasma:23 doplasma:25
Calls in [makechar] to rand:49
Calls in [end] to start:64 print_uint:68 print_ln:70
Calls in [print_uint] to print_uchar:120 print_uchar:124
Calls in [print_uchar] to print_char:139 print_char:144
Created 21 initial phi equivalence classes
Coalesced [28] main::count#8 = main::count#1
Coalesced [38] makechar::c#14 = makechar::c#2
Coalesced [47] makechar::i#11 = makechar::i#2
Coalesced [55] makechar::b#10 = makechar::b#2
Coalesced [58] makechar::ii#8 = makechar::ii#2
Coalesced [59] makechar::b#9 = makechar::b#7
Coalesced (already) [60] makechar::b#11 = makechar::b#3
Coalesced [79] doplasma::scrn#16 = doplasma::scrn#13
Coalesced [88] doplasma::jj#8 = doplasma::jj#2
Coalesced [89] doplasma::scrn#15 = doplasma::scrn#0
Coalesced [93] doplasma::j#5 = doplasma::j#2
Coalesced [99] doplasma::i#5 = doplasma::i#2
Coalesced [100] doplasma::c2a#5 = doplasma::c2a#2
Coalesced [101] doplasma::c2b#5 = doplasma::c2b#2
Coalesced [107] doplasma::ii#5 = doplasma::ii#2
Coalesced [108] doplasma::c1a#5 = doplasma::c1a#2
Coalesced [109] doplasma::c1b#5 = doplasma::c1b#2
Coalesced [119] print_uchar::b#4 = print_uchar::b#0
Coalesced [122] print_uchar::b#5 = print_uchar::b#1
Coalesced [123] print_char_cursor#49 = print_char_cursor#27
Coalesced [133] print_line_cursor#31 = print_line_cursor#0
Coalesced [137] print_char::ch#3 = print_char::ch#0
Coalesced [138] print_char_cursor#50 = print_char_cursor#37
Coalesced [142] print_char::ch#4 = print_char::ch#1
Coalesced (already) [143] print_char_cursor#51 = print_char_cursor#27
Coalesced down to 18 phi equivalence classes
Culled Empty Block label __start::@2
Culled Empty Block label main::@8
Culled Empty Block label makechar::@4
Culled Empty Block label makechar::@12
Culled Empty Block label end::@3
Culled Empty Block label doplasma::@3
Culled Empty Block label doplasma::@6
Culled Empty Block label doplasma::@8
Culled Empty Block label print_uint::@2
Culled Empty Block label print_ln::@2
Culled Empty Block label print_ln::@3
Culled Empty Block label print_uchar::@2
Renumbering block doplasma::@4 to doplasma::@3
Renumbering block doplasma::@5 to doplasma::@4
Renumbering block doplasma::@7 to doplasma::@5
Renumbering block doplasma::@9 to doplasma::@6
Renumbering block doplasma::@10 to doplasma::@7
Renumbering block doplasma::@11 to doplasma::@8
Renumbering block makechar::@5 to makechar::@4
Renumbering block makechar::@6 to makechar::@5
Renumbering block makechar::@7 to makechar::@6
Renumbering block makechar::@8 to makechar::@7
Renumbering block makechar::@9 to makechar::@8
Renumbering block makechar::@10 to makechar::@9
Renumbering block makechar::@11 to makechar::@10
Adding NOP phi() at start of __start
Adding NOP phi() at start of __start::@1
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of makechar
Adding NOP phi() at start of makechar::@6
Adding NOP phi() at start of end::@2
Adding NOP phi() at start of print_ln
FINAL CONTROL FLOW GRAPH
void __start()
__start: scope:[__start] from
[0] phi()
to:__start::__init1
__start::__init1: scope:[__start] from __start
[1] rand_state = 1
[2] last_time = 0
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
[3] phi()
[4] call main
to:__start::@return
__start::@return: scope:[__start] from __start::@1
[5] return
to:@return
int main()
main: scope:[main] from __start::@1
[6] phi()
[7] call makechar
to:main::@4
main::@4: scope:[main] from main
[8] phi()
[9] call start
to:main::@5
main::@5: scope:[main] from main::@4
[10] main::block#1 = *((char *)CIA2)
[11] main::tmp#1 = main::block#1 & $fc
[12] *((char *)CIA2) = main::tmp#1
[13] main::v#1 = *VICII_MEMORY
to:main::@1
main::@1: scope:[main] from main::@5 main::@7
[14] main::count#2 = phi( main::@5/$1f4, main::@7/main::count#1 )
[15] if(0!=main::count#2) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@1
[16] *VICII_MEMORY = main::v#1
[17] *((char *)CIA2) = main::block#1
[18] call end
to:main::@return
main::@return: scope:[main] from main::@3
[19] return
to:@return
main::@2: scope:[main] from main::@1
[20] phi()
[21] call doplasma
to:main::@6
main::@6: scope:[main] from main::@2
[22] *VICII_MEMORY = PAGE1
[23] call doplasma
to:main::@7
main::@7: scope:[main] from main::@6
[24] *VICII_MEMORY = PAGE2
[25] main::count#1 = -- main::count#2
to:main::@1
void makechar()
makechar: scope:[makechar] from main
[26] phi()
to:makechar::@1
makechar::@1: scope:[makechar] from makechar makechar::@4
[27] makechar::c#3 = phi( makechar/0, makechar::@4/makechar::c#2 )
[28] if(makechar::c#3<$100) goto makechar::@2
to:makechar::@return
makechar::@return: scope:[makechar] from makechar::@1
[29] return
to:@return
makechar::@2: scope:[makechar] from makechar::@1
[30] makechar::$9 = (char)makechar::c#3
[31] makechar::s#1 = sinetable[makechar::$9]
to:makechar::@3
makechar::@3: scope:[makechar] from makechar::@2 makechar::@7
[32] makechar::i#3 = phi( makechar::@2/0, makechar::@7/makechar::i#2 )
[33] if(makechar::i#3<8) goto makechar::@5
to:makechar::@4
makechar::@4: scope:[makechar] from makechar::@3
[34] makechar::c#2 = ++ makechar::c#3
to:makechar::@1
makechar::@5: scope:[makechar] from makechar::@3 makechar::@8
[35] makechar::b#3 = phi( makechar::@3/0, makechar::@8/makechar::b#7 )
[35] makechar::ii#3 = phi( makechar::@3/0, makechar::@8/makechar::ii#2 )
[36] if(makechar::ii#3<8) goto makechar::@6
to:makechar::@7
makechar::@7: scope:[makechar] from makechar::@5
[37] makechar::$7 = makechar::c#3 << 3
[38] makechar::$8 = makechar::$7 + makechar::i#3
[39] makechar::$10 = CHARSET + makechar::$8
[40] *makechar::$10 = makechar::b#3
[41] makechar::i#2 = ++ makechar::i#3
to:makechar::@3
makechar::@6: scope:[makechar] from makechar::@5
[42] phi()
[43] call rand
[44] rand::return#2 = rand::return#0
to:makechar::@10
makechar::@10: scope:[makechar] from makechar::@6
[45] makechar::$3 = rand::return#2
[46] makechar::$4 = makechar::$3 & $ff
[47] if(makechar::$4<=makechar::s#1) goto makechar::@8
to:makechar::@9
makechar::@9: scope:[makechar] from makechar::@10
[48] makechar::b#2 = makechar::b#3 | bittab[makechar::ii#3]
to:makechar::@8
makechar::@8: scope:[makechar] from makechar::@10 makechar::@9
[49] makechar::b#7 = phi( makechar::@9/makechar::b#2, makechar::@10/makechar::b#3 )
[50] makechar::ii#2 = ++ makechar::ii#3
to:makechar::@5
void start()
start: scope:[start] from end main::@4
asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
to:start::@return
start::@return: scope:[start] from start
[52] return
to:@return
void end()
end: scope:[end] from main::@3
[53] Ticks#0 = last_time
[54] call start
to:end::@1
end::@1: scope:[end] from end
[55] last_time = last_time - Ticks#0
[56] Ticks#1 = last_time
[57] print_uint::w#0 = Ticks#1
[58] call print_uint
to:end::@2
end::@2: scope:[end] from end::@1
[59] phi()
[60] call print_ln
to:end::@return
end::@return: scope:[end] from end::@2
[61] return
to:@return
void doplasma(char *scrn)
doplasma: scope:[doplasma] from main::@2 main::@6
[62] doplasma::scrn#13 = phi( main::@2/SCREEN1, main::@6/SCREEN2 )
to:doplasma::@1
doplasma::@1: scope:[doplasma] from doplasma doplasma::@2
[63] doplasma::c1b#3 = phi( doplasma/0, doplasma::@2/doplasma::c1b#2 )
[63] doplasma::c1a#3 = phi( doplasma/0, doplasma::@2/doplasma::c1a#2 )
[63] doplasma::ii#3 = phi( doplasma/0, doplasma::@2/doplasma::ii#2 )
[64] if(doplasma::ii#3<$19) goto doplasma::@2
to:doplasma::@3
doplasma::@3: scope:[doplasma] from doplasma::@1 doplasma::@4
[65] doplasma::c2b#3 = phi( doplasma::@1/doplasma::c2B#0, doplasma::@4/doplasma::c2b#2 )
[65] doplasma::c2a#3 = phi( doplasma::@1/doplasma::c2A#0, doplasma::@4/doplasma::c2a#2 )
[65] doplasma::i#3 = phi( doplasma::@1/0, doplasma::@4/doplasma::i#2 )
[66] if(doplasma::i#3<$28) goto doplasma::@4
to:doplasma::@5
doplasma::@5: scope:[doplasma] from doplasma::@3 doplasma::@8
[67] doplasma::scrn#6 = phi( doplasma::@8/doplasma::scrn#0, doplasma::@3/doplasma::scrn#13 )
[67] doplasma::jj#3 = phi( doplasma::@8/doplasma::jj#2, doplasma::@3/0 )
[68] if(doplasma::jj#3<$19) goto doplasma::@6
to:doplasma::@return
doplasma::@return: scope:[doplasma] from doplasma::@5
[69] return
to:@return
doplasma::@6: scope:[doplasma] from doplasma::@5 doplasma::@7
[70] doplasma::j#3 = phi( doplasma::@7/doplasma::j#2, doplasma::@5/0 )
[71] if(doplasma::j#3<$28) goto doplasma::@7
to:doplasma::@8
doplasma::@8: scope:[doplasma] from doplasma::@6
[72] doplasma::scrn#0 = doplasma::scrn#6 + $28
[73] doplasma::jj#2 = ++ doplasma::jj#3
to:doplasma::@5
doplasma::@7: scope:[doplasma] from doplasma::@6
[74] doplasma::$6 = xbuf[doplasma::j#3] + ybuf[doplasma::jj#3]
[75] doplasma::scrn#6[doplasma::j#3] = doplasma::$6
[76] doplasma::j#2 = ++ doplasma::j#3
to:doplasma::@6
doplasma::@4: scope:[doplasma] from doplasma::@3
[77] doplasma::$3 = sinetable[doplasma::c2a#3] + sinetable[doplasma::c2b#3]
[78] xbuf[doplasma::i#3] = doplasma::$3
[79] doplasma::c2a#2 = doplasma::c2a#3 + 3
[80] doplasma::c2b#2 = doplasma::c2b#3 + 7
[81] doplasma::i#2 = ++ doplasma::i#3
to:doplasma::@3
doplasma::@2: scope:[doplasma] from doplasma::@1
[82] doplasma::$1 = sinetable[doplasma::c1a#3] + sinetable[doplasma::c1b#3]
[83] ybuf[doplasma::ii#3] = doplasma::$1
[84] doplasma::c1a#2 = doplasma::c1a#3 + 4
[85] doplasma::c1b#2 = doplasma::c1b#3 + 9
[86] doplasma::ii#2 = ++ doplasma::ii#3
to:doplasma::@1
unsigned int rand()
rand: scope:[rand] from makechar::@6
[87] rand::$0 = rand_state << 7
[88] rand_state = rand_state ^ rand::$0
[89] rand::$1 = rand_state >> 9
[90] rand_state = rand_state ^ rand::$1
[91] rand::$2 = rand_state << 8
[92] rand_state = rand_state ^ rand::$2
[93] rand::return#0 = rand_state
to:rand::@return
rand::@return: scope:[rand] from rand
[94] return
to:@return
void print_uint(unsigned int w)
print_uint: scope:[print_uint] from end::@1
[95] print_uchar::b#0 = byte1 print_uint::w#0
[96] call print_uchar
to:print_uint::@1
print_uint::@1: scope:[print_uint] from print_uint
[97] print_uchar::b#1 = byte0 print_uint::w#0
[98] call print_uchar
to:print_uint::@return
print_uint::@return: scope:[print_uint] from print_uint::@1
[99] return
to:@return
void print_ln()
print_ln: scope:[print_ln] from end::@2
[100] phi()
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[101] print_line_cursor#9 = phi( print_ln/print_screen#0, print_ln::@1/print_line_cursor#0 )
[102] print_line_cursor#0 = print_line_cursor#9 + $28
[103] if(print_line_cursor#0<print_char_cursor#27) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[104] return
to:@return
void print_uchar(char b)
print_uchar: scope:[print_uchar] from print_uint print_uint::@1
[105] print_char_cursor#37 = phi( print_uint/print_screen#0, print_uint::@1/print_char_cursor#27 )
[105] print_uchar::b#2 = phi( print_uint/print_uchar::b#0, print_uint::@1/print_uchar::b#1 )
[106] print_uchar::$0 = print_uchar::b#2 >> 4
[107] print_char::ch#0 = print_hextab[print_uchar::$0]
[108] call print_char
to:print_uchar::@1
print_uchar::@1: scope:[print_uchar] from print_uchar
[109] print_uchar::$2 = print_uchar::b#2 & $f
[110] print_char::ch#1 = print_hextab[print_uchar::$2]
[111] call print_char
to:print_uchar::@return
print_uchar::@return: scope:[print_uchar] from print_uchar::@1
[112] return
to:@return
void print_char(char ch)
print_char: scope:[print_char] from print_uchar print_uchar::@1
[113] print_char_cursor#26 = phi( print_uchar/print_char_cursor#37, print_uchar::@1/print_char_cursor#27 )
[113] print_char::ch#2 = phi( print_uchar/print_char::ch#0, print_uchar::@1/print_char::ch#1 )
[114] *print_char_cursor#26 = print_char::ch#2
[115] print_char_cursor#27 = ++ print_char_cursor#26
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[116] return
to:@return
VARIABLE REGISTER WEIGHTS
unsigned int Ticks
unsigned int Ticks#0 // 101.0
unsigned int Ticks#1 // 202.0
void __start()
void doplasma(char *scrn)
char doplasma::$1 // 200002.0
char doplasma::$3 // 200002.0
char doplasma::$6 // 2000002.0
char doplasma::c1A
char doplasma::c1B
char doplasma::c1a
char doplasma::c1a#2 // 66667.33333333333
char doplasma::c1a#3 // 75000.75
char doplasma::c1b
char doplasma::c1b#2 // 100001.0
char doplasma::c1b#3 // 60000.600000000006
char doplasma::c2A
char doplasma::c2B
char doplasma::c2a
char doplasma::c2a#2 // 66667.33333333333
char doplasma::c2a#3 // 75000.75
char doplasma::c2b
char doplasma::c2b#2 // 100001.0
char doplasma::c2b#3 // 60000.600000000006
char doplasma::i
char doplasma::i#2 // 200002.0
char doplasma::i#3 // 66667.33333333333
char doplasma::ii
char doplasma::ii#2 // 200002.0
char doplasma::ii#3 // 66667.33333333333
char doplasma::j
char doplasma::j#2 // 2000002.0
char doplasma::j#3 // 1250001.25
char doplasma::jj
char doplasma::jj#2 // 200002.0
char doplasma::jj#3 // 162500.5
char *doplasma::scrn
char *doplasma::scrn#0 // 100001.0
char *doplasma::scrn#13 // 6666.733333333334
char *doplasma::scrn#6 // 185714.85714285713
void end()
__loadstore volatile unsigned int last_time // 17.652173913043477
int main()
char main::block
char main::block#1 // 2.5384615384615383
unsigned int main::count
unsigned int main::count#1 // 202.0
unsigned int main::count#2 // 43.285714285714285
int main::return
char main::tmp
char main::tmp#1 // 22.0
char main::v
char main::v#1 // 2.4444444444444446
void makechar()
char *makechar::$10 // 20002.0
unsigned int makechar::$3 // 200002.0
char makechar::$4 // 200002.0
unsigned int makechar::$7 // 20002.0
unsigned int makechar::$8 // 20002.0
char makechar::$9 // 2002.0
char makechar::b
char makechar::b#2 // 200002.0
char makechar::b#3 // 28182.181818181816
char makechar::b#7 // 150001.5
unsigned int makechar::c
unsigned int makechar::c#2 // 2002.0
unsigned int makechar::c#3 // 591.090909090909
char makechar::i
char makechar::i#2 // 20002.0
char makechar::i#3 // 2353.176470588235
char makechar::ii
char makechar::ii#2 // 200002.0
char makechar::ii#3 // 40000.4
char makechar::s
char makechar::s#1 // 5315.894736842105
void print_char(char ch)
char print_char::ch
char print_char::ch#0 // 20002.0
char print_char::ch#1 // 20002.0
char print_char::ch#2 // 120003.0
char *print_char_cursor
char *print_char_cursor#26 // 110002.0
char *print_char_cursor#27 // 7117.882352941177
char *print_char_cursor#37 // 3667.333333333333
char *print_line_cursor
char *print_line_cursor#0 // 15001.5
char *print_line_cursor#9 // 20002.0
void print_ln()
char *print_screen
void print_uchar(char b)
char print_uchar::$0 // 20002.0
char print_uchar::$2 // 20002.0
char print_uchar::b
char print_uchar::b#0 // 2002.0
char print_uchar::b#1 // 2002.0
char print_uchar::b#2 // 5501.0
void print_uint(unsigned int w)
unsigned int print_uint::w
unsigned int print_uint::w#0 // 701.0
unsigned int rand()
unsigned int rand::$0 // 2000002.0
unsigned int rand::$1 // 2000002.0
unsigned int rand::$2 // 2000002.0
unsigned int rand::return
unsigned int rand::return#0 // 366667.3333333334
unsigned int rand::return#2 // 200002.0
__loadstore volatile unsigned int rand_state // 277778.1111111111
void start()
Initial phi equivalence classes
[ main::count#2 main::count#1 ]
[ makechar::c#3 makechar::c#2 ]
[ makechar::i#3 makechar::i#2 ]
[ makechar::ii#3 makechar::ii#2 ]
[ makechar::b#3 makechar::b#7 makechar::b#2 ]
[ doplasma::ii#3 doplasma::ii#2 ]
[ doplasma::c1a#3 doplasma::c1a#2 ]
[ doplasma::c1b#3 doplasma::c1b#2 ]
[ doplasma::i#3 doplasma::i#2 ]
[ doplasma::c2a#3 doplasma::c2a#2 ]
[ doplasma::c2b#3 doplasma::c2b#2 ]
[ doplasma::jj#3 doplasma::jj#2 ]
[ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ]
[ doplasma::j#3 doplasma::j#2 ]
[ print_line_cursor#9 print_line_cursor#0 ]
[ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
[ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
[ print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ]
Added variable rand_state to live range equivalence class [ rand_state ]
Added variable last_time to live range equivalence class [ last_time ]
Added variable main::block#1 to live range equivalence class [ main::block#1 ]
Added variable main::tmp#1 to live range equivalence class [ main::tmp#1 ]
Added variable main::v#1 to live range equivalence class [ main::v#1 ]
Added variable makechar::$9 to live range equivalence class [ makechar::$9 ]
Added variable makechar::s#1 to live range equivalence class [ makechar::s#1 ]
Added variable makechar::$7 to live range equivalence class [ makechar::$7 ]
Added variable makechar::$8 to live range equivalence class [ makechar::$8 ]
Added variable makechar::$10 to live range equivalence class [ makechar::$10 ]
Added variable rand::return#2 to live range equivalence class [ rand::return#2 ]
Added variable makechar::$3 to live range equivalence class [ makechar::$3 ]
Added variable makechar::$4 to live range equivalence class [ makechar::$4 ]
Added variable Ticks#0 to live range equivalence class [ Ticks#0 ]
Added variable Ticks#1 to live range equivalence class [ Ticks#1 ]
Added variable print_uint::w#0 to live range equivalence class [ print_uint::w#0 ]
Added variable doplasma::$6 to live range equivalence class [ doplasma::$6 ]
Added variable doplasma::$3 to live range equivalence class [ doplasma::$3 ]
Added variable doplasma::$1 to live range equivalence class [ doplasma::$1 ]
Added variable rand::$0 to live range equivalence class [ rand::$0 ]
Added variable rand::$1 to live range equivalence class [ rand::$1 ]
Added variable rand::$2 to live range equivalence class [ rand::$2 ]
Added variable rand::return#0 to live range equivalence class [ rand::return#0 ]
Added variable print_uchar::$0 to live range equivalence class [ print_uchar::$0 ]
Added variable print_uchar::$2 to live range equivalence class [ print_uchar::$2 ]
Complete equivalence classes
[ main::count#2 main::count#1 ]
[ makechar::c#3 makechar::c#2 ]
[ makechar::i#3 makechar::i#2 ]
[ makechar::ii#3 makechar::ii#2 ]
[ makechar::b#3 makechar::b#7 makechar::b#2 ]
[ doplasma::ii#3 doplasma::ii#2 ]
[ doplasma::c1a#3 doplasma::c1a#2 ]
[ doplasma::c1b#3 doplasma::c1b#2 ]
[ doplasma::i#3 doplasma::i#2 ]
[ doplasma::c2a#3 doplasma::c2a#2 ]
[ doplasma::c2b#3 doplasma::c2b#2 ]
[ doplasma::jj#3 doplasma::jj#2 ]
[ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ]
[ doplasma::j#3 doplasma::j#2 ]
[ print_line_cursor#9 print_line_cursor#0 ]
[ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
[ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
[ print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ]
[ rand_state ]
[ last_time ]
[ main::block#1 ]
[ main::tmp#1 ]
[ main::v#1 ]
[ makechar::$9 ]
[ makechar::s#1 ]
[ makechar::$7 ]
[ makechar::$8 ]
[ makechar::$10 ]
[ rand::return#2 ]
[ makechar::$3 ]
[ makechar::$4 ]
[ Ticks#0 ]
[ Ticks#1 ]
[ print_uint::w#0 ]
[ doplasma::$6 ]
[ doplasma::$3 ]
[ doplasma::$1 ]
[ rand::$0 ]
[ rand::$1 ]
[ rand::$2 ]
[ rand::return#0 ]
[ print_uchar::$0 ]
[ print_uchar::$2 ]
Allocated zp[1]:2 [ doplasma::j#3 doplasma::j#2 ]
Allocated zp[1]:3 [ doplasma::$6 ]
Allocated zp[2]:4 [ rand::$0 ]
Allocated zp[2]:6 [ rand::$1 ]
Allocated zp[2]:8 [ rand::$2 ]
Allocated zp[1]:10 [ makechar::b#3 makechar::b#7 makechar::b#2 ]
Allocated zp[2]:11 [ rand::return#0 ]
Allocated zp[1]:13 [ doplasma::jj#3 doplasma::jj#2 ]
Allocated zp[2]:14 [ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ]
Allocated zp[2]:16 [ rand_state ]
Allocated zp[1]:18 [ doplasma::ii#3 doplasma::ii#2 ]
Allocated zp[1]:19 [ doplasma::i#3 doplasma::i#2 ]
Allocated zp[1]:20 [ makechar::ii#3 makechar::ii#2 ]
Allocated zp[2]:21 [ rand::return#2 ]
Allocated zp[2]:23 [ makechar::$3 ]
Allocated zp[1]:25 [ makechar::$4 ]
Allocated zp[1]:26 [ doplasma::$3 ]
Allocated zp[1]:27 [ doplasma::$1 ]
Allocated zp[1]:28 [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
Allocated zp[1]:29 [ doplasma::c1b#3 doplasma::c1b#2 ]
Allocated zp[1]:30 [ doplasma::c2b#3 doplasma::c2b#2 ]
Allocated zp[1]:31 [ doplasma::c1a#3 doplasma::c1a#2 ]
Allocated zp[1]:32 [ doplasma::c2a#3 doplasma::c2a#2 ]
Allocated zp[2]:33 [ print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ]
Allocated zp[2]:35 [ print_line_cursor#9 print_line_cursor#0 ]
Allocated zp[1]:37 [ makechar::i#3 makechar::i#2 ]
Allocated zp[2]:38 [ makechar::$7 ]
Allocated zp[2]:40 [ makechar::$8 ]
Allocated zp[2]:42 [ makechar::$10 ]
Allocated zp[1]:44 [ print_uchar::$0 ]
Allocated zp[1]:45 [ print_uchar::$2 ]
Allocated zp[1]:46 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Allocated zp[1]:47 [ makechar::s#1 ]
Allocated zp[2]:48 [ makechar::c#3 makechar::c#2 ]
Allocated zp[1]:50 [ makechar::$9 ]
Allocated zp[2]:51 [ print_uint::w#0 ]
Allocated zp[2]:53 [ main::count#2 main::count#1 ]
Allocated zp[2]:55 [ Ticks#1 ]
Allocated zp[2]:57 [ Ticks#0 ]
Allocated zp[1]:59 [ main::tmp#1 ]
Allocated zp[2]:60 [ last_time ]
Allocated zp[1]:62 [ main::block#1 ]
Allocated zp[1]:63 [ main::v#1 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] rand_state = 1 [ rand_state ] ( [ rand_state ] { } ) always clobbers reg byte a
Statement [2] last_time = 0 [ rand_state last_time ] ( [ rand_state last_time ] { } ) always clobbers reg byte a
Statement [15] if(0!=main::count#2) goto main::@2 [ last_time main::block#1 main::v#1 main::count#2 ] ( main:4 [ last_time main::block#1 main::v#1 main::count#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:62 [ main::block#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:63 [ main::v#1 ]
Statement [22] *VICII_MEMORY = PAGE1 [ last_time main::block#1 main::v#1 main::count#2 ] ( main:4 [ last_time main::block#1 main::v#1 main::count#2 ] { } ) always clobbers reg byte a
Statement [24] *VICII_MEMORY = PAGE2 [ last_time main::block#1 main::v#1 main::count#2 ] ( main:4 [ last_time main::block#1 main::v#1 main::count#2 ] { } ) always clobbers reg byte a
Statement [25] main::count#1 = -- main::count#2 [ last_time main::block#1 main::v#1 main::count#1 ] ( main:4 [ last_time main::block#1 main::v#1 main::count#1 ] { } ) always clobbers reg byte a
Statement [28] if(makechar::c#3<$100) goto makechar::@2 [ rand_state makechar::c#3 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 ] { } ) always clobbers reg byte a
Statement [37] makechar::$7 = makechar::c#3 << 3 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$7 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$7 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:47 [ makechar::s#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:37 [ makechar::i#3 makechar::i#2 ]
Removing always clobbered register reg byte a as potential for zp[1]:10 [ makechar::b#3 makechar::b#7 makechar::b#2 ]
Statement [38] makechar::$8 = makechar::$7 + makechar::i#3 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$8 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$8 ] { } ) always clobbers reg byte a
Statement [39] makechar::$10 = CHARSET + makechar::$8 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$10 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$10 ] { } ) always clobbers reg byte a
Statement [40] *makechar::$10 = makechar::b#3 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 ] { } ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:47 [ makechar::s#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:37 [ makechar::i#3 makechar::i#2 ]
Statement [44] rand::return#2 = rand::return#0 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand::return#2 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand::return#2 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:20 [ makechar::ii#3 makechar::ii#2 ]
Statement [45] makechar::$3 = rand::return#2 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 makechar::$3 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 makechar::$3 ] { } ) always clobbers reg byte a
Statement [46] makechar::$4 = makechar::$3 & $ff [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 makechar::$4 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 makechar::$4 ] { } ) always clobbers reg byte a
Statement [48] makechar::b#2 = makechar::b#3 | bittab[makechar::ii#3] [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#2 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#2 ] { } ) always clobbers reg byte a
Statement asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 } always clobbers reg byte a reg byte x reg byte y
Statement [53] Ticks#0 = last_time [ last_time Ticks#0 ] ( main:4::end:18 [ last_time Ticks#0 ] { } ) always clobbers reg byte a
Statement [55] last_time = last_time - Ticks#0 [ last_time ] ( main:4::end:18 [ last_time ] { { Ticks#1 = print_uint::w#0 } } ) always clobbers reg byte a
Statement [56] Ticks#1 = last_time [ Ticks#1 ] ( main:4::end:18 [ Ticks#1 ] { { Ticks#1 = print_uint::w#0 } } ) always clobbers reg byte a
Statement [57] print_uint::w#0 = Ticks#1 [ print_uint::w#0 ] ( main:4::end:18 [ print_uint::w#0 ] { { Ticks#1 = print_uint::w#0 } } ) always clobbers reg byte a
Statement [72] doplasma::scrn#0 = doplasma::scrn#6 + $28 [ doplasma::jj#3 doplasma::scrn#0 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::jj#3 doplasma::scrn#0 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::jj#3 doplasma::scrn#0 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:13 [ doplasma::jj#3 doplasma::jj#2 ]
Statement [74] doplasma::$6 = xbuf[doplasma::j#3] + ybuf[doplasma::jj#3] [ doplasma::jj#3 doplasma::scrn#6 doplasma::j#3 doplasma::$6 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::jj#3 doplasma::scrn#6 doplasma::j#3 doplasma::$6 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::jj#3 doplasma::scrn#6 doplasma::j#3 doplasma::$6 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ doplasma::j#3 doplasma::j#2 ]
Statement [77] doplasma::$3 = sinetable[doplasma::c2a#3] + sinetable[doplasma::c2b#3] [ doplasma::scrn#13 doplasma::i#3 doplasma::c2a#3 doplasma::c2b#3 doplasma::$3 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2a#3 doplasma::c2b#3 doplasma::$3 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2a#3 doplasma::c2b#3 doplasma::$3 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:19 [ doplasma::i#3 doplasma::i#2 ]
Removing always clobbered register reg byte a as potential for zp[1]:32 [ doplasma::c2a#3 doplasma::c2a#2 ]
Removing always clobbered register reg byte a as potential for zp[1]:30 [ doplasma::c2b#3 doplasma::c2b#2 ]
Statement [79] doplasma::c2a#2 = doplasma::c2a#3 + 3 [ doplasma::scrn#13 doplasma::i#3 doplasma::c2b#3 doplasma::c2a#2 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2b#3 doplasma::c2a#2 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2b#3 doplasma::c2a#2 ] { } ) always clobbers reg byte a
Statement [80] doplasma::c2b#2 = doplasma::c2b#3 + 7 [ doplasma::scrn#13 doplasma::i#3 doplasma::c2a#2 doplasma::c2b#2 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2a#2 doplasma::c2b#2 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2a#2 doplasma::c2b#2 ] { } ) always clobbers reg byte a
Statement [82] doplasma::$1 = sinetable[doplasma::c1a#3] + sinetable[doplasma::c1b#3] [ doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#3 doplasma::c1b#3 doplasma::$1 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#3 doplasma::c1b#3 doplasma::$1 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#3 doplasma::c1b#3 doplasma::$1 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:18 [ doplasma::ii#3 doplasma::ii#2 ]
Removing always clobbered register reg byte a as potential for zp[1]:31 [ doplasma::c1a#3 doplasma::c1a#2 ]
Removing always clobbered register reg byte a as potential for zp[1]:29 [ doplasma::c1b#3 doplasma::c1b#2 ]
Statement [84] doplasma::c1a#2 = doplasma::c1a#3 + 4 [ doplasma::scrn#13 doplasma::ii#3 doplasma::c1b#3 doplasma::c1a#2 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1b#3 doplasma::c1a#2 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1b#3 doplasma::c1a#2 ] { } ) always clobbers reg byte a
Statement [85] doplasma::c1b#2 = doplasma::c1b#3 + 9 [ doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#2 doplasma::c1b#2 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#2 doplasma::c1b#2 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#2 doplasma::c1b#2 ] { } ) always clobbers reg byte a
Statement [87] rand::$0 = rand_state << 7 [ rand_state rand::$0 ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state rand::$0 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [88] rand_state = rand_state ^ rand::$0 [ rand_state ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [89] rand::$1 = rand_state >> 9 [ rand_state rand::$1 ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state rand::$1 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [90] rand_state = rand_state ^ rand::$1 [ rand_state ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [91] rand::$2 = rand_state << 8 [ rand_state rand::$2 ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state rand::$2 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [92] rand_state = rand_state ^ rand::$2 [ rand_state ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [93] rand::return#0 = rand_state [ rand_state rand::return#0 ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state rand::return#0 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [102] print_line_cursor#0 = print_line_cursor#9 + $28 [ print_line_cursor#0 print_char_cursor#27 ] ( main:4::end:18::print_ln:60 [ print_line_cursor#0 print_char_cursor#27 ] { } ) always clobbers reg byte a
Statement [103] if(print_line_cursor#0<print_char_cursor#27) goto print_ln::@1 [ print_line_cursor#0 print_char_cursor#27 ] ( main:4::end:18::print_ln:60 [ print_line_cursor#0 print_char_cursor#27 ] { } ) always clobbers reg byte a
Statement [106] print_uchar::$0 = print_uchar::b#2 >> 4 [ print_uchar::b#2 print_char_cursor#37 print_uchar::$0 ] ( main:4::end:18::print_uint:58::print_uchar:96 [ print_uint::w#0 print_uchar::b#2 print_char_cursor#37 print_uchar::$0 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#2 } { print_char_cursor#26 = print_char_cursor#37 } } main:4::end:18::print_uint:58::print_uchar:98 [ print_uchar::b#2 print_char_cursor#37 print_uchar::$0 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#26 = print_char_cursor#37 print_char_cursor#27 } { print_char::ch#0 = print_char::ch#2 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:46 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Statement [109] print_uchar::$2 = print_uchar::b#2 & $f [ print_char_cursor#27 print_uchar::$2 ] ( main:4::end:18::print_uint:58::print_uchar:96 [ print_uint::w#0 print_char_cursor#27 print_uchar::$2 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#2 } { print_char_cursor#26 = print_char_cursor#27 } } main:4::end:18::print_uint:58::print_uchar:98 [ print_char_cursor#27 print_uchar::$2 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#26 = print_char_cursor#37 print_char_cursor#27 } { print_char::ch#1 = print_char::ch#2 } } ) always clobbers reg byte a
Statement [114] *print_char_cursor#26 = print_char::ch#2 [ print_char_cursor#26 ] ( main:4::end:18::print_uint:58::print_uchar:96::print_char:108 [ print_uint::w#0 print_uchar::b#2 print_char_cursor#26 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#2 } { print_char_cursor#26 = print_char_cursor#37 } } main:4::end:18::print_uint:58::print_uchar:98::print_char:108 [ print_uchar::b#2 print_char_cursor#26 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#26 = print_char_cursor#37 print_char_cursor#27 } { print_char::ch#0 = print_char::ch#2 } } main:4::end:18::print_uint:58::print_uchar:96::print_char:111 [ print_uint::w#0 print_char_cursor#26 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#2 } { print_char_cursor#26 = print_char_cursor#27 } } main:4::end:18::print_uint:58::print_uchar:98::print_char:111 [ print_char_cursor#26 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#26 = print_char_cursor#37 print_char_cursor#27 } { print_char::ch#1 = print_char::ch#2 } } ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:46 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Statement [1] rand_state = 1 [ rand_state ] ( [ rand_state ] { } ) always clobbers reg byte a
Statement [2] last_time = 0 [ rand_state last_time ] ( [ rand_state last_time ] { } ) always clobbers reg byte a
Statement [11] main::tmp#1 = main::block#1 & $fc [ last_time main::block#1 main::tmp#1 ] ( main:4 [ last_time main::block#1 main::tmp#1 ] { } ) always clobbers reg byte a
Statement [15] if(0!=main::count#2) goto main::@2 [ last_time main::block#1 main::v#1 main::count#2 ] ( main:4 [ last_time main::block#1 main::v#1 main::count#2 ] { } ) always clobbers reg byte a
Statement [22] *VICII_MEMORY = PAGE1 [ last_time main::block#1 main::v#1 main::count#2 ] ( main:4 [ last_time main::block#1 main::v#1 main::count#2 ] { } ) always clobbers reg byte a
Statement [24] *VICII_MEMORY = PAGE2 [ last_time main::block#1 main::v#1 main::count#2 ] ( main:4 [ last_time main::block#1 main::v#1 main::count#2 ] { } ) always clobbers reg byte a
Statement [25] main::count#1 = -- main::count#2 [ last_time main::block#1 main::v#1 main::count#1 ] ( main:4 [ last_time main::block#1 main::v#1 main::count#1 ] { } ) always clobbers reg byte a
Statement [28] if(makechar::c#3<$100) goto makechar::@2 [ rand_state makechar::c#3 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 ] { } ) always clobbers reg byte a
Statement [37] makechar::$7 = makechar::c#3 << 3 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$7 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$7 ] { } ) always clobbers reg byte a
Statement [38] makechar::$8 = makechar::$7 + makechar::i#3 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$8 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$8 ] { } ) always clobbers reg byte a
Statement [39] makechar::$10 = CHARSET + makechar::$8 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$10 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::b#3 makechar::$10 ] { } ) always clobbers reg byte a
Statement [40] *makechar::$10 = makechar::b#3 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 ] { } ) always clobbers reg byte a reg byte y
Statement [44] rand::return#2 = rand::return#0 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand::return#2 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand::return#2 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [45] makechar::$3 = rand::return#2 [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 makechar::$3 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 makechar::$3 ] { } ) always clobbers reg byte a
Statement [46] makechar::$4 = makechar::$3 & $ff [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 makechar::$4 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 makechar::$4 ] { } ) always clobbers reg byte a
Statement [48] makechar::b#2 = makechar::b#3 | bittab[makechar::ii#3] [ rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#2 ] ( main:4::makechar:7 [ last_time rand_state makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#2 ] { } ) always clobbers reg byte a
Statement asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 } always clobbers reg byte a reg byte x reg byte y
Statement [53] Ticks#0 = last_time [ last_time Ticks#0 ] ( main:4::end:18 [ last_time Ticks#0 ] { } ) always clobbers reg byte a
Statement [55] last_time = last_time - Ticks#0 [ last_time ] ( main:4::end:18 [ last_time ] { { Ticks#1 = print_uint::w#0 } } ) always clobbers reg byte a
Statement [56] Ticks#1 = last_time [ Ticks#1 ] ( main:4::end:18 [ Ticks#1 ] { { Ticks#1 = print_uint::w#0 } } ) always clobbers reg byte a
Statement [57] print_uint::w#0 = Ticks#1 [ print_uint::w#0 ] ( main:4::end:18 [ print_uint::w#0 ] { { Ticks#1 = print_uint::w#0 } } ) always clobbers reg byte a
Statement [72] doplasma::scrn#0 = doplasma::scrn#6 + $28 [ doplasma::jj#3 doplasma::scrn#0 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::jj#3 doplasma::scrn#0 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::jj#3 doplasma::scrn#0 ] { } ) always clobbers reg byte a
Statement [74] doplasma::$6 = xbuf[doplasma::j#3] + ybuf[doplasma::jj#3] [ doplasma::jj#3 doplasma::scrn#6 doplasma::j#3 doplasma::$6 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::jj#3 doplasma::scrn#6 doplasma::j#3 doplasma::$6 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::jj#3 doplasma::scrn#6 doplasma::j#3 doplasma::$6 ] { } ) always clobbers reg byte a
Statement [77] doplasma::$3 = sinetable[doplasma::c2a#3] + sinetable[doplasma::c2b#3] [ doplasma::scrn#13 doplasma::i#3 doplasma::c2a#3 doplasma::c2b#3 doplasma::$3 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2a#3 doplasma::c2b#3 doplasma::$3 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2a#3 doplasma::c2b#3 doplasma::$3 ] { } ) always clobbers reg byte a
Statement [79] doplasma::c2a#2 = doplasma::c2a#3 + 3 [ doplasma::scrn#13 doplasma::i#3 doplasma::c2b#3 doplasma::c2a#2 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2b#3 doplasma::c2a#2 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2b#3 doplasma::c2a#2 ] { } ) always clobbers reg byte a
Statement [80] doplasma::c2b#2 = doplasma::c2b#3 + 7 [ doplasma::scrn#13 doplasma::i#3 doplasma::c2a#2 doplasma::c2b#2 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2a#2 doplasma::c2b#2 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::i#3 doplasma::c2a#2 doplasma::c2b#2 ] { } ) always clobbers reg byte a
Statement [82] doplasma::$1 = sinetable[doplasma::c1a#3] + sinetable[doplasma::c1b#3] [ doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#3 doplasma::c1b#3 doplasma::$1 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#3 doplasma::c1b#3 doplasma::$1 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#3 doplasma::c1b#3 doplasma::$1 ] { } ) always clobbers reg byte a
Statement [84] doplasma::c1a#2 = doplasma::c1a#3 + 4 [ doplasma::scrn#13 doplasma::ii#3 doplasma::c1b#3 doplasma::c1a#2 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1b#3 doplasma::c1a#2 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1b#3 doplasma::c1a#2 ] { } ) always clobbers reg byte a
Statement [85] doplasma::c1b#2 = doplasma::c1b#3 + 9 [ doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#2 doplasma::c1b#2 ] ( main:4::doplasma:21 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#2 doplasma::c1b#2 ] { } main:4::doplasma:23 [ last_time main::block#1 main::v#1 main::count#2 doplasma::scrn#13 doplasma::ii#3 doplasma::c1a#2 doplasma::c1b#2 ] { } ) always clobbers reg byte a
Statement [87] rand::$0 = rand_state << 7 [ rand_state rand::$0 ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state rand::$0 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [88] rand_state = rand_state ^ rand::$0 [ rand_state ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [89] rand::$1 = rand_state >> 9 [ rand_state rand::$1 ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state rand::$1 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [90] rand_state = rand_state ^ rand::$1 [ rand_state ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [91] rand::$2 = rand_state << 8 [ rand_state rand::$2 ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state rand::$2 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [92] rand_state = rand_state ^ rand::$2 [ rand_state ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [93] rand::return#0 = rand_state [ rand_state rand::return#0 ] ( main:4::makechar:7::rand:43 [ last_time makechar::c#3 makechar::s#1 makechar::i#3 makechar::ii#3 makechar::b#3 rand_state rand::return#0 ] { { rand::return#0 = rand::return#2 } } ) always clobbers reg byte a
Statement [102] print_line_cursor#0 = print_line_cursor#9 + $28 [ print_line_cursor#0 print_char_cursor#27 ] ( main:4::end:18::print_ln:60 [ print_line_cursor#0 print_char_cursor#27 ] { } ) always clobbers reg byte a
Statement [103] if(print_line_cursor#0<print_char_cursor#27) goto print_ln::@1 [ print_line_cursor#0 print_char_cursor#27 ] ( main:4::end:18::print_ln:60 [ print_line_cursor#0 print_char_cursor#27 ] { } ) always clobbers reg byte a
Statement [106] print_uchar::$0 = print_uchar::b#2 >> 4 [ print_uchar::b#2 print_char_cursor#37 print_uchar::$0 ] ( main:4::end:18::print_uint:58::print_uchar:96 [ print_uint::w#0 print_uchar::b#2 print_char_cursor#37 print_uchar::$0 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#2 } { print_char_cursor#26 = print_char_cursor#37 } } main:4::end:18::print_uint:58::print_uchar:98 [ print_uchar::b#2 print_char_cursor#37 print_uchar::$0 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#26 = print_char_cursor#37 print_char_cursor#27 } { print_char::ch#0 = print_char::ch#2 } } ) always clobbers reg byte a
Statement [109] print_uchar::$2 = print_uchar::b#2 & $f [ print_char_cursor#27 print_uchar::$2 ] ( main:4::end:18::print_uint:58::print_uchar:96 [ print_uint::w#0 print_char_cursor#27 print_uchar::$2 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#2 } { print_char_cursor#26 = print_char_cursor#27 } } main:4::end:18::print_uint:58::print_uchar:98 [ print_char_cursor#27 print_uchar::$2 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#26 = print_char_cursor#37 print_char_cursor#27 } { print_char::ch#1 = print_char::ch#2 } } ) always clobbers reg byte a
Statement [114] *print_char_cursor#26 = print_char::ch#2 [ print_char_cursor#26 ] ( main:4::end:18::print_uint:58::print_uchar:96::print_char:108 [ print_uint::w#0 print_uchar::b#2 print_char_cursor#26 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#0 = print_char::ch#2 } { print_char_cursor#26 = print_char_cursor#37 } } main:4::end:18::print_uint:58::print_uchar:98::print_char:108 [ print_uchar::b#2 print_char_cursor#26 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#26 = print_char_cursor#37 print_char_cursor#27 } { print_char::ch#0 = print_char::ch#2 } } main:4::end:18::print_uint:58::print_uchar:96::print_char:111 [ print_uint::w#0 print_char_cursor#26 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#0 = print_uchar::b#2 } { print_char::ch#1 = print_char::ch#2 } { print_char_cursor#26 = print_char_cursor#27 } } main:4::end:18::print_uint:58::print_uchar:98::print_char:111 [ print_char_cursor#26 ] { { Ticks#1 = print_uint::w#0 } { print_uchar::b#1 = print_uchar::b#2 } { print_char_cursor#26 = print_char_cursor#37 print_char_cursor#27 } { print_char::ch#1 = print_char::ch#2 } } ) always clobbers reg byte y
Potential registers zp[2]:53 [ main::count#2 main::count#1 ] : zp[2]:53 ,
Potential registers zp[2]:48 [ makechar::c#3 makechar::c#2 ] : zp[2]:48 ,
Potential registers zp[1]:37 [ makechar::i#3 makechar::i#2 ] : zp[1]:37 , reg byte x ,
Potential registers zp[1]:20 [ makechar::ii#3 makechar::ii#2 ] : zp[1]:20 , reg byte x , reg byte y ,
Potential registers zp[1]:10 [ makechar::b#3 makechar::b#7 makechar::b#2 ] : zp[1]:10 , reg byte x , reg byte y ,
Potential registers zp[1]:18 [ doplasma::ii#3 doplasma::ii#2 ] : zp[1]:18 , reg byte x , reg byte y ,
Potential registers zp[1]:31 [ doplasma::c1a#3 doplasma::c1a#2 ] : zp[1]:31 , reg byte x , reg byte y ,
Potential registers zp[1]:29 [ doplasma::c1b#3 doplasma::c1b#2 ] : zp[1]:29 , reg byte x , reg byte y ,
Potential registers zp[1]:19 [ doplasma::i#3 doplasma::i#2 ] : zp[1]:19 , reg byte x , reg byte y ,
Potential registers zp[1]:32 [ doplasma::c2a#3 doplasma::c2a#2 ] : zp[1]:32 , reg byte x , reg byte y ,
Potential registers zp[1]:30 [ doplasma::c2b#3 doplasma::c2b#2 ] : zp[1]:30 , reg byte x , reg byte y ,
Potential registers zp[1]:13 [ doplasma::jj#3 doplasma::jj#2 ] : zp[1]:13 , reg byte x , reg byte y ,
Potential registers zp[2]:14 [ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ] : zp[2]:14 ,
Potential registers zp[1]:2 [ doplasma::j#3 doplasma::j#2 ] : zp[1]:2 , reg byte x , reg byte y ,
Potential registers zp[2]:35 [ print_line_cursor#9 print_line_cursor#0 ] : zp[2]:35 ,
Potential registers zp[1]:46 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ] : zp[1]:46 , reg byte x ,
Potential registers zp[1]:28 [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ] : zp[1]:28 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[2]:33 [ print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ] : zp[2]:33 ,
Potential registers zp[2]:16 [ rand_state ] : zp[2]:16 ,
Potential registers zp[2]:60 [ last_time ] : zp[2]:60 ,
Potential registers zp[1]:62 [ main::block#1 ] : zp[1]:62 , reg byte x , reg byte y ,
Potential registers zp[1]:59 [ main::tmp#1 ] : zp[1]:59 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:63 [ main::v#1 ] : zp[1]:63 , reg byte x , reg byte y ,
Potential registers zp[1]:50 [ makechar::$9 ] : zp[1]:50 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:47 [ makechar::s#1 ] : zp[1]:47 , reg byte x ,
Potential registers zp[2]:38 [ makechar::$7 ] : zp[2]:38 ,
Potential registers zp[2]:40 [ makechar::$8 ] : zp[2]:40 ,
Potential registers zp[2]:42 [ makechar::$10 ] : zp[2]:42 ,
Potential registers zp[2]:21 [ rand::return#2 ] : zp[2]:21 ,
Potential registers zp[2]:23 [ makechar::$3 ] : zp[2]:23 ,
Potential registers zp[1]:25 [ makechar::$4 ] : zp[1]:25 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[2]:57 [ Ticks#0 ] : zp[2]:57 ,
Potential registers zp[2]:55 [ Ticks#1 ] : zp[2]:55 ,
Potential registers zp[2]:51 [ print_uint::w#0 ] : zp[2]:51 ,
Potential registers zp[1]:3 [ doplasma::$6 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:26 [ doplasma::$3 ] : zp[1]:26 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:27 [ doplasma::$1 ] : zp[1]:27 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[2]:4 [ rand::$0 ] : zp[2]:4 ,
Potential registers zp[2]:6 [ rand::$1 ] : zp[2]:6 ,
Potential registers zp[2]:8 [ rand::$2 ] : zp[2]:8 ,
Potential registers zp[2]:11 [ rand::return#0 ] : zp[2]:11 ,
Potential registers zp[1]:44 [ print_uchar::$0 ] : zp[1]:44 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:45 [ print_uchar::$2 ] : zp[1]:45 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [doplasma] 3,250,003.25: zp[1]:2 [ doplasma::j#3 doplasma::j#2 ] 2,000,002: zp[1]:3 [ doplasma::$6 ] 362,502.5: zp[1]:13 [ doplasma::jj#3 doplasma::jj#2 ] 292,382.59: zp[2]:14 [ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ] 266,669.33: zp[1]:18 [ doplasma::ii#3 doplasma::ii#2 ] 266,669.33: zp[1]:19 [ doplasma::i#3 doplasma::i#2 ] 200,002: zp[1]:26 [ doplasma::$3 ] 200,002: zp[1]:27 [ doplasma::$1 ] 160,001.6: zp[1]:29 [ doplasma::c1b#3 doplasma::c1b#2 ] 160,001.6: zp[1]:30 [ doplasma::c2b#3 doplasma::c2b#2 ] 141,668.08: zp[1]:31 [ doplasma::c1a#3 doplasma::c1a#2 ] 141,668.08: zp[1]:32 [ doplasma::c2a#3 doplasma::c2a#2 ]
Uplift Scope [rand] 2,000,002: zp[2]:4 [ rand::$0 ] 2,000,002: zp[2]:6 [ rand::$1 ] 2,000,002: zp[2]:8 [ rand::$2 ] 366,667.33: zp[2]:11 [ rand::return#0 ] 200,002: zp[2]:21 [ rand::return#2 ]
Uplift Scope [makechar] 378,185.68: zp[1]:10 [ makechar::b#3 makechar::b#7 makechar::b#2 ] 240,002.4: zp[1]:20 [ makechar::ii#3 makechar::ii#2 ] 200,002: zp[2]:23 [ makechar::$3 ] 200,002: zp[1]:25 [ makechar::$4 ] 22,355.18: zp[1]:37 [ makechar::i#3 makechar::i#2 ] 20,002: zp[2]:38 [ makechar::$7 ] 20,002: zp[2]:40 [ makechar::$8 ] 20,002: zp[2]:42 [ makechar::$10 ] 5,315.89: zp[1]:47 [ makechar::s#1 ] 2,593.09: zp[2]:48 [ makechar::c#3 makechar::c#2 ] 2,002: zp[1]:50 [ makechar::$9 ]
Uplift Scope [] 277,778.11: zp[2]:16 [ rand_state ] 120,787.22: zp[2]:33 [ print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ] 35,003.5: zp[2]:35 [ print_line_cursor#9 print_line_cursor#0 ] 202: zp[2]:55 [ Ticks#1 ] 101: zp[2]:57 [ Ticks#0 ] 17.65: zp[2]:60 [ last_time ]
Uplift Scope [print_char] 160,007: zp[1]:28 [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
Uplift Scope [print_uchar] 20,002: zp[1]:44 [ print_uchar::$0 ] 20,002: zp[1]:45 [ print_uchar::$2 ] 9,505: zp[1]:46 [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Uplift Scope [print_uint] 701: zp[2]:51 [ print_uint::w#0 ]
Uplift Scope [main] 245.29: zp[2]:53 [ main::count#2 main::count#1 ] 22: zp[1]:59 [ main::tmp#1 ] 2.54: zp[1]:62 [ main::block#1 ] 2.44: zp[1]:63 [ main::v#1 ]
Uplift Scope [print_ln]
Uplift Scope [RADIX]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [start]
Uplift Scope [end]
Uplift Scope [__start]
Uplifting [doplasma] best 171020 combination reg byte y [ doplasma::j#3 doplasma::j#2 ] reg byte a [ doplasma::$6 ] reg byte x [ doplasma::jj#3 doplasma::jj#2 ] zp[2]:14 [ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ] zp[1]:18 [ doplasma::ii#3 doplasma::ii#2 ] zp[1]:19 [ doplasma::i#3 doplasma::i#2 ] zp[1]:26 [ doplasma::$3 ] zp[1]:27 [ doplasma::$1 ] zp[1]:29 [ doplasma::c1b#3 doplasma::c1b#2 ] zp[1]:30 [ doplasma::c2b#3 doplasma::c2b#2 ] zp[1]:31 [ doplasma::c1a#3 doplasma::c1a#2 ] zp[1]:32 [ doplasma::c2a#3 doplasma::c2a#2 ]
Limited combination testing to 100 combinations of 419904 possible.
Uplifting [rand] best 171020 combination zp[2]:4 [ rand::$0 ] zp[2]:6 [ rand::$1 ] zp[2]:8 [ rand::$2 ] zp[2]:11 [ rand::return#0 ] zp[2]:21 [ rand::return#2 ]
Uplifting [makechar] best 153920 combination reg byte y [ makechar::b#3 makechar::b#7 makechar::b#2 ] reg byte x [ makechar::ii#3 makechar::ii#2 ] zp[2]:23 [ makechar::$3 ] zp[1]:25 [ makechar::$4 ] zp[1]:37 [ makechar::i#3 makechar::i#2 ] zp[2]:38 [ makechar::$7 ] zp[2]:40 [ makechar::$8 ] zp[2]:42 [ makechar::$10 ] zp[1]:47 [ makechar::s#1 ] zp[2]:48 [ makechar::c#3 makechar::c#2 ] zp[1]:50 [ makechar::$9 ]
Limited combination testing to 100 combinations of 576 possible.
Uplifting [] best 153920 combination zp[2]:16 [ rand_state ] zp[2]:33 [ print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ] zp[2]:35 [ print_line_cursor#9 print_line_cursor#0 ] zp[2]:55 [ Ticks#1 ] zp[2]:57 [ Ticks#0 ] zp[2]:60 [ last_time ]
Uplifting [print_char] best 153911 combination reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
Uplifting [print_uchar] best 153893 combination reg byte a [ print_uchar::$0 ] reg byte x [ print_uchar::$2 ] reg byte x [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
Uplifting [print_uint] best 153893 combination zp[2]:51 [ print_uint::w#0 ]
Uplifting [main] best 153887 combination zp[2]:53 [ main::count#2 main::count#1 ] reg byte a [ main::tmp#1 ] zp[1]:62 [ main::block#1 ] zp[1]:63 [ main::v#1 ]
Uplifting [print_ln] best 153887 combination
Uplifting [RADIX] best 153887 combination
Uplifting [MOS6526_CIA] best 153887 combination
Uplifting [MOS6569_VICII] best 153887 combination
Uplifting [MOS6581_SID] best 153887 combination
Uplifting [start] best 153887 combination
Uplifting [end] best 153887 combination
Uplifting [__start] best 153887 combination
Attempting to uplift remaining variables inzp[1]:18 [ doplasma::ii#3 doplasma::ii#2 ]
Uplifting [doplasma] best 153887 combination zp[1]:18 [ doplasma::ii#3 doplasma::ii#2 ]
Attempting to uplift remaining variables inzp[1]:19 [ doplasma::i#3 doplasma::i#2 ]
Uplifting [doplasma] best 153887 combination zp[1]:19 [ doplasma::i#3 doplasma::i#2 ]
Attempting to uplift remaining variables inzp[1]:25 [ makechar::$4 ]
Uplifting [makechar] best 153887 combination zp[1]:25 [ makechar::$4 ]
Attempting to uplift remaining variables inzp[1]:26 [ doplasma::$3 ]
Uplifting [doplasma] best 153287 combination reg byte a [ doplasma::$3 ]
Attempting to uplift remaining variables inzp[1]:27 [ doplasma::$1 ]
Uplifting [doplasma] best 152687 combination reg byte a [ doplasma::$1 ]
Attempting to uplift remaining variables inzp[1]:29 [ doplasma::c1b#3 doplasma::c1b#2 ]
Uplifting [doplasma] best 152687 combination zp[1]:29 [ doplasma::c1b#3 doplasma::c1b#2 ]
Attempting to uplift remaining variables inzp[1]:30 [ doplasma::c2b#3 doplasma::c2b#2 ]
Uplifting [doplasma] best 152687 combination zp[1]:30 [ doplasma::c2b#3 doplasma::c2b#2 ]
Attempting to uplift remaining variables inzp[1]:31 [ doplasma::c1a#3 doplasma::c1a#2 ]
Uplifting [doplasma] best 152687 combination zp[1]:31 [ doplasma::c1a#3 doplasma::c1a#2 ]
Attempting to uplift remaining variables inzp[1]:32 [ doplasma::c2a#3 doplasma::c2a#2 ]
Uplifting [doplasma] best 152687 combination zp[1]:32 [ doplasma::c2a#3 doplasma::c2a#2 ]
Attempting to uplift remaining variables inzp[1]:37 [ makechar::i#3 makechar::i#2 ]
Uplifting [makechar] best 152687 combination zp[1]:37 [ makechar::i#3 makechar::i#2 ]
Attempting to uplift remaining variables inzp[1]:47 [ makechar::s#1 ]
Uplifting [makechar] best 152687 combination zp[1]:47 [ makechar::s#1 ]
Attempting to uplift remaining variables inzp[1]:50 [ makechar::$9 ]
Uplifting [makechar] best 152627 combination reg byte x [ makechar::$9 ]
Attempting to uplift remaining variables inzp[1]:62 [ main::block#1 ]
Uplifting [main] best 152627 combination zp[1]:62 [ main::block#1 ]
Attempting to uplift remaining variables inzp[1]:63 [ main::v#1 ]
Uplifting [main] best 152627 combination zp[1]:63 [ main::v#1 ]
Coalescing zero page register [ zp[2]:38 [ makechar::$7 ] ] with [ zp[2]:40 [ makechar::$8 ] ] - score: 1
Coalescing zero page register [ zp[2]:21 [ rand::return#2 ] ] with [ zp[2]:23 [ makechar::$3 ] ] - score: 1
Coalescing zero page register [ zp[2]:21 [ rand::return#2 makechar::$3 ] ] with [ zp[2]:11 [ rand::return#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:55 [ Ticks#1 ] ] with [ zp[2]:51 [ print_uint::w#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:38 [ makechar::$7 makechar::$8 ] ] with [ zp[2]:42 [ makechar::$10 ] ] - score: 1
Coalescing zero page register [ zp[1]:18 [ doplasma::ii#3 doplasma::ii#2 ] ] with [ zp[1]:37 [ makechar::i#3 makechar::i#2 ] ]
Coalescing zero page register [ zp[2]:14 [ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 ] ] with [ zp[2]:48 [ makechar::c#3 makechar::c#2 ] ]
Coalescing zero page register [ zp[2]:35 [ print_line_cursor#9 print_line_cursor#0 ] ] with [ zp[2]:53 [ main::count#2 main::count#1 ] ]
Coalescing zero page register [ zp[1]:47 [ makechar::s#1 ] ] with [ zp[1]:31 [ doplasma::c1a#3 doplasma::c1a#2 ] ]
Coalescing zero page register [ zp[2]:38 [ makechar::$7 makechar::$8 makechar::$10 ] ] with [ zp[2]:33 [ print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ] ]
Coalescing zero page register [ zp[1]:25 [ makechar::$4 ] ] with [ zp[1]:29 [ doplasma::c1b#3 doplasma::c1b#2 ] ]
Coalescing zero page register [ zp[2]:57 [ Ticks#0 ] ] with [ zp[2]:21 [ rand::return#2 makechar::$3 rand::return#0 ] ]
Coalescing zero page register [ zp[2]:4 [ rand::$0 ] ] with [ zp[2]:55 [ Ticks#1 print_uint::w#0 ] ]
Allocated (was zp[2]:4) zp[2]:2 [ rand::$0 Ticks#1 print_uint::w#0 ]
Allocated (was zp[2]:6) zp[2]:4 [ rand::$1 ]
Allocated (was zp[2]:8) zp[2]:6 [ rand::$2 ]
Allocated (was zp[2]:57) zp[2]:8 [ Ticks#0 rand::return#2 makechar::$3 rand::return#0 ]
Allocated (was zp[1]:25) zp[1]:10 [ makechar::$4 doplasma::c1b#3 doplasma::c1b#2 ]
Allocated (was zp[2]:14) zp[2]:11 [ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 makechar::c#3 makechar::c#2 ]
Allocated (was zp[1]:18) zp[1]:13 [ doplasma::ii#3 doplasma::ii#2 makechar::i#3 makechar::i#2 ]
Allocated (was zp[2]:16) zp[2]:14 [ rand_state ]
Allocated (was zp[1]:19) zp[1]:16 [ doplasma::i#3 doplasma::i#2 ]
Allocated (was zp[2]:38) zp[2]:17 [ makechar::$7 makechar::$8 makechar::$10 print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ]
Allocated (was zp[1]:30) zp[1]:19 [ doplasma::c2b#3 doplasma::c2b#2 ]
Allocated (was zp[1]:47) zp[1]:20 [ makechar::s#1 doplasma::c1a#3 doplasma::c1a#2 ]
Allocated (was zp[1]:32) zp[1]:21 [ doplasma::c2a#3 doplasma::c2a#2 ]
Allocated (was zp[2]:35) zp[2]:22 [ print_line_cursor#9 print_line_cursor#0 main::count#2 main::count#1 ]
Allocated (was zp[2]:60) zp[2]:24 [ last_time ]
Allocated (was zp[1]:62) zp[1]:26 [ main::block#1 ]
Allocated (was zp[1]:63) zp[1]:27 [ main::v#1 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
/// @file
/// A lightweight library for printing on the C64.
///
/// Printing with this library is done by calling print_ function for each element
// Upstart
// Commodore 64 PRG executable file
.file [name="plasma-kc.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(__start)
// Global Constants & labels
.const PAGE1 = SCREEN1>>6&$f0|CHARSET>>$a&$e
.const PAGE2 = SCREEN2>>6&$f0|CHARSET>>$a&$e
/// $D018 VIC-II base addresses
/// - Bit#0: not used
/// - Bit#1-#3: CB Address Bits 11-13 of the Character Set (*2048)
/// - Bit#4-#7: VM Address Bits 10-13 of the Screen RAM (*1024)
/// Initial Value: %00010100
.label VICII_MEMORY = $d018
/// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.label SCREEN1 = $e000
.label SCREEN2 = $e400
.label CHARSET = $e800
.label print_screen = $400
// The random state variable
.label rand_state = $e
.label last_time = $18
.label print_line_cursor = $16
.label Ticks = 8
.label Ticks_1 = 2
.label print_char_cursor = $11
.segment Code
// __start
__start: {
jmp __init1
// __start::__init1
__init1:
// [1] rand_state = 1 -- vwuz1=vwuc1
lda #<1
sta.z rand_state
lda #>1
sta.z rand_state+1
// [2] last_time = 0 -- vwuz1=vwuc1
lda #<0
sta.z last_time
lda #>0
sta.z last_time+1
// [3] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1]
__b1_from___init1:
jmp __b1
// __start::@1
__b1:
// [4] call main
// [6] phi from __start::@1 to main [phi:__start::@1->main]
main_from___b1:
jsr main
jmp __breturn
// __start::@return
__breturn:
// [5] return
rts
}
// main
main: {
.label block = $1a
.label v = $1b
.label count = $16
// [7] call makechar
// [26] phi from main to makechar [phi:main->makechar]
makechar_from_main:
jsr makechar
// [8] phi from main to main::@4 [phi:main->main::@4]
__b4_from_main:
jmp __b4
// main::@4
__b4:
// [9] call start
jsr start
jmp __b5
// main::@5
__b5:
// [10] main::block#1 = *((char *)CIA2) -- vbuz1=_deref_pbuc1
lda CIA2
sta.z block
// [11] main::tmp#1 = main::block#1 & $fc -- vbuaa=vbuz1_band_vbuc1
lda #$fc
and.z block
// [12] *((char *)CIA2) = main::tmp#1 -- _deref_pbuc1=vbuaa
sta CIA2
// [13] main::v#1 = *VICII_MEMORY -- vbuz1=_deref_pbuc1
lda VICII_MEMORY
sta.z v
// [14] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
__b1_from___b5:
// [14] phi main::count#2 = $1f4 [phi:main::@5->main::@1#0] -- vwuz1=vwuc1
lda #<$1f4
sta.z count
lda #>$1f4
sta.z count+1
jmp __b1
/* Run the demo until a key was hit */
// main::@1
__b1:
// [15] if(0!=main::count#2) goto main::@2 -- 0_neq_vwuz1_then_la1
lda.z count
ora.z count+1
bne __b2_from___b1
jmp __b3
// main::@3
__b3:
// [16] *VICII_MEMORY = main::v#1 -- _deref_pbuc1=vbuz1
lda.z v
sta VICII_MEMORY
// [17] *((char *)CIA2) = main::block#1 -- _deref_pbuc1=vbuz1
lda.z block
sta CIA2
// [18] call end
/* Reset screen colors */
jsr end
jmp __breturn
// main::@return
__breturn:
// [19] return
rts
// [20] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
__b2_from___b1:
jmp __b2
// main::@2
__b2:
// [21] call doplasma
/* Build page 1, then make it visible */
// [62] phi from main::@2 to doplasma [phi:main::@2->doplasma]
doplasma_from___b2:
// [62] phi doplasma::scrn#13 = SCREEN1 [phi:main::@2->doplasma#0] -- pbuz1=pbuc1
lda #<SCREEN1
sta.z doplasma.scrn
lda #>SCREEN1
sta.z doplasma.scrn+1
jsr doplasma
jmp __b6
// main::@6
__b6:
// [22] *VICII_MEMORY = PAGE1 -- _deref_pbuc1=vbuc2
lda #PAGE1
sta VICII_MEMORY
// [23] call doplasma
/* Build page 2, then make it visible */
// [62] phi from main::@6 to doplasma [phi:main::@6->doplasma]
doplasma_from___b6:
// [62] phi doplasma::scrn#13 = SCREEN2 [phi:main::@6->doplasma#0] -- pbuz1=pbuc1
lda #<SCREEN2
sta.z doplasma.scrn
lda #>SCREEN2
sta.z doplasma.scrn+1
jsr doplasma
jmp __b7
// main::@7
__b7:
// [24] *VICII_MEMORY = PAGE2 -- _deref_pbuc1=vbuc2
lda #PAGE2
sta VICII_MEMORY
// [25] main::count#1 = -- main::count#2 -- vwuz1=_dec_vwuz1
lda.z count
bne !+
dec.z count+1
!:
dec.z count
// [14] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
__b1_from___b7:
// [14] phi main::count#2 = main::count#1 [phi:main::@7->main::@1#0] -- register_copy
jmp __b1
}
// makechar
makechar: {
.label __3 = 8
.label __4 = $a
.label __7 = $11
.label __8 = $11
.label s = $14
.label c = $b
.label i = $d
.label __10 = $11
// [27] phi from makechar to makechar::@1 [phi:makechar->makechar::@1]
__b1_from_makechar:
// [27] phi makechar::c#3 = 0 [phi:makechar->makechar::@1#0] -- vwuz1=vbuc1
lda #<0
sta.z c
lda #>0
sta.z c+1
jmp __b1
// makechar::@1
__b1:
// [28] if(makechar::c#3<$100) goto makechar::@2 -- vwuz1_lt_vwuc1_then_la1
lda.z c+1
cmp #>$100
bcc __b2
bne !+
lda.z c
cmp #<$100
bcc __b2
!:
jmp __breturn
// makechar::@return
__breturn:
// [29] return
rts
// makechar::@2
__b2:
// [30] makechar::$9 = (char)makechar::c#3 -- vbuxx=_byte_vwuz1
ldx.z c
// [31] makechar::s#1 = sinetable[makechar::$9] -- vbuz1=pbuc1_derefidx_vbuxx
lda sinetable,x
sta.z s
// [32] phi from makechar::@2 to makechar::@3 [phi:makechar::@2->makechar::@3]
__b3_from___b2:
// [32] phi makechar::i#3 = 0 [phi:makechar::@2->makechar::@3#0] -- vbuz1=vbuc1
lda #0
sta.z i
jmp __b3
// makechar::@3
__b3:
// [33] if(makechar::i#3<8) goto makechar::@5 -- vbuz1_lt_vbuc1_then_la1
lda.z i
cmp #8
bcc __b5_from___b3
jmp __b4
// makechar::@4
__b4:
// [34] makechar::c#2 = ++ makechar::c#3 -- vwuz1=_inc_vwuz1
inc.z c
bne !+
inc.z c+1
!:
// [27] phi from makechar::@4 to makechar::@1 [phi:makechar::@4->makechar::@1]
__b1_from___b4:
// [27] phi makechar::c#3 = makechar::c#2 [phi:makechar::@4->makechar::@1#0] -- register_copy
jmp __b1
// [35] phi from makechar::@3 to makechar::@5 [phi:makechar::@3->makechar::@5]
__b5_from___b3:
// [35] phi makechar::b#3 = 0 [phi:makechar::@3->makechar::@5#0] -- vbuyy=vbuc1
ldy #0
// [35] phi makechar::ii#3 = 0 [phi:makechar::@3->makechar::@5#1] -- vbuxx=vbuc1
ldx #0
jmp __b5
// makechar::@5
__b5:
// [36] if(makechar::ii#3<8) goto makechar::@6 -- vbuxx_lt_vbuc1_then_la1
cpx #8
bcc __b6_from___b5
jmp __b7
// makechar::@7
__b7:
// [37] makechar::$7 = makechar::c#3 << 3 -- vwuz1=vwuz2_rol_3
lda.z c
asl
sta.z __7
lda.z c+1
rol
sta.z __7+1
asl.z __7
rol.z __7+1
asl.z __7
rol.z __7+1
// [38] makechar::$8 = makechar::$7 + makechar::i#3 -- vwuz1=vwuz1_plus_vbuz2
lda.z i
clc
adc.z __8
sta.z __8
bcc !+
inc.z __8+1
!:
// [39] makechar::$10 = CHARSET + makechar::$8 -- pbuz1=pbuc1_plus_vwuz1
lda.z __10
clc
adc #<CHARSET
sta.z __10
lda.z __10+1
adc #>CHARSET
sta.z __10+1
// [40] *makechar::$10 = makechar::b#3 -- _deref_pbuz1=vbuyy
tya
ldy #0
sta (__10),y
// [41] makechar::i#2 = ++ makechar::i#3 -- vbuz1=_inc_vbuz1
inc.z i
// [32] phi from makechar::@7 to makechar::@3 [phi:makechar::@7->makechar::@3]
__b3_from___b7:
// [32] phi makechar::i#3 = makechar::i#2 [phi:makechar::@7->makechar::@3#0] -- register_copy
jmp __b3
// [42] phi from makechar::@5 to makechar::@6 [phi:makechar::@5->makechar::@6]
__b6_from___b5:
jmp __b6
// makechar::@6
__b6:
// [43] call rand
jsr rand
// [44] rand::return#2 = rand::return#0
jmp __b10
// makechar::@10
__b10:
// [45] makechar::$3 = rand::return#2
// [46] makechar::$4 = makechar::$3 & $ff -- vbuz1=vwuz2_band_vbuc1
lda #$ff
and.z __3
sta.z __4
// [47] if(makechar::$4<=makechar::s#1) goto makechar::@8 -- vbuz1_le_vbuz2_then_la1
lda.z s
cmp.z __4
bcs __b8_from___b10
jmp __b9
// makechar::@9
__b9:
// [48] makechar::b#2 = makechar::b#3 | bittab[makechar::ii#3] -- vbuyy=vbuyy_bor_pbuc1_derefidx_vbuxx
tya
ora bittab,x
tay
// [49] phi from makechar::@10 makechar::@9 to makechar::@8 [phi:makechar::@10/makechar::@9->makechar::@8]
__b8_from___b10:
__b8_from___b9:
// [49] phi makechar::b#7 = makechar::b#3 [phi:makechar::@10/makechar::@9->makechar::@8#0] -- register_copy
jmp __b8
// makechar::@8
__b8:
// [50] makechar::ii#2 = ++ makechar::ii#3 -- vbuxx=_inc_vbuxx
inx
// [35] phi from makechar::@8 to makechar::@5 [phi:makechar::@8->makechar::@5]
__b5_from___b8:
// [35] phi makechar::b#3 = makechar::b#7 [phi:makechar::@8->makechar::@5#0] -- register_copy
// [35] phi makechar::ii#3 = makechar::ii#2 [phi:makechar::@8->makechar::@5#1] -- register_copy
jmp __b5
}
// start
start: {
.label LAST_TIME = last_time
// asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
jsr $ffde
sta LAST_TIME
stx LAST_TIME+1
jmp __breturn
// start::@return
__breturn:
// [52] return
rts
}
// end
end: {
// [53] Ticks#0 = last_time -- vwuz1=vwuz2
lda.z last_time
sta.z Ticks
lda.z last_time+1
sta.z Ticks+1
// [54] call start
jsr start
jmp __b1
// end::@1
__b1:
// [55] last_time = last_time - Ticks#0 -- vwuz1=vwuz1_minus_vwuz2
lda.z last_time
sec
sbc.z Ticks
sta.z last_time
lda.z last_time+1
sbc.z Ticks+1
sta.z last_time+1
// [56] Ticks#1 = last_time -- vwuz1=vwuz2
lda.z last_time
sta.z Ticks_1
lda.z last_time+1
sta.z Ticks_1+1
// [57] print_uint::w#0 = Ticks#1
// [58] call print_uint
jsr print_uint
// [59] phi from end::@1 to end::@2 [phi:end::@1->end::@2]
__b2_from___b1:
jmp __b2
// end::@2
__b2:
// [60] call print_ln
// [100] phi from end::@2 to print_ln [phi:end::@2->print_ln]
print_ln_from___b2:
jsr print_ln
jmp __breturn
// end::@return
__breturn:
// [61] return
rts
}
// doplasma
// void doplasma(__zp($b) char *scrn)
doplasma: {
.const c2A = 0
.const c2B = 0
.label c1a = $14
.label c1b = $a
.label ii = $d
.label c2a = $15
.label c2b = $13
.label i = $10
.label scrn = $b
// [63] phi from doplasma to doplasma::@1 [phi:doplasma->doplasma::@1]
__b1_from_doplasma:
// [63] phi doplasma::c1b#3 = 0 [phi:doplasma->doplasma::@1#0] -- vbuz1=vbuc1
lda #0
sta.z c1b
// [63] phi doplasma::c1a#3 = 0 [phi:doplasma->doplasma::@1#1] -- vbuz1=vbuc1
lda #0
sta.z c1a
// [63] phi doplasma::ii#3 = 0 [phi:doplasma->doplasma::@1#2] -- vbuz1=vbuc1
lda #0
sta.z ii
jmp __b1
// doplasma::@1
__b1:
// [64] if(doplasma::ii#3<$19) goto doplasma::@2 -- vbuz1_lt_vbuc1_then_la1
lda.z ii
cmp #$19
bcc __b2
// [65] phi from doplasma::@1 to doplasma::@3 [phi:doplasma::@1->doplasma::@3]
__b3_from___b1:
// [65] phi doplasma::c2b#3 = doplasma::c2B#0 [phi:doplasma::@1->doplasma::@3#0] -- vbuz1=vbuc1
lda #c2B
sta.z c2b
// [65] phi doplasma::c2a#3 = doplasma::c2A#0 [phi:doplasma::@1->doplasma::@3#1] -- vbuz1=vbuc1
lda #c2A
sta.z c2a
// [65] phi doplasma::i#3 = 0 [phi:doplasma::@1->doplasma::@3#2] -- vbuz1=vbuc1
lda #0
sta.z i
jmp __b3
// doplasma::@3
__b3:
// [66] if(doplasma::i#3<$28) goto doplasma::@4 -- vbuz1_lt_vbuc1_then_la1
lda.z i
cmp #$28
bcc __b4
// [67] phi from doplasma::@3 to doplasma::@5 [phi:doplasma::@3->doplasma::@5]
__b5_from___b3:
// [67] phi doplasma::scrn#6 = doplasma::scrn#13 [phi:doplasma::@3->doplasma::@5#0] -- register_copy
// [67] phi doplasma::jj#3 = 0 [phi:doplasma::@3->doplasma::@5#1] -- vbuxx=vbuc1
ldx #0
jmp __b5
// doplasma::@5
__b5:
// [68] if(doplasma::jj#3<$19) goto doplasma::@6 -- vbuxx_lt_vbuc1_then_la1
cpx #$19
bcc __b6_from___b5
jmp __breturn
// doplasma::@return
__breturn:
// [69] return
rts
// [70] phi from doplasma::@5 to doplasma::@6 [phi:doplasma::@5->doplasma::@6]
__b6_from___b5:
// [70] phi doplasma::j#3 = 0 [phi:doplasma::@5->doplasma::@6#0] -- vbuyy=vbuc1
ldy #0
jmp __b6
// doplasma::@6
__b6:
// [71] if(doplasma::j#3<$28) goto doplasma::@7 -- vbuyy_lt_vbuc1_then_la1
cpy #$28
bcc __b7
jmp __b8
// doplasma::@8
__b8:
// [72] doplasma::scrn#0 = doplasma::scrn#6 + $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc.z scrn
sta.z scrn
bcc !+
inc.z scrn+1
!:
// [73] doplasma::jj#2 = ++ doplasma::jj#3 -- vbuxx=_inc_vbuxx
inx
// [67] phi from doplasma::@8 to doplasma::@5 [phi:doplasma::@8->doplasma::@5]
__b5_from___b8:
// [67] phi doplasma::scrn#6 = doplasma::scrn#0 [phi:doplasma::@8->doplasma::@5#0] -- register_copy
// [67] phi doplasma::jj#3 = doplasma::jj#2 [phi:doplasma::@8->doplasma::@5#1] -- register_copy
jmp __b5
// doplasma::@7
__b7:
// [74] doplasma::$6 = xbuf[doplasma::j#3] + ybuf[doplasma::jj#3] -- vbuaa=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx
lda xbuf,y
clc
adc ybuf,x
// [75] doplasma::scrn#6[doplasma::j#3] = doplasma::$6 -- pbuz1_derefidx_vbuyy=vbuaa
sta (scrn),y
// [76] doplasma::j#2 = ++ doplasma::j#3 -- vbuyy=_inc_vbuyy
iny
// [70] phi from doplasma::@7 to doplasma::@6 [phi:doplasma::@7->doplasma::@6]
__b6_from___b7:
// [70] phi doplasma::j#3 = doplasma::j#2 [phi:doplasma::@7->doplasma::@6#0] -- register_copy
jmp __b6
// doplasma::@4
__b4:
// [77] doplasma::$3 = sinetable[doplasma::c2a#3] + sinetable[doplasma::c2b#3] -- vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc1_derefidx_vbuz2
ldy.z c2a
lda sinetable,y
ldy.z c2b
clc
adc sinetable,y
// [78] xbuf[doplasma::i#3] = doplasma::$3 -- pbuc1_derefidx_vbuz1=vbuaa
ldy.z i
sta xbuf,y
// [79] doplasma::c2a#2 = doplasma::c2a#3 + 3 -- vbuz1=vbuz1_plus_vbuc1
lax.z c2a
axs #-[3]
stx.z c2a
// [80] doplasma::c2b#2 = doplasma::c2b#3 + 7 -- vbuz1=vbuz1_plus_vbuc1
lax.z c2b
axs #-[7]
stx.z c2b
// [81] doplasma::i#2 = ++ doplasma::i#3 -- vbuz1=_inc_vbuz1
inc.z i
// [65] phi from doplasma::@4 to doplasma::@3 [phi:doplasma::@4->doplasma::@3]
__b3_from___b4:
// [65] phi doplasma::c2b#3 = doplasma::c2b#2 [phi:doplasma::@4->doplasma::@3#0] -- register_copy
// [65] phi doplasma::c2a#3 = doplasma::c2a#2 [phi:doplasma::@4->doplasma::@3#1] -- register_copy
// [65] phi doplasma::i#3 = doplasma::i#2 [phi:doplasma::@4->doplasma::@3#2] -- register_copy
jmp __b3
// doplasma::@2
__b2:
// [82] doplasma::$1 = sinetable[doplasma::c1a#3] + sinetable[doplasma::c1b#3] -- vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc1_derefidx_vbuz2
ldy.z c1a
lda sinetable,y
ldy.z c1b
clc
adc sinetable,y
// [83] ybuf[doplasma::ii#3] = doplasma::$1 -- pbuc1_derefidx_vbuz1=vbuaa
ldy.z ii
sta ybuf,y
// [84] doplasma::c1a#2 = doplasma::c1a#3 + 4 -- vbuz1=vbuz1_plus_vbuc1
lax.z c1a
axs #-[4]
stx.z c1a
// [85] doplasma::c1b#2 = doplasma::c1b#3 + 9 -- vbuz1=vbuz1_plus_vbuc1
lax.z c1b
axs #-[9]
stx.z c1b
// [86] doplasma::ii#2 = ++ doplasma::ii#3 -- vbuz1=_inc_vbuz1
inc.z ii
// [63] phi from doplasma::@2 to doplasma::@1 [phi:doplasma::@2->doplasma::@1]
__b1_from___b2:
// [63] phi doplasma::c1b#3 = doplasma::c1b#2 [phi:doplasma::@2->doplasma::@1#0] -- register_copy
// [63] phi doplasma::c1a#3 = doplasma::c1a#2 [phi:doplasma::@2->doplasma::@1#1] -- register_copy
// [63] phi doplasma::ii#3 = doplasma::ii#2 [phi:doplasma::@2->doplasma::@1#2] -- register_copy
jmp __b1
}
// rand
// Returns a pseudo-random number in the range of 0 to RAND_MAX (65535)
// Uses an xorshift pseudorandom number generator that hits all different values
// Information https://en.wikipedia.org/wiki/Xorshift
// Source http://www.retroprogramming.com/2017/07/xorshift-pseudorandom-numbers-in-z80.html
rand: {
.label __0 = 2
.label __1 = 4
.label __2 = 6
.label return = 8
// [87] rand::$0 = rand_state << 7 -- vwuz1=vwuz2_rol_7
lda.z rand_state+1
lsr
lda.z rand_state
ror
sta.z __0+1
lda #0
ror
sta.z __0
// [88] rand_state = rand_state ^ rand::$0 -- vwuz1=vwuz1_bxor_vwuz2
lda.z rand_state
eor.z __0
sta.z rand_state
lda.z rand_state+1
eor.z __0+1
sta.z rand_state+1
// [89] rand::$1 = rand_state >> 9 -- vwuz1=vwuz2_ror_9
lda.z rand_state+1
lsr
sta.z __1
lda #0
sta.z __1+1
// [90] rand_state = rand_state ^ rand::$1 -- vwuz1=vwuz1_bxor_vwuz2
lda.z rand_state
eor.z __1
sta.z rand_state
lda.z rand_state+1
eor.z __1+1
sta.z rand_state+1
// [91] rand::$2 = rand_state << 8 -- vwuz1=vwuz2_rol_8
lda.z rand_state
sta.z __2+1
lda #0
sta.z __2
// [92] rand_state = rand_state ^ rand::$2 -- vwuz1=vwuz1_bxor_vwuz2
lda.z rand_state
eor.z __2
sta.z rand_state
lda.z rand_state+1
eor.z __2+1
sta.z rand_state+1
// [93] rand::return#0 = rand_state -- vwuz1=vwuz2
lda.z rand_state
sta.z return
lda.z rand_state+1
sta.z return+1
jmp __breturn
// rand::@return
__breturn:
// [94] return
rts
}
// print_uint
// Print a unsigned int as HEX
// void print_uint(__zp(2) unsigned int w)
print_uint: {
.label w = 2
// [95] print_uchar::b#0 = byte1 print_uint::w#0 -- vbuxx=_byte1_vwuz1
ldx.z w+1
// [96] call print_uchar
// [105] phi from print_uint to print_uchar [phi:print_uint->print_uchar]
print_uchar_from_print_uint:
// [105] phi print_char_cursor#37 = print_screen#0 [phi:print_uint->print_uchar#0] -- pbuz1=pbuc1
lda #<print_screen
sta.z print_char_cursor
lda #>print_screen
sta.z print_char_cursor+1
// [105] phi print_uchar::b#2 = print_uchar::b#0 [phi:print_uint->print_uchar#1] -- register_copy
jsr print_uchar
jmp __b1
// print_uint::@1
__b1:
// [97] print_uchar::b#1 = byte0 print_uint::w#0 -- vbuxx=_byte0_vwuz1
ldx.z w
// [98] call print_uchar
// [105] phi from print_uint::@1 to print_uchar [phi:print_uint::@1->print_uchar]
print_uchar_from___b1:
// [105] phi print_char_cursor#37 = print_char_cursor#27 [phi:print_uint::@1->print_uchar#0] -- register_copy
// [105] phi print_uchar::b#2 = print_uchar::b#1 [phi:print_uint::@1->print_uchar#1] -- register_copy
jsr print_uchar
jmp __breturn
// print_uint::@return
__breturn:
// [99] return
rts
}
// print_ln
// Print a newline
print_ln: {
// [101] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1]
__b1_from_print_ln:
// [101] phi print_line_cursor#9 = print_screen#0 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1
lda #<print_screen
sta.z print_line_cursor
lda #>print_screen
sta.z print_line_cursor+1
jmp __b1
// [101] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1]
__b1_from___b1:
// [101] phi print_line_cursor#9 = print_line_cursor#0 [phi:print_ln::@1->print_ln::@1#0] -- register_copy
jmp __b1
// print_ln::@1
__b1:
// [102] print_line_cursor#0 = print_line_cursor#9 + $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc.z print_line_cursor
sta.z print_line_cursor
bcc !+
inc.z print_line_cursor+1
!:
// [103] if(print_line_cursor#0<print_char_cursor#27) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1
lda.z print_line_cursor+1
cmp.z print_char_cursor+1
bcc __b1_from___b1
bne !+
lda.z print_line_cursor
cmp.z print_char_cursor
bcc __b1_from___b1
!:
jmp __breturn
// print_ln::@return
__breturn:
// [104] return
rts
}
// print_uchar
// Print a char as HEX
// void print_uchar(__register(X) char b)
print_uchar: {
// [106] print_uchar::$0 = print_uchar::b#2 >> 4 -- vbuaa=vbuxx_ror_4
txa
lsr
lsr
lsr
lsr
// [107] print_char::ch#0 = print_hextab[print_uchar::$0] -- vbuaa=pbuc1_derefidx_vbuaa
tay
lda print_hextab,y
// [108] call print_char
// Table of hexadecimal digits
// [113] phi from print_uchar to print_char [phi:print_uchar->print_char]
print_char_from_print_uchar:
// [113] phi print_char_cursor#26 = print_char_cursor#37 [phi:print_uchar->print_char#0] -- register_copy
// [113] phi print_char::ch#2 = print_char::ch#0 [phi:print_uchar->print_char#1] -- register_copy
jsr print_char
jmp __b1
// print_uchar::@1
__b1:
// [109] print_uchar::$2 = print_uchar::b#2 & $f -- vbuxx=vbuxx_band_vbuc1
lda #$f
axs #0
// [110] print_char::ch#1 = print_hextab[print_uchar::$2] -- vbuaa=pbuc1_derefidx_vbuxx
lda print_hextab,x
// [111] call print_char
// [113] phi from print_uchar::@1 to print_char [phi:print_uchar::@1->print_char]
print_char_from___b1:
// [113] phi print_char_cursor#26 = print_char_cursor#27 [phi:print_uchar::@1->print_char#0] -- register_copy
// [113] phi print_char::ch#2 = print_char::ch#1 [phi:print_uchar::@1->print_char#1] -- register_copy
jsr print_char
jmp __breturn
// print_uchar::@return
__breturn:
// [112] return
rts
}
// print_char
// Print a single char
// void print_char(__register(A) char ch)
print_char: {
// [114] *print_char_cursor#26 = print_char::ch#2 -- _deref_pbuz1=vbuaa
ldy #0
sta (print_char_cursor),y
// [115] print_char_cursor#27 = ++ print_char_cursor#26 -- pbuz1=_inc_pbuz1
inc.z print_char_cursor
bne !+
inc.z print_char_cursor+1
!:
jmp __breturn
// print_char::@return
__breturn:
// [116] return
rts
}
// File Data
.segment Data
print_hextab: .text "0123456789abcdef"
.align $100
sinetable: .byte $80, $7d, $7a, $77, $74, $70, $6d, $6a, $67, $64, $61, $5e, $5b, $58, $55, $52, $4f, $4d, $4a, $47, $44, $41, $3f, $3c, $39, $37, $34, $32, $2f, $2d, $2b, $28, $26, $24, $22, $20, $1e, $1c, $1a, $18, $16, $15, $13, $11, $10, $f, $d, $c, $b, $a, 8, 7, 6, 6, 5, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 6, 7, 8, $a, $b, $c, $d, $f, $10, $11, $13, $15, $16, $18, $1a, $1c, $1e, $20, $22, $24, $26, $28, $2b, $2d, $2f, $32, $34, $37, $39, $3c, $3f, $41, $44, $47, $4a, $4d, $4f, $52, $55, $58, $5b, $5e, $61, $64, $67, $6a, $6d, $70, $74, $77, $7a, $7d, $80, $83, $86, $89, $8c, $90, $93, $96, $99, $9c, $9f, $a2, $a5, $a8, $ab, $ae, $b1, $b3, $b6, $b9, $bc, $bf, $c1, $c4, $c7, $c9, $cc, $ce, $d1, $d3, $d5, $d8, $da, $dc, $de, $e0, $e2, $e4, $e6, $e8, $ea, $eb, $ed, $ef, $f0, $f1, $f3, $f4, $f5, $f6, $f8, $f9, $fa, $fa, $fb, $fc, $fd, $fd, $fe, $fe, $fe, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $fe, $fe, $fe, $fd, $fd, $fc, $fb, $fa, $fa, $f9, $f8, $f6, $f5, $f4, $f3, $f1, $f0, $ef, $ed, $eb, $ea, $e8, $e6, $e4, $e2, $e0, $de, $dc, $da, $d8, $d5, $d3, $d1, $ce, $cc, $c9, $c7, $c4, $c1, $bf, $bc, $b9, $b6, $b3, $b1, $ae, $ab, $a8, $a5, $a2, $9f, $9c, $99, $96, $93, $90, $8c, $89, $86, $83
xbuf: .fill $28, 0
ybuf: .fill $19, 0
bittab: .byte 1, 2, 4, 8, $10, $20, $40, $80
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __init1
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b4
Removing instruction jmp __b5
Removing instruction jmp __b1
Removing instruction jmp __b3
Removing instruction jmp __breturn
Removing instruction jmp __b2
Removing instruction jmp __b6
Removing instruction jmp __b7
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b3
Removing instruction jmp __b4
Removing instruction jmp __b5
Removing instruction jmp __b7
Removing instruction jmp __b6
Removing instruction jmp __b10
Removing instruction jmp __b9
Removing instruction jmp __b8
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b3
Removing instruction jmp __b5
Removing instruction jmp __breturn
Removing instruction jmp __b6
Removing instruction jmp __b8
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #<0
Removing instruction lda #>0
Removing instruction lda #>0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda.z rand_state+1
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __b2_from___b1 with __b2
Replacing label __b6_from___b5 with __b6
Replacing label __b8_from___b10 with __b8
Replacing label __b1_from___b1 with __b1
Replacing label __b1_from___b1 with __b1
Removing instruction __b1_from___init1:
Removing instruction main_from___b1:
Removing instruction __b4_from_main:
Removing instruction __b2_from___b1:
Removing instruction __b6_from___b5:
Removing instruction __b8_from___b10:
Removing instruction __b8_from___b9:
Removing instruction __b2_from___b1:
Removing instruction print_ln_from___b2:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __init1:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction makechar_from_main:
Removing instruction __b4:
Removing instruction __b5:
Removing instruction __b1_from___b5:
Removing instruction __b3:
Removing instruction __breturn:
Removing instruction doplasma_from___b2:
Removing instruction __b6:
Removing instruction doplasma_from___b6:
Removing instruction __b7:
Removing instruction __b1_from___b7:
Removing instruction __b1_from_makechar:
Removing instruction __breturn:
Removing instruction __b3_from___b2:
Removing instruction __b4:
Removing instruction __b1_from___b4:
Removing instruction __b7:
Removing instruction __b3_from___b7:
Removing instruction __b10:
Removing instruction __b9:
Removing instruction __b5_from___b8:
Removing instruction __breturn:
Removing instruction __b1:
Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __b1_from_doplasma:
Removing instruction __b3_from___b1:
Removing instruction __b5_from___b3:
Removing instruction __breturn:
Removing instruction __b8:
Removing instruction __b5_from___b8:
Removing instruction __b6_from___b7:
Removing instruction __b3_from___b4:
Removing instruction __b1_from___b2:
Removing instruction __breturn:
Removing instruction print_uchar_from_print_uint:
Removing instruction __b1:
Removing instruction print_uchar_from___b1:
Removing instruction __breturn:
Removing instruction __b1_from_print_ln:
Removing instruction __breturn:
Removing instruction print_char_from_print_uchar:
Removing instruction __b1:
Removing instruction print_char_from___b1:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Relabelling long label __b5_from___b3 to __b4
Relabelling long label __b6_from___b5 to __b8
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
__constant char * const CHARSET = (char *) 59392
__constant struct MOS6526_CIA * const CIA2 = (struct MOS6526_CIA *) 56576
__constant const char PAGE1 = (unsigned int)SCREEN1>>6&$f0|(unsigned int)CHARSET>>$a&$e
__constant const char PAGE2 = (unsigned int)SCREEN2>>6&$f0|(unsigned int)CHARSET>>$a&$e
__constant char RADIX::BINARY = 2
__constant char RADIX::DECIMAL = $a
__constant char RADIX::HEXADECIMAL = $10
__constant char RADIX::OCTAL = 8
__constant char * const SCREEN1 = (char *) 57344
__constant char * const SCREEN2 = (char *) 58368
unsigned int Ticks
unsigned int Ticks#0 // Ticks zp[2]:8 101.0
unsigned int Ticks#1 // Ticks_1 zp[2]:2 202.0
__constant char * const VICII_MEMORY = (char *) 53272
void __start()
__constant const char bittab[] = { 1, 2, 4, 8, $10, $20, $40, $80 }
void doplasma(char *scrn)
char doplasma::$1 // reg byte a 200002.0
char doplasma::$3 // reg byte a 200002.0
char doplasma::$6 // reg byte a 2000002.0
char doplasma::c1A
char doplasma::c1B
char doplasma::c1a
char doplasma::c1a#2 // c1a zp[1]:20 66667.33333333333
char doplasma::c1a#3 // c1a zp[1]:20 75000.75
char doplasma::c1b
char doplasma::c1b#2 // c1b zp[1]:10 100001.0
char doplasma::c1b#3 // c1b zp[1]:10 60000.600000000006
char doplasma::c2A
__constant char doplasma::c2A#0 = 0 // c2A
char doplasma::c2B
__constant char doplasma::c2B#0 = 0 // c2B
char doplasma::c2a
char doplasma::c2a#2 // c2a zp[1]:21 66667.33333333333
char doplasma::c2a#3 // c2a zp[1]:21 75000.75
char doplasma::c2b
char doplasma::c2b#2 // c2b zp[1]:19 100001.0
char doplasma::c2b#3 // c2b zp[1]:19 60000.600000000006
char doplasma::i
char doplasma::i#2 // i zp[1]:16 200002.0
char doplasma::i#3 // i zp[1]:16 66667.33333333333
char doplasma::ii
char doplasma::ii#2 // ii zp[1]:13 200002.0
char doplasma::ii#3 // ii zp[1]:13 66667.33333333333
char doplasma::j
char doplasma::j#2 // reg byte y 2000002.0
char doplasma::j#3 // reg byte y 1250001.25
char doplasma::jj
char doplasma::jj#2 // reg byte x 200002.0
char doplasma::jj#3 // reg byte x 162500.5
char *doplasma::scrn
char *doplasma::scrn#0 // scrn zp[2]:11 100001.0
char *doplasma::scrn#13 // scrn zp[2]:11 6666.733333333334
char *doplasma::scrn#6 // scrn zp[2]:11 185714.85714285713
void end()
__loadstore volatile unsigned int last_time // zp[2]:24 17.652173913043477
int main()
char main::block
char main::block#1 // block zp[1]:26 2.5384615384615383
unsigned int main::count
unsigned int main::count#1 // count zp[2]:22 202.0
unsigned int main::count#2 // count zp[2]:22 43.285714285714285
int main::return
char main::tmp
char main::tmp#1 // reg byte a 22.0
char main::v
char main::v#1 // v zp[1]:27 2.4444444444444446
void makechar()
char *makechar::$10 // zp[2]:17 20002.0
unsigned int makechar::$3 // zp[2]:8 200002.0
char makechar::$4 // zp[1]:10 200002.0
unsigned int makechar::$7 // zp[2]:17 20002.0
unsigned int makechar::$8 // zp[2]:17 20002.0
char makechar::$9 // reg byte x 2002.0
char makechar::b
char makechar::b#2 // reg byte y 200002.0
char makechar::b#3 // reg byte y 28182.181818181816
char makechar::b#7 // reg byte y 150001.5
unsigned int makechar::c
unsigned int makechar::c#2 // c zp[2]:11 2002.0
unsigned int makechar::c#3 // c zp[2]:11 591.090909090909
char makechar::i
char makechar::i#2 // i zp[1]:13 20002.0
char makechar::i#3 // i zp[1]:13 2353.176470588235
char makechar::ii
char makechar::ii#2 // reg byte x 200002.0
char makechar::ii#3 // reg byte x 40000.4
char makechar::s
char makechar::s#1 // s zp[1]:20 5315.894736842105
void print_char(char ch)
char print_char::ch
char print_char::ch#0 // reg byte a 20002.0
char print_char::ch#1 // reg byte a 20002.0
char print_char::ch#2 // reg byte a 120003.0
char *print_char_cursor
char *print_char_cursor#26 // print_char_cursor zp[2]:17 110002.0
char *print_char_cursor#27 // print_char_cursor zp[2]:17 7117.882352941177
char *print_char_cursor#37 // print_char_cursor zp[2]:17 3667.333333333333
__constant const char print_hextab[] = "0123456789abcdef"z
char *print_line_cursor
char *print_line_cursor#0 // print_line_cursor zp[2]:22 15001.5
char *print_line_cursor#9 // print_line_cursor zp[2]:22 20002.0
void print_ln()
char *print_screen
__constant char *print_screen#0 = (char *) 1024 // print_screen
void print_uchar(char b)
char print_uchar::$0 // reg byte a 20002.0
char print_uchar::$2 // reg byte x 20002.0
char print_uchar::b
char print_uchar::b#0 // reg byte x 2002.0
char print_uchar::b#1 // reg byte x 2002.0
char print_uchar::b#2 // reg byte x 5501.0
void print_uint(unsigned int w)
unsigned int print_uint::w
unsigned int print_uint::w#0 // w zp[2]:2 701.0
unsigned int rand()
unsigned int rand::$0 // zp[2]:2 2000002.0
unsigned int rand::$1 // zp[2]:4 2000002.0
unsigned int rand::$2 // zp[2]:6 2000002.0
unsigned int rand::return
unsigned int rand::return#0 // return zp[2]:8 366667.3333333334
unsigned int rand::return#2 // return zp[2]:8 200002.0
__loadstore volatile unsigned int rand_state // zp[2]:14 277778.1111111111
__constant const char sinetable[$100] = { $80, $7d, $7a, $77, $74, $70, $6d, $6a, $67, $64, $61, $5e, $5b, $58, $55, $52, $4f, $4d, $4a, $47, $44, $41, $3f, $3c, $39, $37, $34, $32, $2f, $2d, $2b, $28, $26, $24, $22, $20, $1e, $1c, $1a, $18, $16, $15, $13, $11, $10, $f, $d, $c, $b, $a, 8, 7, 6, 6, 5, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 6, 7, 8, $a, $b, $c, $d, $f, $10, $11, $13, $15, $16, $18, $1a, $1c, $1e, $20, $22, $24, $26, $28, $2b, $2d, $2f, $32, $34, $37, $39, $3c, $3f, $41, $44, $47, $4a, $4d, $4f, $52, $55, $58, $5b, $5e, $61, $64, $67, $6a, $6d, $70, $74, $77, $7a, $7d, $80, $83, $86, $89, $8c, $90, $93, $96, $99, $9c, $9f, $a2, $a5, $a8, $ab, $ae, $b1, $b3, $b6, $b9, $bc, $bf, $c1, $c4, $c7, $c9, $cc, $ce, $d1, $d3, $d5, $d8, $da, $dc, $de, $e0, $e2, $e4, $e6, $e8, $ea, $eb, $ed, $ef, $f0, $f1, $f3, $f4, $f5, $f6, $f8, $f9, $fa, $fa, $fb, $fc, $fd, $fd, $fe, $fe, $fe, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $fe, $fe, $fe, $fd, $fd, $fc, $fb, $fa, $fa, $f9, $f8, $f6, $f5, $f4, $f3, $f1, $f0, $ef, $ed, $eb, $ea, $e8, $e6, $e4, $e2, $e0, $de, $dc, $da, $d8, $d5, $d3, $d1, $ce, $cc, $c9, $c7, $c4, $c1, $bf, $bc, $b9, $b6, $b3, $b1, $ae, $ab, $a8, $a5, $a2, $9f, $9c, $99, $96, $93, $90, $8c, $89, $86, $83 }
void start()
__constant unsigned int * const start::LAST_TIME = &last_time
__constant char xbuf[$28] = { fill( $28, 0) }
__constant char ybuf[$19] = { fill( $19, 0) }
reg byte x [ makechar::ii#3 makechar::ii#2 ]
reg byte y [ makechar::b#3 makechar::b#7 makechar::b#2 ]
zp[1]:13 [ doplasma::ii#3 doplasma::ii#2 makechar::i#3 makechar::i#2 ]
zp[1]:16 [ doplasma::i#3 doplasma::i#2 ]
zp[1]:21 [ doplasma::c2a#3 doplasma::c2a#2 ]
zp[1]:19 [ doplasma::c2b#3 doplasma::c2b#2 ]
reg byte x [ doplasma::jj#3 doplasma::jj#2 ]
zp[2]:11 [ doplasma::scrn#6 doplasma::scrn#0 doplasma::scrn#13 makechar::c#3 makechar::c#2 ]
reg byte y [ doplasma::j#3 doplasma::j#2 ]
zp[2]:22 [ print_line_cursor#9 print_line_cursor#0 main::count#2 main::count#1 ]
reg byte x [ print_uchar::b#2 print_uchar::b#0 print_uchar::b#1 ]
reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp[2]:14 [ rand_state ]
zp[2]:24 [ last_time ]
zp[1]:26 [ main::block#1 ]
reg byte a [ main::tmp#1 ]
zp[1]:27 [ main::v#1 ]
reg byte x [ makechar::$9 ]
zp[1]:20 [ makechar::s#1 doplasma::c1a#3 doplasma::c1a#2 ]
zp[2]:17 [ makechar::$7 makechar::$8 makechar::$10 print_char_cursor#26 print_char_cursor#37 print_char_cursor#27 ]
zp[1]:10 [ makechar::$4 doplasma::c1b#3 doplasma::c1b#2 ]
zp[2]:8 [ Ticks#0 rand::return#2 makechar::$3 rand::return#0 ]
reg byte a [ doplasma::$6 ]
reg byte a [ doplasma::$3 ]
reg byte a [ doplasma::$1 ]
zp[2]:2 [ rand::$0 Ticks#1 print_uint::w#0 ]
zp[2]:4 [ rand::$1 ]
zp[2]:6 [ rand::$2 ]
reg byte a [ print_uchar::$0 ]
reg byte x [ print_uchar::$2 ]
FINAL ASSEMBLER
Score: 102017
// File Comments
/// @file
/// A lightweight library for printing on the C64.
///
/// Printing with this library is done by calling print_ function for each element
// Upstart
// Commodore 64 PRG executable file
.file [name="plasma-kc.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(__start)
// Global Constants & labels
.const PAGE1 = SCREEN1>>6&$f0|CHARSET>>$a&$e
.const PAGE2 = SCREEN2>>6&$f0|CHARSET>>$a&$e
/// $D018 VIC-II base addresses
/// - Bit#0: not used
/// - Bit#1-#3: CB Address Bits 11-13 of the Character Set (*2048)
/// - Bit#4-#7: VM Address Bits 10-13 of the Screen RAM (*1024)
/// Initial Value: %00010100
.label VICII_MEMORY = $d018
/// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.label SCREEN1 = $e000
.label SCREEN2 = $e400
.label CHARSET = $e800
.label print_screen = $400
// The random state variable
.label rand_state = $e
.label last_time = $18
.label print_line_cursor = $16
.label Ticks = 8
.label Ticks_1 = 2
.label print_char_cursor = $11
.segment Code
// __start
__start: {
// __start::__init1
// volatile unsigned int rand_state = 1
// [1] rand_state = 1 -- vwuz1=vwuc1
lda #<1
sta.z rand_state
lda #>1
sta.z rand_state+1
// unsigned int last_time
// [2] last_time = 0 -- vwuz1=vwuc1
sta.z last_time
sta.z last_time+1
// [3] phi from __start::__init1 to __start::@1 [phi:__start::__init1->__start::@1]
// __start::@1
// [4] call main
// [6] phi from __start::@1 to main [phi:__start::@1->main]
jsr main
// __start::@return
// [5] return
rts
}
// main
main: {
.label block = $1a
.label v = $1b
.label count = $16
// makechar()
// [7] call makechar
// [26] phi from main to makechar [phi:main->makechar]
jsr makechar
// [8] phi from main to main::@4 [phi:main->main::@4]
// main::@4
// start()
// [9] call start
jsr start
// main::@5
// block = CIA2->PORT_A
// [10] main::block#1 = *((char *)CIA2) -- vbuz1=_deref_pbuc1
lda CIA2
sta.z block
// tmp = block & 0xFC
// [11] main::tmp#1 = main::block#1 & $fc -- vbuaa=vbuz1_band_vbuc1
lda #$fc
and.z block
// CIA2->PORT_A = tmp
// [12] *((char *)CIA2) = main::tmp#1 -- _deref_pbuc1=vbuaa
sta CIA2
// v = *VICII_MEMORY
// [13] main::v#1 = *VICII_MEMORY -- vbuz1=_deref_pbuc1
lda VICII_MEMORY
sta.z v
// [14] phi from main::@5 to main::@1 [phi:main::@5->main::@1]
// [14] phi main::count#2 = $1f4 [phi:main::@5->main::@1#0] -- vwuz1=vwuc1
lda #<$1f4
sta.z count
lda #>$1f4
sta.z count+1
/* Run the demo until a key was hit */
// main::@1
__b1:
// while (count)
// [15] if(0!=main::count#2) goto main::@2 -- 0_neq_vwuz1_then_la1
lda.z count
ora.z count+1
bne __b2
// main::@3
// *VICII_MEMORY = v
// [16] *VICII_MEMORY = main::v#1 -- _deref_pbuc1=vbuz1
lda.z v
sta VICII_MEMORY
// CIA2->PORT_A = block
// [17] *((char *)CIA2) = main::block#1 -- _deref_pbuc1=vbuz1
lda.z block
sta CIA2
// end()
// [18] call end
/* Reset screen colors */
jsr end
// main::@return
// }
// [19] return
rts
// [20] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
// main::@2
__b2:
// doplasma ((char*)SCREEN1)
// [21] call doplasma
/* Build page 1, then make it visible */
// [62] phi from main::@2 to doplasma [phi:main::@2->doplasma]
// [62] phi doplasma::scrn#13 = SCREEN1 [phi:main::@2->doplasma#0] -- pbuz1=pbuc1
lda #<SCREEN1
sta.z doplasma.scrn
lda #>SCREEN1
sta.z doplasma.scrn+1
jsr doplasma
// main::@6
// *VICII_MEMORY = PAGE1
// [22] *VICII_MEMORY = PAGE1 -- _deref_pbuc1=vbuc2
lda #PAGE1
sta VICII_MEMORY
// doplasma ((char*)SCREEN2)
// [23] call doplasma
/* Build page 2, then make it visible */
// [62] phi from main::@6 to doplasma [phi:main::@6->doplasma]
// [62] phi doplasma::scrn#13 = SCREEN2 [phi:main::@6->doplasma#0] -- pbuz1=pbuc1
lda #<SCREEN2
sta.z doplasma.scrn
lda #>SCREEN2
sta.z doplasma.scrn+1
jsr doplasma
// main::@7
// *VICII_MEMORY = PAGE2
// [24] *VICII_MEMORY = PAGE2 -- _deref_pbuc1=vbuc2
lda #PAGE2
sta VICII_MEMORY
// --count;
// [25] main::count#1 = -- main::count#2 -- vwuz1=_dec_vwuz1
lda.z count
bne !+
dec.z count+1
!:
dec.z count
// [14] phi from main::@7 to main::@1 [phi:main::@7->main::@1]
// [14] phi main::count#2 = main::count#1 [phi:main::@7->main::@1#0] -- register_copy
jmp __b1
}
// makechar
makechar: {
.label __3 = 8
.label __4 = $a
.label __7 = $11
.label __8 = $11
.label s = $14
.label c = $b
.label i = $d
.label __10 = $11
// [27] phi from makechar to makechar::@1 [phi:makechar->makechar::@1]
// [27] phi makechar::c#3 = 0 [phi:makechar->makechar::@1#0] -- vwuz1=vbuc1
lda #<0
sta.z c
sta.z c+1
// makechar::@1
__b1:
// for (c = 0; c < 0x100; ++c)
// [28] if(makechar::c#3<$100) goto makechar::@2 -- vwuz1_lt_vwuc1_then_la1
lda.z c+1
cmp #>$100
bcc __b2
bne !+
lda.z c
cmp #<$100
bcc __b2
!:
// makechar::@return
// }
// [29] return
rts
// makechar::@2
__b2:
// s = sinetable[(char)c]
// [30] makechar::$9 = (char)makechar::c#3 -- vbuxx=_byte_vwuz1
ldx.z c
// [31] makechar::s#1 = sinetable[makechar::$9] -- vbuz1=pbuc1_derefidx_vbuxx
lda sinetable,x
sta.z s
// [32] phi from makechar::@2 to makechar::@3 [phi:makechar::@2->makechar::@3]
// [32] phi makechar::i#3 = 0 [phi:makechar::@2->makechar::@3#0] -- vbuz1=vbuc1
lda #0
sta.z i
// makechar::@3
__b3:
// for (i = 0; i < 8; ++i)
// [33] if(makechar::i#3<8) goto makechar::@5 -- vbuz1_lt_vbuc1_then_la1
lda.z i
cmp #8
bcc __b4
// makechar::@4
// for (c = 0; c < 0x100; ++c)
// [34] makechar::c#2 = ++ makechar::c#3 -- vwuz1=_inc_vwuz1
inc.z c
bne !+
inc.z c+1
!:
// [27] phi from makechar::@4 to makechar::@1 [phi:makechar::@4->makechar::@1]
// [27] phi makechar::c#3 = makechar::c#2 [phi:makechar::@4->makechar::@1#0] -- register_copy
jmp __b1
// [35] phi from makechar::@3 to makechar::@5 [phi:makechar::@3->makechar::@5]
__b4:
// [35] phi makechar::b#3 = 0 [phi:makechar::@3->makechar::@5#0] -- vbuyy=vbuc1
ldy #0
// [35] phi makechar::ii#3 = 0 [phi:makechar::@3->makechar::@5#1] -- vbuxx=vbuc1
ldx #0
// makechar::@5
__b5:
// for (ii = 0; ii < 8; ++ii)
// [36] if(makechar::ii#3<8) goto makechar::@6 -- vbuxx_lt_vbuc1_then_la1
cpx #8
bcc __b6
// makechar::@7
// c<<3
// [37] makechar::$7 = makechar::c#3 << 3 -- vwuz1=vwuz2_rol_3
lda.z c
asl
sta.z __7
lda.z c+1
rol
sta.z __7+1
asl.z __7
rol.z __7+1
asl.z __7
rol.z __7+1
// (c<<3) + i
// [38] makechar::$8 = makechar::$7 + makechar::i#3 -- vwuz1=vwuz1_plus_vbuz2
lda.z i
clc
adc.z __8
sta.z __8
bcc !+
inc.z __8+1
!:
// ((char*)CHARSET) [(c<<3) + i] = b
// [39] makechar::$10 = CHARSET + makechar::$8 -- pbuz1=pbuc1_plus_vwuz1
lda.z __10
clc
adc #<CHARSET
sta.z __10
lda.z __10+1
adc #>CHARSET
sta.z __10+1
// [40] *makechar::$10 = makechar::b#3 -- _deref_pbuz1=vbuyy
tya
ldy #0
sta (__10),y
// for (i = 0; i < 8; ++i)
// [41] makechar::i#2 = ++ makechar::i#3 -- vbuz1=_inc_vbuz1
inc.z i
// [32] phi from makechar::@7 to makechar::@3 [phi:makechar::@7->makechar::@3]
// [32] phi makechar::i#3 = makechar::i#2 [phi:makechar::@7->makechar::@3#0] -- register_copy
jmp __b3
// [42] phi from makechar::@5 to makechar::@6 [phi:makechar::@5->makechar::@6]
// makechar::@6
__b6:
// rand()
// [43] call rand
jsr rand
// [44] rand::return#2 = rand::return#0
// makechar::@10
// [45] makechar::$3 = rand::return#2
// rand() & 0xFF
// [46] makechar::$4 = makechar::$3 & $ff -- vbuz1=vwuz2_band_vbuc1
lda #$ff
and.z __3
sta.z __4
// if ((rand() & 0xFF) > s)
// [47] if(makechar::$4<=makechar::s#1) goto makechar::@8 -- vbuz1_le_vbuz2_then_la1
lda.z s
cmp.z __4
bcs __b8
// makechar::@9
// b |= bittab[ii]
// [48] makechar::b#2 = makechar::b#3 | bittab[makechar::ii#3] -- vbuyy=vbuyy_bor_pbuc1_derefidx_vbuxx
tya
ora bittab,x
tay
// [49] phi from makechar::@10 makechar::@9 to makechar::@8 [phi:makechar::@10/makechar::@9->makechar::@8]
// [49] phi makechar::b#7 = makechar::b#3 [phi:makechar::@10/makechar::@9->makechar::@8#0] -- register_copy
// makechar::@8
__b8:
// for (ii = 0; ii < 8; ++ii)
// [50] makechar::ii#2 = ++ makechar::ii#3 -- vbuxx=_inc_vbuxx
inx
// [35] phi from makechar::@8 to makechar::@5 [phi:makechar::@8->makechar::@5]
// [35] phi makechar::b#3 = makechar::b#7 [phi:makechar::@8->makechar::@5#0] -- register_copy
// [35] phi makechar::ii#3 = makechar::ii#2 [phi:makechar::@8->makechar::@5#1] -- register_copy
jmp __b5
}
// start
start: {
.label LAST_TIME = last_time
// asm
// asm { jsr$FFDE staLAST_TIME stxLAST_TIME+1 }
jsr $ffde
sta LAST_TIME
stx LAST_TIME+1
// start::@return
// }
// [52] return
rts
}
// end
end: {
// Ticks = last_time
// [53] Ticks#0 = last_time -- vwuz1=vwuz2
lda.z last_time
sta.z Ticks
lda.z last_time+1
sta.z Ticks+1
// start()
// [54] call start
jsr start
// end::@1
// last_time -= Ticks
// [55] last_time = last_time - Ticks#0 -- vwuz1=vwuz1_minus_vwuz2
lda.z last_time
sec
sbc.z Ticks
sta.z last_time
lda.z last_time+1
sbc.z Ticks+1
sta.z last_time+1
// Ticks = last_time
// [56] Ticks#1 = last_time -- vwuz1=vwuz2
lda.z last_time
sta.z Ticks_1
lda.z last_time+1
sta.z Ticks_1+1
// print_uint(Ticks)
// [57] print_uint::w#0 = Ticks#1
// [58] call print_uint
jsr print_uint
// [59] phi from end::@1 to end::@2 [phi:end::@1->end::@2]
// end::@2
// print_ln()
// [60] call print_ln
// [100] phi from end::@2 to print_ln [phi:end::@2->print_ln]
jsr print_ln
// end::@return
// }
// [61] return
rts
}
// doplasma
// void doplasma(__zp($b) char *scrn)
doplasma: {
.const c2A = 0
.const c2B = 0
.label c1a = $14
.label c1b = $a
.label ii = $d
.label c2a = $15
.label c2b = $13
.label i = $10
.label scrn = $b
// [63] phi from doplasma to doplasma::@1 [phi:doplasma->doplasma::@1]
// [63] phi doplasma::c1b#3 = 0 [phi:doplasma->doplasma::@1#0] -- vbuz1=vbuc1
lda #0
sta.z c1b
// [63] phi doplasma::c1a#3 = 0 [phi:doplasma->doplasma::@1#1] -- vbuz1=vbuc1
sta.z c1a
// [63] phi doplasma::ii#3 = 0 [phi:doplasma->doplasma::@1#2] -- vbuz1=vbuc1
sta.z ii
// doplasma::@1
__b1:
// for (ii = 0; ii < 25; ++ii)
// [64] if(doplasma::ii#3<$19) goto doplasma::@2 -- vbuz1_lt_vbuc1_then_la1
lda.z ii
cmp #$19
bcc __b2
// [65] phi from doplasma::@1 to doplasma::@3 [phi:doplasma::@1->doplasma::@3]
// [65] phi doplasma::c2b#3 = doplasma::c2B#0 [phi:doplasma::@1->doplasma::@3#0] -- vbuz1=vbuc1
lda #c2B
sta.z c2b
// [65] phi doplasma::c2a#3 = doplasma::c2A#0 [phi:doplasma::@1->doplasma::@3#1] -- vbuz1=vbuc1
lda #c2A
sta.z c2a
// [65] phi doplasma::i#3 = 0 [phi:doplasma::@1->doplasma::@3#2] -- vbuz1=vbuc1
lda #0
sta.z i
// doplasma::@3
__b3:
// for (i = 0; i < 40; ++i)
// [66] if(doplasma::i#3<$28) goto doplasma::@4 -- vbuz1_lt_vbuc1_then_la1
lda.z i
cmp #$28
bcc __b4
// [67] phi from doplasma::@3 to doplasma::@5 [phi:doplasma::@3->doplasma::@5]
// [67] phi doplasma::scrn#6 = doplasma::scrn#13 [phi:doplasma::@3->doplasma::@5#0] -- register_copy
// [67] phi doplasma::jj#3 = 0 [phi:doplasma::@3->doplasma::@5#1] -- vbuxx=vbuc1
ldx #0
// doplasma::@5
__b5:
// for (jj = 0; jj < 25; ++jj)
// [68] if(doplasma::jj#3<$19) goto doplasma::@6 -- vbuxx_lt_vbuc1_then_la1
cpx #$19
bcc __b8
// doplasma::@return
// }
// [69] return
rts
// [70] phi from doplasma::@5 to doplasma::@6 [phi:doplasma::@5->doplasma::@6]
__b8:
// [70] phi doplasma::j#3 = 0 [phi:doplasma::@5->doplasma::@6#0] -- vbuyy=vbuc1
ldy #0
// doplasma::@6
__b6:
// for (j = 0; j < 40; ++j)
// [71] if(doplasma::j#3<$28) goto doplasma::@7 -- vbuyy_lt_vbuc1_then_la1
cpy #$28
bcc __b7
// doplasma::@8
// scrn += 40
// [72] doplasma::scrn#0 = doplasma::scrn#6 + $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc.z scrn
sta.z scrn
bcc !+
inc.z scrn+1
!:
// for (jj = 0; jj < 25; ++jj)
// [73] doplasma::jj#2 = ++ doplasma::jj#3 -- vbuxx=_inc_vbuxx
inx
// [67] phi from doplasma::@8 to doplasma::@5 [phi:doplasma::@8->doplasma::@5]
// [67] phi doplasma::scrn#6 = doplasma::scrn#0 [phi:doplasma::@8->doplasma::@5#0] -- register_copy
// [67] phi doplasma::jj#3 = doplasma::jj#2 [phi:doplasma::@8->doplasma::@5#1] -- register_copy
jmp __b5
// doplasma::@7
__b7:
// xbuf[j] + ybuf[jj]
// [74] doplasma::$6 = xbuf[doplasma::j#3] + ybuf[doplasma::jj#3] -- vbuaa=pbuc1_derefidx_vbuyy_plus_pbuc2_derefidx_vbuxx
lda xbuf,y
clc
adc ybuf,x
// scrn[j] = (xbuf[j] + ybuf[jj])
// [75] doplasma::scrn#6[doplasma::j#3] = doplasma::$6 -- pbuz1_derefidx_vbuyy=vbuaa
sta (scrn),y
// for (j = 0; j < 40; ++j)
// [76] doplasma::j#2 = ++ doplasma::j#3 -- vbuyy=_inc_vbuyy
iny
// [70] phi from doplasma::@7 to doplasma::@6 [phi:doplasma::@7->doplasma::@6]
// [70] phi doplasma::j#3 = doplasma::j#2 [phi:doplasma::@7->doplasma::@6#0] -- register_copy
jmp __b6
// doplasma::@4
__b4:
// sinetable[c2a] + sinetable[c2b]
// [77] doplasma::$3 = sinetable[doplasma::c2a#3] + sinetable[doplasma::c2b#3] -- vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc1_derefidx_vbuz2
ldy.z c2a
lda sinetable,y
ldy.z c2b
clc
adc sinetable,y
// xbuf[i] = (sinetable[c2a] + sinetable[c2b])
// [78] xbuf[doplasma::i#3] = doplasma::$3 -- pbuc1_derefidx_vbuz1=vbuaa
ldy.z i
sta xbuf,y
// c2a += 3
// [79] doplasma::c2a#2 = doplasma::c2a#3 + 3 -- vbuz1=vbuz1_plus_vbuc1
lax.z c2a
axs #-[3]
stx.z c2a
// c2b += 7
// [80] doplasma::c2b#2 = doplasma::c2b#3 + 7 -- vbuz1=vbuz1_plus_vbuc1
lax.z c2b
axs #-[7]
stx.z c2b
// for (i = 0; i < 40; ++i)
// [81] doplasma::i#2 = ++ doplasma::i#3 -- vbuz1=_inc_vbuz1
inc.z i
// [65] phi from doplasma::@4 to doplasma::@3 [phi:doplasma::@4->doplasma::@3]
// [65] phi doplasma::c2b#3 = doplasma::c2b#2 [phi:doplasma::@4->doplasma::@3#0] -- register_copy
// [65] phi doplasma::c2a#3 = doplasma::c2a#2 [phi:doplasma::@4->doplasma::@3#1] -- register_copy
// [65] phi doplasma::i#3 = doplasma::i#2 [phi:doplasma::@4->doplasma::@3#2] -- register_copy
jmp __b3
// doplasma::@2
__b2:
// sinetable[c1a] + sinetable[c1b]
// [82] doplasma::$1 = sinetable[doplasma::c1a#3] + sinetable[doplasma::c1b#3] -- vbuaa=pbuc1_derefidx_vbuz1_plus_pbuc1_derefidx_vbuz2
ldy.z c1a
lda sinetable,y
ldy.z c1b
clc
adc sinetable,y
// ybuf[ii] = (sinetable[c1a] + sinetable[c1b])
// [83] ybuf[doplasma::ii#3] = doplasma::$1 -- pbuc1_derefidx_vbuz1=vbuaa
ldy.z ii
sta ybuf,y
// c1a += 4
// [84] doplasma::c1a#2 = doplasma::c1a#3 + 4 -- vbuz1=vbuz1_plus_vbuc1
lax.z c1a
axs #-[4]
stx.z c1a
// c1b += 9
// [85] doplasma::c1b#2 = doplasma::c1b#3 + 9 -- vbuz1=vbuz1_plus_vbuc1
lax.z c1b
axs #-[9]
stx.z c1b
// for (ii = 0; ii < 25; ++ii)
// [86] doplasma::ii#2 = ++ doplasma::ii#3 -- vbuz1=_inc_vbuz1
inc.z ii
// [63] phi from doplasma::@2 to doplasma::@1 [phi:doplasma::@2->doplasma::@1]
// [63] phi doplasma::c1b#3 = doplasma::c1b#2 [phi:doplasma::@2->doplasma::@1#0] -- register_copy
// [63] phi doplasma::c1a#3 = doplasma::c1a#2 [phi:doplasma::@2->doplasma::@1#1] -- register_copy
// [63] phi doplasma::ii#3 = doplasma::ii#2 [phi:doplasma::@2->doplasma::@1#2] -- register_copy
jmp __b1
}
// rand
// Returns a pseudo-random number in the range of 0 to RAND_MAX (65535)
// Uses an xorshift pseudorandom number generator that hits all different values
// Information https://en.wikipedia.org/wiki/Xorshift
// Source http://www.retroprogramming.com/2017/07/xorshift-pseudorandom-numbers-in-z80.html
rand: {
.label __0 = 2
.label __1 = 4
.label __2 = 6
.label return = 8
// rand_state << 7
// [87] rand::$0 = rand_state << 7 -- vwuz1=vwuz2_rol_7
lda.z rand_state+1
lsr
lda.z rand_state
ror
sta.z __0+1
lda #0
ror
sta.z __0
// rand_state ^= rand_state << 7
// [88] rand_state = rand_state ^ rand::$0 -- vwuz1=vwuz1_bxor_vwuz2
lda.z rand_state
eor.z __0
sta.z rand_state
lda.z rand_state+1
eor.z __0+1
sta.z rand_state+1
// rand_state >> 9
// [89] rand::$1 = rand_state >> 9 -- vwuz1=vwuz2_ror_9
lsr
sta.z __1
lda #0
sta.z __1+1
// rand_state ^= rand_state >> 9
// [90] rand_state = rand_state ^ rand::$1 -- vwuz1=vwuz1_bxor_vwuz2
lda.z rand_state
eor.z __1
sta.z rand_state
lda.z rand_state+1
eor.z __1+1
sta.z rand_state+1
// rand_state << 8
// [91] rand::$2 = rand_state << 8 -- vwuz1=vwuz2_rol_8
lda.z rand_state
sta.z __2+1
lda #0
sta.z __2
// rand_state ^= rand_state << 8
// [92] rand_state = rand_state ^ rand::$2 -- vwuz1=vwuz1_bxor_vwuz2
lda.z rand_state
eor.z __2
sta.z rand_state
lda.z rand_state+1
eor.z __2+1
sta.z rand_state+1
// return rand_state;
// [93] rand::return#0 = rand_state -- vwuz1=vwuz2
lda.z rand_state
sta.z return
lda.z rand_state+1
sta.z return+1
// rand::@return
// }
// [94] return
rts
}
// print_uint
// Print a unsigned int as HEX
// void print_uint(__zp(2) unsigned int w)
print_uint: {
.label w = 2
// print_uchar(BYTE1(w))
// [95] print_uchar::b#0 = byte1 print_uint::w#0 -- vbuxx=_byte1_vwuz1
ldx.z w+1
// [96] call print_uchar
// [105] phi from print_uint to print_uchar [phi:print_uint->print_uchar]
// [105] phi print_char_cursor#37 = print_screen#0 [phi:print_uint->print_uchar#0] -- pbuz1=pbuc1
lda #<print_screen
sta.z print_char_cursor
lda #>print_screen
sta.z print_char_cursor+1
// [105] phi print_uchar::b#2 = print_uchar::b#0 [phi:print_uint->print_uchar#1] -- register_copy
jsr print_uchar
// print_uint::@1
// print_uchar(BYTE0(w))
// [97] print_uchar::b#1 = byte0 print_uint::w#0 -- vbuxx=_byte0_vwuz1
ldx.z w
// [98] call print_uchar
// [105] phi from print_uint::@1 to print_uchar [phi:print_uint::@1->print_uchar]
// [105] phi print_char_cursor#37 = print_char_cursor#27 [phi:print_uint::@1->print_uchar#0] -- register_copy
// [105] phi print_uchar::b#2 = print_uchar::b#1 [phi:print_uint::@1->print_uchar#1] -- register_copy
jsr print_uchar
// print_uint::@return
// }
// [99] return
rts
}
// print_ln
// Print a newline
print_ln: {
// [101] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1]
// [101] phi print_line_cursor#9 = print_screen#0 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1
lda #<print_screen
sta.z print_line_cursor
lda #>print_screen
sta.z print_line_cursor+1
// [101] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1]
// [101] phi print_line_cursor#9 = print_line_cursor#0 [phi:print_ln::@1->print_ln::@1#0] -- register_copy
// print_ln::@1
__b1:
// print_line_cursor + 0x28
// [102] print_line_cursor#0 = print_line_cursor#9 + $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc.z print_line_cursor
sta.z print_line_cursor
bcc !+
inc.z print_line_cursor+1
!:
// while (print_line_cursor<print_char_cursor)
// [103] if(print_line_cursor#0<print_char_cursor#27) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1
lda.z print_line_cursor+1
cmp.z print_char_cursor+1
bcc __b1
bne !+
lda.z print_line_cursor
cmp.z print_char_cursor
bcc __b1
!:
// print_ln::@return
// }
// [104] return
rts
}
// print_uchar
// Print a char as HEX
// void print_uchar(__register(X) char b)
print_uchar: {
// b>>4
// [106] print_uchar::$0 = print_uchar::b#2 >> 4 -- vbuaa=vbuxx_ror_4
txa
lsr
lsr
lsr
lsr
// print_char(print_hextab[b>>4])
// [107] print_char::ch#0 = print_hextab[print_uchar::$0] -- vbuaa=pbuc1_derefidx_vbuaa
tay
lda print_hextab,y
// [108] call print_char
// Table of hexadecimal digits
// [113] phi from print_uchar to print_char [phi:print_uchar->print_char]
// [113] phi print_char_cursor#26 = print_char_cursor#37 [phi:print_uchar->print_char#0] -- register_copy
// [113] phi print_char::ch#2 = print_char::ch#0 [phi:print_uchar->print_char#1] -- register_copy
jsr print_char
// print_uchar::@1
// b&0xf
// [109] print_uchar::$2 = print_uchar::b#2 & $f -- vbuxx=vbuxx_band_vbuc1
lda #$f
axs #0
// print_char(print_hextab[b&0xf])
// [110] print_char::ch#1 = print_hextab[print_uchar::$2] -- vbuaa=pbuc1_derefidx_vbuxx
lda print_hextab,x
// [111] call print_char
// [113] phi from print_uchar::@1 to print_char [phi:print_uchar::@1->print_char]
// [113] phi print_char_cursor#26 = print_char_cursor#27 [phi:print_uchar::@1->print_char#0] -- register_copy
// [113] phi print_char::ch#2 = print_char::ch#1 [phi:print_uchar::@1->print_char#1] -- register_copy
jsr print_char
// print_uchar::@return
// }
// [112] return
rts
}
// print_char
// Print a single char
// void print_char(__register(A) char ch)
print_char: {
// *(print_char_cursor++) = ch
// [114] *print_char_cursor#26 = print_char::ch#2 -- _deref_pbuz1=vbuaa
ldy #0
sta (print_char_cursor),y
// *(print_char_cursor++) = ch;
// [115] print_char_cursor#27 = ++ print_char_cursor#26 -- pbuz1=_inc_pbuz1
inc.z print_char_cursor
bne !+
inc.z print_char_cursor+1
!:
// print_char::@return
// }
// [116] return
rts
}
// File Data
.segment Data
print_hextab: .text "0123456789abcdef"
.align $100
sinetable: .byte $80, $7d, $7a, $77, $74, $70, $6d, $6a, $67, $64, $61, $5e, $5b, $58, $55, $52, $4f, $4d, $4a, $47, $44, $41, $3f, $3c, $39, $37, $34, $32, $2f, $2d, $2b, $28, $26, $24, $22, $20, $1e, $1c, $1a, $18, $16, $15, $13, $11, $10, $f, $d, $c, $b, $a, 8, 7, 6, 6, 5, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 6, 7, 8, $a, $b, $c, $d, $f, $10, $11, $13, $15, $16, $18, $1a, $1c, $1e, $20, $22, $24, $26, $28, $2b, $2d, $2f, $32, $34, $37, $39, $3c, $3f, $41, $44, $47, $4a, $4d, $4f, $52, $55, $58, $5b, $5e, $61, $64, $67, $6a, $6d, $70, $74, $77, $7a, $7d, $80, $83, $86, $89, $8c, $90, $93, $96, $99, $9c, $9f, $a2, $a5, $a8, $ab, $ae, $b1, $b3, $b6, $b9, $bc, $bf, $c1, $c4, $c7, $c9, $cc, $ce, $d1, $d3, $d5, $d8, $da, $dc, $de, $e0, $e2, $e4, $e6, $e8, $ea, $eb, $ed, $ef, $f0, $f1, $f3, $f4, $f5, $f6, $f8, $f9, $fa, $fa, $fb, $fc, $fd, $fd, $fe, $fe, $fe, $ff, $ff, $ff, $ff, $ff, $ff, $ff, $fe, $fe, $fe, $fd, $fd, $fc, $fb, $fa, $fa, $f9, $f8, $f6, $f5, $f4, $f3, $f1, $f0, $ef, $ed, $eb, $ea, $e8, $e6, $e4, $e2, $e0, $de, $dc, $da, $d8, $d5, $d3, $d1, $ce, $cc, $c9, $c7, $c4, $c1, $bf, $bc, $b9, $b6, $b3, $b1, $ae, $ab, $a8, $a5, $a2, $9f, $9c, $99, $96, $93, $90, $8c, $89, $86, $83
xbuf: .fill $28, 0
ybuf: .fill $19, 0
bittab: .byte 1, 2, 4, 8, $10, $20, $40, $80