1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-08-02 09:29:35 +00:00

A bit more line anim - work in (early) progress. Added inlined toD018() and toDd00().

This commit is contained in:
jespergravgaard 2018-05-14 23:53:03 +02:00
parent a7b751a9fd
commit 68cba8f9af
51 changed files with 8251 additions and 2858 deletions

View File

@ -0,0 +1,8 @@
lda {z2}
asl
sta {z1}
lda {z2}+1
rol
sta {z1}+1
asl {z1}
rol {z1}+1

View File

@ -35,8 +35,8 @@ public class Operators {
public static final OperatorBinary MINUS = new OperatorMinus(4);
public static final OperatorBinary SHIFT_LEFT = new OperatorShiftLeft(5);
public static final OperatorBinary SHIFT_RIGHT = new OperatorShiftRight(5);
public static final OperatorUnary LOWBYTE = new OperatorGetLow(6);
public static final OperatorUnary HIBYTE = new OperatorGetHigh(6);
public static final OperatorUnary LOWBYTE = new OperatorGetLow(14);
public static final OperatorUnary HIBYTE = new OperatorGetHigh(14);
public static final OperatorBinary LT = new OperatorLessThan(7);
public static final OperatorBinary LE = new OperatorLessThanEqual(7);
public static final OperatorBinary GT = new OperatorGreaterThan(7);

View File

@ -91,3 +91,21 @@ const byte GREY = $c;
const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}

View File

@ -1,8 +1,8 @@
// Animated lines drawn on a single color bitmap
import "c64.kc"
byte* BITMAP = $2000;
byte* SCREEN = $400;
byte* BITMAP = $a000;
byte* SCREEN = $8800;
// The number of points
const byte SIZE = 4;
@ -29,10 +29,16 @@ byte[4] delay;
byte[4] frame;
void main() {
asm { sei } // Disable normal interrupt
// Disable kernal & basic
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
*D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3;
*VIC_MEMORY = (byte)((((word)SCREEN&$3fff)/$40)|(((word)BITMAP&$3fff)/$400));
vicSelectGfxBank(SCREEN);
*D018 = toD018(SCREEN, BITMAP);
bitmap_init(BITMAP);
bitmap_clear();
screen_fill(SCREEN, $10);
for( byte i=0; i!=8; i+=2) {
point_init(i);
bitmap_plot(x_start[i], y_start[i>>1]);
@ -42,12 +48,22 @@ void main() {
}
}
// Initialize the points to be animated
void point_init(byte point_idx) {
x_cur[point_idx] = x_start[point_idx]<<4;
y_cur[point_idx] = ((word)y_start[point_idx>>1])<<4;
delay[point_idx>>1] = DELAY;
}
// Fill the screen with a specific char
void screen_fill(byte* screen, byte ch) {
for( byte y: 0..24) {
for(byte x:0..39) {
*screen++ = ch;
}
}
}
// Tables for the plotter - initialized by calling bitmap_draw_init();
const byte[256] bitmap_plot_ylo;
const byte[256] bitmap_plot_yhi;
@ -85,7 +101,7 @@ void bitmap_clear() {
// Plot a single dot in the bitmap
void bitmap_plot(word x, byte y) {
byte* plotter = (byte*) { bitmap_plot_yhi[y], bitmap_plot_ylo[y] };
plotter += ( x & $fff7 );
plotter += ( x & $fff8 );
*plotter |= bitmap_plot_bit[<x];
}

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@11
@11: scope:[] from @begin
to:@14
@14: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @11
@end: scope:[] from @14
[3] phi() [ ] ( )
main: scope:[main] from @11
main: scope:[main] from @14
[4] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] )
[5] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] )
[6] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] )

View File

@ -130,6 +130,24 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Importing bitmap-draw.kc
PARSING src/test/java/dk/camelot64/kickc/test/kc/bitmap-draw.kc
// Plot and line drawing routines for HIRES bitmaps
@ -293,6 +311,9 @@ SYMBOLS
(label) @1
(label) @10
(label) @11
(label) @12
(label) @13
(label) @14
(label) @2
(label) @3
(label) @4
@ -602,6 +623,34 @@ SYMBOLS
(label) main::@1
(label) main::@2
(label) main::@return
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -710,12 +759,57 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte[256]) bitmap_plot_xlo ← { fill( 256, 0) }
(byte[256]) bitmap_plot_xhi ← { fill( 256, 0) }
(byte[256]) bitmap_plot_ylo ← { fill( 256, 0) }
(byte[256]) bitmap_plot_yhi ← { fill( 256, 0) }
(byte[256]) bitmap_plot_bit ← { fill( 256, 0) }
to:@1
to:@4
bitmap_init: scope:[bitmap_init] from
(byte) bitmap_init::bits ← (byte/word/signed word/dword/signed dword) 128
(byte) bitmap_init::x ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -771,8 +865,8 @@ bitmap_init::@8: scope:[bitmap_init] from bitmap_init::@4
bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@8
return
to:@return
@1: scope:[] from @begin
to:@2
@4: scope:[] from @3
to:@5
bitmap_clear: scope:[bitmap_clear] from
(byte*~) bitmap_clear::$0 ← ((byte*)) { *((byte[256]) bitmap_plot_xhi + (byte/signed byte/word/signed word/dword/signed dword) 0), *((byte[256]) bitmap_plot_xlo + (byte/signed byte/word/signed word/dword/signed dword) 0) }
(byte*) bitmap_clear::bitmap ← (byte*~) bitmap_clear::$0
@ -798,8 +892,8 @@ bitmap_clear::@4: scope:[bitmap_clear] from bitmap_clear::@3
bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@4
return
to:@return
@2: scope:[] from @1
to:@3
@5: scope:[] from @4
to:@6
bitmap_plot: scope:[bitmap_plot] from
(word) bitmap_plot::plotter_x ← { *((byte[256]) bitmap_plot_xhi + (byte) bitmap_plot::x), *((byte[256]) bitmap_plot_xlo + (byte) bitmap_plot::x) }
(word) bitmap_plot::plotter_y ← { *((byte[256]) bitmap_plot_yhi + (byte) bitmap_plot::y), *((byte[256]) bitmap_plot_ylo + (byte) bitmap_plot::y) }
@ -811,8 +905,8 @@ bitmap_plot: scope:[bitmap_plot] from
bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot
return
to:@return
@3: scope:[] from @2
to:@4
@6: scope:[] from @5
to:@7
bitmap_line: scope:[bitmap_line] from
(bool~) bitmap_line::$0 ← (byte) bitmap_line::x0 < (byte) bitmap_line::x1
if((bool~) bitmap_line::$0) goto bitmap_line::@1
@ -908,8 +1002,8 @@ bitmap_line::@28: scope:[bitmap_line] from
bitmap_line::@return: scope:[bitmap_line] from bitmap_line::@8
return
to:@return
@4: scope:[] from @3
to:@5
@7: scope:[] from @6
to:@8
bitmap_line_xdyi: scope:[bitmap_line_xdyi] from
(byte~) bitmap_line_xdyi::$0 ← (byte) bitmap_line_xdyi::yd >> (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) bitmap_line_xdyi::e ← (byte~) bitmap_line_xdyi::$0
@ -938,8 +1032,8 @@ bitmap_line_xdyi::@4: scope:[bitmap_line_xdyi] from bitmap_line_xdyi::@2
bitmap_line_xdyi::@return: scope:[bitmap_line_xdyi] from bitmap_line_xdyi::@4
return
to:@return
@5: scope:[] from @4
to:@6
@8: scope:[] from @7
to:@9
bitmap_line_xdyd: scope:[bitmap_line_xdyd] from
(byte~) bitmap_line_xdyd::$0 ← (byte) bitmap_line_xdyd::yd >> (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) bitmap_line_xdyd::e ← (byte~) bitmap_line_xdyd::$0
@ -968,8 +1062,8 @@ bitmap_line_xdyd::@4: scope:[bitmap_line_xdyd] from bitmap_line_xdyd::@2
bitmap_line_xdyd::@return: scope:[bitmap_line_xdyd] from bitmap_line_xdyd::@4
return
to:@return
@6: scope:[] from @5
to:@7
@9: scope:[] from @8
to:@10
bitmap_line_ydxi: scope:[bitmap_line_ydxi] from
(byte~) bitmap_line_ydxi::$0 ← (byte) bitmap_line_ydxi::xd >> (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) bitmap_line_ydxi::e ← (byte~) bitmap_line_ydxi::$0
@ -998,8 +1092,8 @@ bitmap_line_ydxi::@4: scope:[bitmap_line_ydxi] from bitmap_line_ydxi::@2
bitmap_line_ydxi::@return: scope:[bitmap_line_ydxi] from bitmap_line_ydxi::@4
return
to:@return
@7: scope:[] from @6
to:@8
@10: scope:[] from @9
to:@11
bitmap_line_ydxd: scope:[bitmap_line_ydxd] from
(byte~) bitmap_line_ydxd::$0 ← (byte) bitmap_line_ydxd::xd >> (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) bitmap_line_ydxd::e ← (byte~) bitmap_line_ydxd::$0
@ -1029,13 +1123,13 @@ bitmap_line_ydxd::@4: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2
bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@4
return
to:@return
@8: scope:[] from @7
@11: scope:[] from @10
(byte*) SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024
(byte*) BITMAP ← ((byte*)) (word/signed word/dword/signed dword) 8192
(byte[]) lines_x ← { (byte/signed byte/word/signed word/dword/signed dword) 60, (byte/signed byte/word/signed word/dword/signed dword) 80, (byte/signed byte/word/signed word/dword/signed dword) 110, (byte/signed byte/word/signed word/dword/signed dword) 80, (byte/signed byte/word/signed word/dword/signed dword) 60, (byte/signed byte/word/signed word/dword/signed dword) 40, (byte/signed byte/word/signed word/dword/signed dword) 10, (byte/signed byte/word/signed word/dword/signed dword) 40, (byte/signed byte/word/signed word/dword/signed dword) 60 }
(byte[]) lines_y ← { (byte/signed byte/word/signed word/dword/signed dword) 10, (byte/signed byte/word/signed word/dword/signed dword) 40, (byte/signed byte/word/signed word/dword/signed dword) 60, (byte/signed byte/word/signed word/dword/signed dword) 80, (byte/signed byte/word/signed word/dword/signed dword) 110, (byte/signed byte/word/signed word/dword/signed dword) 80, (byte/signed byte/word/signed word/dword/signed dword) 60, (byte/signed byte/word/signed word/dword/signed dword) 40, (byte/signed byte/word/signed word/dword/signed dword) 10 }
(byte) lines_cnt ← (byte/signed byte/word/signed word/dword/signed dword) 8
to:@9
to:@12
main: scope:[main] from
*((byte*) BORDERCOL) ← (byte/signed byte/word/signed word/dword/signed dword) 0
*((byte*) BGCOL) ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1065,8 +1159,8 @@ main::@2: scope:[main] from main::@1
main::@return: scope:[main] from main::@2
return
to:@return
@9: scope:[] from @8
to:@10
@12: scope:[] from @11
to:@13
lines: scope:[lines] from
(byte) lines::l ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:lines::@1
@ -1083,8 +1177,8 @@ lines::@2: scope:[lines] from lines::@1
lines::@return: scope:[lines] from lines::@2
return
to:@return
@10: scope:[] from @9
to:@11
@13: scope:[] from @12
to:@14
init_screen: scope:[init_screen] from
(byte*) init_screen::c ← (byte*) SCREEN
to:init_screen::@1
@ -1100,11 +1194,15 @@ init_screen::@2: scope:[init_screen] from init_screen::@1
init_screen::@return: scope:[init_screen] from init_screen::@2
return
to:@return
@11: scope:[] from @10
@14: scope:[] from @13
call main
to:@end
@end: scope:[] from @11
@end: scope:[] from @14
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Eliminating unused variable (byte*) PROCPORT_DDR and assignment [0] (byte*) PROCPORT_DDR ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0
Eliminating unused variable (byte) PROCPORT_DDR_MEMORY_MASK and assignment [1] (byte) PROCPORT_DDR_MEMORY_MASK ← (byte/signed byte/word/signed word/dword/signed dword) 7
Eliminating unused variable (byte*) PROCPORT and assignment [2] (byte*) PROCPORT ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1
@ -1180,11 +1278,13 @@ Eliminating unused variable - keeping the call (void~) main::$12
Eliminating unused variable - keeping the call (void~) main::$13
Eliminating unused variable - keeping the call (void~) main::$14
Eliminating unused variable - keeping the call (void~) lines::$2
Removing empty block bitmap_init::@8
Removing empty block @1
Removing empty block bitmap_clear::@4
Removing empty block @2
Removing empty block @3
Removing empty block bitmap_init::@8
Removing empty block @4
Removing empty block bitmap_clear::@4
Removing empty block @5
Removing empty block @6
Removing empty block bitmap_line::@4
Removing empty block bitmap_line::@18
Removing empty block bitmap_line::@5
@ -1199,18 +1299,18 @@ Removing empty block bitmap_line::@12
Removing empty block bitmap_line::@26
Removing empty block bitmap_line::@14
Removing empty block bitmap_line::@28
Removing empty block @4
Removing empty block bitmap_line_xdyi::@4
Removing empty block @5
Removing empty block bitmap_line_xdyd::@4
Removing empty block @6
Removing empty block bitmap_line_ydxi::@4
Removing empty block @7
Removing empty block bitmap_line_xdyi::@4
Removing empty block @8
Removing empty block bitmap_line_xdyd::@4
Removing empty block @9
Removing empty block bitmap_line_ydxi::@4
Removing empty block @10
Removing empty block bitmap_line_ydxd::@4
Removing empty block main::@2
Removing empty block @9
Removing empty block @12
Removing empty block lines::@2
Removing empty block @10
Removing empty block @13
Removing empty block init_screen::@2
PROCEDURE MODIFY VARIABLE ANALYSIS
@ -1233,12 +1333,14 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte) VIC_DEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 16
(byte) VIC_RSEL#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte*) VIC_MEMORY#0 ← ((byte*)) (word/dword/signed dword) 53272
to:@3
@3: scope:[] from @begin
(byte[256]) bitmap_plot_xlo#0 ← { fill( 256, 0) }
(byte[256]) bitmap_plot_xhi#0 ← { fill( 256, 0) }
(byte[256]) bitmap_plot_ylo#0 ← { fill( 256, 0) }
(byte[256]) bitmap_plot_yhi#0 ← { fill( 256, 0) }
(byte[256]) bitmap_plot_bit#0 ← { fill( 256, 0) }
to:@8
to:@11
bitmap_init: scope:[bitmap_init] from main
(byte*) bitmap_init::bitmap#2 ← phi( main/(byte*) bitmap_init::bitmap#0 )
(byte) bitmap_init::bits#0 ← (byte/word/signed word/dword/signed dword) 128
@ -1782,15 +1884,15 @@ bitmap_line_ydxd::@3: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@5
bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2
return
to:@return
@8: scope:[] from @begin
@11: scope:[] from @3
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
(byte*) BITMAP#0 ← ((byte*)) (word/signed word/dword/signed dword) 8192
(byte[]) lines_x#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 60, (byte/signed byte/word/signed word/dword/signed dword) 80, (byte/signed byte/word/signed word/dword/signed dword) 110, (byte/signed byte/word/signed word/dword/signed dword) 80, (byte/signed byte/word/signed word/dword/signed dword) 60, (byte/signed byte/word/signed word/dword/signed dword) 40, (byte/signed byte/word/signed word/dword/signed dword) 10, (byte/signed byte/word/signed word/dword/signed dword) 40, (byte/signed byte/word/signed word/dword/signed dword) 60 }
(byte[]) lines_y#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 10, (byte/signed byte/word/signed word/dword/signed dword) 40, (byte/signed byte/word/signed word/dword/signed dword) 60, (byte/signed byte/word/signed word/dword/signed dword) 80, (byte/signed byte/word/signed word/dword/signed dword) 110, (byte/signed byte/word/signed word/dword/signed dword) 80, (byte/signed byte/word/signed word/dword/signed dword) 60, (byte/signed byte/word/signed word/dword/signed dword) 40, (byte/signed byte/word/signed word/dword/signed dword) 10 }
(byte) lines_cnt#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
to:@11
main: scope:[main] from @11
(byte) lines_cnt#9 ← phi( @11/(byte) lines_cnt#10 )
to:@14
main: scope:[main] from @14
(byte) lines_cnt#9 ← phi( @14/(byte) lines_cnt#10 )
*((byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
*((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte~) main::$0 ← (byte) VIC_BMM#0 | (byte) VIC_DEN#0
@ -1870,18 +1972,19 @@ init_screen::@1: scope:[init_screen] from init_screen init_screen::@1
init_screen::@return: scope:[init_screen] from init_screen::@1
return
to:@return
@11: scope:[] from @8
(byte) lines_cnt#10 ← phi( @8/(byte) lines_cnt#0 )
@14: scope:[] from @11
(byte) lines_cnt#10 ← phi( @11/(byte) lines_cnt#0 )
call main
to:@12
@12: scope:[] from @11
to:@15
@15: scope:[] from @14
to:@end
@end: scope:[] from @12
@end: scope:[] from @15
SYMBOL TABLE SSA
(label) @11
(label) @12
(label) @8
(label) @14
(label) @15
(label) @3
(label) @begin
(label) @end
(byte*) BGCOL
@ -2456,7 +2559,7 @@ Culled Empty Block (label) bitmap_line::@33
Culled Empty Block (label) bitmap_line::@34
Culled Empty Block (label) bitmap_line::@35
Culled Empty Block (label) bitmap_line::@36
Culled Empty Block (label) @12
Culled Empty Block (label) @15
Succesful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not (bool~) bitmap_init::$4 ← (byte) bitmap_init::bits#1 != (byte/signed byte/word/signed word/dword/signed dword) 0 from (bool~) bitmap_init::$3 ← (byte) bitmap_init::bits#1 == (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not (bool~) bitmap_init::$12 ← (byte~) bitmap_init::$10 != (byte/signed byte/word/signed word/dword/signed dword) 7 from (bool~) bitmap_init::$11 ← (byte~) bitmap_init::$10 == (byte/signed byte/word/signed word/dword/signed dword) 7
@ -2915,9 +3018,10 @@ Eliminating Noop Cast (byte*) bitmap_plot::plotter#0 ← ((byte*)) (word~) bitma
Succesful SSA optimization Pass2NopCastElimination
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) @3
Not culling empty block because it shares successor with its predecessor. (label) bitmap_init::@5
Culled Empty Block (label) bitmap_init::@6
Culled Empty Block (label) @8
Culled Empty Block (label) @11
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Succesful SSA optimization Pass2CullEmptyBlocks
@ -3187,7 +3291,7 @@ Constant inlined init_screen::$0 = (const byte*) SCREEN#0+(word/signed word/dwor
Constant inlined main::$8 = ((word))(const byte*) BITMAP#0&(word/signed word/dword/signed dword) 16383/(word/signed word/dword/signed dword) 1024
Constant inlined bitmap_init::bitmap#0 = (const byte*) BITMAP#0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @11 @end main main::@3 main::@4 main::@1 lines lines::@1 lines::@3 lines::@return bitmap_line bitmap_line::@15 bitmap_line::@16 bitmap_line::@17 bitmap_line::@return bitmap_line::@3 bitmap_line::@2 bitmap_line::@20 bitmap_line::@6 bitmap_line::@1 bitmap_line::@23 bitmap_line::@24 bitmap_line::@10 bitmap_line::@9 bitmap_line::@27 bitmap_line::@13 bitmap_line_xdyi bitmap_line_xdyi::@1 bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@2 bitmap_line_xdyi::@return bitmap_plot bitmap_plot::@return bitmap_line_ydxi bitmap_line_ydxi::@1 bitmap_line_ydxi::@5 bitmap_line_ydxi::@3 bitmap_line_ydxi::@2 bitmap_line_ydxi::@return bitmap_line_xdyd bitmap_line_xdyd::@1 bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@2 bitmap_line_xdyd::@return bitmap_line_ydxd bitmap_line_ydxd::@1 bitmap_line_ydxd::@5 bitmap_line_ydxd::@3 bitmap_line_ydxd::@2 bitmap_line_ydxd::@return init_screen init_screen::@1 init_screen::@return bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_init bitmap_init::@1 bitmap_init::@5 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return
Block Sequence Planned @begin @14 @end main main::@3 main::@4 main::@1 lines lines::@1 lines::@3 lines::@return bitmap_line bitmap_line::@15 bitmap_line::@16 bitmap_line::@17 bitmap_line::@return bitmap_line::@3 bitmap_line::@2 bitmap_line::@20 bitmap_line::@6 bitmap_line::@1 bitmap_line::@23 bitmap_line::@24 bitmap_line::@10 bitmap_line::@9 bitmap_line::@27 bitmap_line::@13 bitmap_line_xdyi bitmap_line_xdyi::@1 bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@2 bitmap_line_xdyi::@return bitmap_plot bitmap_plot::@return bitmap_line_ydxi bitmap_line_ydxi::@1 bitmap_line_ydxi::@5 bitmap_line_ydxi::@3 bitmap_line_ydxi::@2 bitmap_line_ydxi::@return bitmap_line_xdyd bitmap_line_xdyd::@1 bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@2 bitmap_line_xdyd::@return bitmap_line_ydxd bitmap_line_ydxd::@1 bitmap_line_ydxd::@5 bitmap_line_ydxd::@3 bitmap_line_ydxd::@2 bitmap_line_ydxd::@return init_screen init_screen::@1 init_screen::@return bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_init bitmap_init::@1 bitmap_init::@5 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return
Added new block during phi lifting lines::@4(between lines::@3 and lines::@1)
Added new block during phi lifting bitmap_line_xdyi::@6(between bitmap_line_xdyi::@2 and bitmap_line_xdyi::@1)
Added new block during phi lifting bitmap_line_xdyi::@7(between bitmap_line_xdyi::@5 and bitmap_line_xdyi::@2)
@ -3204,9 +3308,9 @@ Added new block during phi lifting bitmap_init::@9(between bitmap_init::@2 and b
Added new block during phi lifting bitmap_init::@10(between bitmap_init::@1 and bitmap_init::@2)
Added new block during phi lifting bitmap_init::@11(between bitmap_init::@4 and bitmap_init::@3)
Added new block during phi lifting bitmap_init::@12(between bitmap_init::@3 and bitmap_init::@4)
Block Sequence Planned @begin @11 @end main main::@3 main::@4 main::@1 lines lines::@1 lines::@3 lines::@return lines::@4 bitmap_line bitmap_line::@15 bitmap_line::@16 bitmap_line::@17 bitmap_line::@return bitmap_line::@3 bitmap_line::@2 bitmap_line::@20 bitmap_line::@6 bitmap_line::@1 bitmap_line::@23 bitmap_line::@24 bitmap_line::@10 bitmap_line::@9 bitmap_line::@27 bitmap_line::@13 bitmap_line_xdyi bitmap_line_xdyi::@1 bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@2 bitmap_line_xdyi::@return bitmap_line_xdyi::@6 bitmap_line_xdyi::@7 bitmap_plot bitmap_plot::@return bitmap_line_ydxi bitmap_line_ydxi::@1 bitmap_line_ydxi::@5 bitmap_line_ydxi::@3 bitmap_line_ydxi::@2 bitmap_line_ydxi::@return bitmap_line_ydxi::@6 bitmap_line_ydxi::@7 bitmap_line_xdyd bitmap_line_xdyd::@1 bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@2 bitmap_line_xdyd::@return bitmap_line_xdyd::@6 bitmap_line_xdyd::@7 bitmap_line_ydxd bitmap_line_ydxd::@1 bitmap_line_ydxd::@5 bitmap_line_ydxd::@3 bitmap_line_ydxd::@2 bitmap_line_ydxd::@return bitmap_line_ydxd::@6 bitmap_line_ydxd::@7 init_screen init_screen::@1 init_screen::@return init_screen::@3 bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_clear::@5 bitmap_clear::@6 bitmap_init bitmap_init::@1 bitmap_init::@5 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return bitmap_init::@11 bitmap_init::@12 bitmap_init::@9 bitmap_init::@10
Block Sequence Planned @begin @14 @end main main::@3 main::@4 main::@1 lines lines::@1 lines::@3 lines::@return lines::@4 bitmap_line bitmap_line::@15 bitmap_line::@16 bitmap_line::@17 bitmap_line::@return bitmap_line::@3 bitmap_line::@2 bitmap_line::@20 bitmap_line::@6 bitmap_line::@1 bitmap_line::@23 bitmap_line::@24 bitmap_line::@10 bitmap_line::@9 bitmap_line::@27 bitmap_line::@13 bitmap_line_xdyi bitmap_line_xdyi::@1 bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@2 bitmap_line_xdyi::@return bitmap_line_xdyi::@6 bitmap_line_xdyi::@7 bitmap_plot bitmap_plot::@return bitmap_line_ydxi bitmap_line_ydxi::@1 bitmap_line_ydxi::@5 bitmap_line_ydxi::@3 bitmap_line_ydxi::@2 bitmap_line_ydxi::@return bitmap_line_ydxi::@6 bitmap_line_ydxi::@7 bitmap_line_xdyd bitmap_line_xdyd::@1 bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@2 bitmap_line_xdyd::@return bitmap_line_xdyd::@6 bitmap_line_xdyd::@7 bitmap_line_ydxd bitmap_line_ydxd::@1 bitmap_line_ydxd::@5 bitmap_line_ydxd::@3 bitmap_line_ydxd::@2 bitmap_line_ydxd::@return bitmap_line_ydxd::@6 bitmap_line_ydxd::@7 init_screen init_screen::@1 init_screen::@return init_screen::@3 bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_clear::@5 bitmap_clear::@6 bitmap_init bitmap_init::@1 bitmap_init::@5 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return bitmap_init::@11 bitmap_init::@12 bitmap_init::@9 bitmap_init::@10
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @11
Adding NOP phi() at start of @14
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
@ -3363,9 +3467,9 @@ Culled Empty Block (label) bitmap_init::@11
Culled Empty Block (label) bitmap_init::@12
Culled Empty Block (label) bitmap_init::@9
Not culling empty block because it shares successor with its predecessor. (label) bitmap_init::@10
Block Sequence Planned @begin @11 @end main main::@3 main::@4 main::@1 lines lines::@1 lines::@3 lines::@return bitmap_line bitmap_line::@15 bitmap_line::@16 bitmap_line::@17 bitmap_line::@return bitmap_line::@3 bitmap_line::@2 bitmap_line::@20 bitmap_line::@6 bitmap_line::@1 bitmap_line::@23 bitmap_line::@24 bitmap_line::@10 bitmap_line::@9 bitmap_line::@27 bitmap_line::@13 bitmap_line_xdyi bitmap_line_xdyi::@1 bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@2 bitmap_line_xdyi::@return bitmap_plot bitmap_plot::@return bitmap_line_ydxi bitmap_line_ydxi::@1 bitmap_line_ydxi::@5 bitmap_line_ydxi::@3 bitmap_line_ydxi::@2 bitmap_line_ydxi::@return bitmap_line_xdyd bitmap_line_xdyd::@1 bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@2 bitmap_line_xdyd::@return bitmap_line_ydxd bitmap_line_ydxd::@1 bitmap_line_ydxd::@5 bitmap_line_ydxd::@3 bitmap_line_ydxd::@2 bitmap_line_ydxd::@return init_screen init_screen::@1 init_screen::@return bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_init bitmap_init::@1 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return bitmap_init::@10
Block Sequence Planned @begin @14 @end main main::@3 main::@4 main::@1 lines lines::@1 lines::@3 lines::@return bitmap_line bitmap_line::@15 bitmap_line::@16 bitmap_line::@17 bitmap_line::@return bitmap_line::@3 bitmap_line::@2 bitmap_line::@20 bitmap_line::@6 bitmap_line::@1 bitmap_line::@23 bitmap_line::@24 bitmap_line::@10 bitmap_line::@9 bitmap_line::@27 bitmap_line::@13 bitmap_line_xdyi bitmap_line_xdyi::@1 bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@2 bitmap_line_xdyi::@return bitmap_plot bitmap_plot::@return bitmap_line_ydxi bitmap_line_ydxi::@1 bitmap_line_ydxi::@5 bitmap_line_ydxi::@3 bitmap_line_ydxi::@2 bitmap_line_ydxi::@return bitmap_line_xdyd bitmap_line_xdyd::@1 bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@2 bitmap_line_xdyd::@return bitmap_line_ydxd bitmap_line_ydxd::@1 bitmap_line_ydxd::@5 bitmap_line_ydxd::@3 bitmap_line_ydxd::@2 bitmap_line_ydxd::@return init_screen init_screen::@1 init_screen::@return bitmap_clear bitmap_clear::@1 bitmap_clear::@2 bitmap_clear::@3 bitmap_clear::@return bitmap_init bitmap_init::@1 bitmap_init::@2 bitmap_init::@3 bitmap_init::@7 bitmap_init::@4 bitmap_init::@return bitmap_init::@10
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @11
Adding NOP phi() at start of @14
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
@ -3389,14 +3493,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@11
@11: scope:[] from @begin
to:@14
@14: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @11
@end: scope:[] from @14
[3] phi() [ ] ( )
main: scope:[main] from @11
main: scope:[main] from @14
[4] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] )
[5] *((const byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( main:2 [ ] )
[6] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] )
@ -3757,74 +3861,74 @@ bitmap_init::@10: scope:[bitmap_init] from bitmap_init::@1
DOMINATORS
@begin dominated by @begin
@11 dominated by @begin @11
@end dominated by @end @begin @11
main dominated by main @begin @11
main::@3 dominated by main main::@3 @begin @11
main::@4 dominated by main main::@3 main::@4 @begin @11
main::@1 dominated by main main::@1 main::@3 main::@4 @begin @11
lines dominated by main main::@1 main::@3 main::@4 @begin lines @11
lines::@1 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 lines @11
lines::@3 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 lines::@3 lines @11
lines::@return dominated by main main::@1 main::@3 main::@4 @begin lines::@return lines::@1 lines::@3 lines @11
bitmap_line dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @11
bitmap_line::@15 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@15 lines::@1 bitmap_line lines @11
bitmap_line::@16 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@16 bitmap_line::@15 lines::@1 bitmap_line lines @11
bitmap_line::@17 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@17 bitmap_line::@16 bitmap_line::@15 lines::@1 bitmap_line lines @11
bitmap_line::@return dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@return lines::@1 bitmap_line lines @11
bitmap_line::@3 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@16 bitmap_line::@15 lines::@1 bitmap_line::@3 bitmap_line lines @11
bitmap_line::@2 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@15 lines::@1 bitmap_line::@2 bitmap_line lines @11
bitmap_line::@20 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@15 bitmap_line::@20 lines::@1 bitmap_line::@2 bitmap_line lines @11
bitmap_line::@6 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@15 lines::@1 bitmap_line::@2 bitmap_line::@6 bitmap_line lines @11
bitmap_line::@1 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line::@1 bitmap_line lines @11
bitmap_line::@23 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@23 lines::@1 bitmap_line::@1 bitmap_line lines @11
bitmap_line::@24 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@24 bitmap_line::@23 lines::@1 bitmap_line::@1 bitmap_line lines @11
bitmap_line::@10 dominated by main bitmap_line::@10 main::@1 main::@3 main::@4 @begin bitmap_line::@23 lines::@1 bitmap_line::@1 bitmap_line lines @11
bitmap_line::@9 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line::@1 bitmap_line::@9 bitmap_line lines @11
bitmap_line::@27 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line::@1 bitmap_line::@27 bitmap_line::@9 bitmap_line lines @11
bitmap_line::@13 dominated by main bitmap_line::@13 main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line::@1 bitmap_line::@9 bitmap_line lines @11
bitmap_line_xdyi dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @11 bitmap_line_xdyi
bitmap_line_xdyi::@1 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @11 bitmap_line_xdyi bitmap_line_xdyi::@1
bitmap_line_xdyi::@5 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @11 bitmap_line_xdyi bitmap_line_xdyi::@5 bitmap_line_xdyi::@1
bitmap_line_xdyi::@3 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @11 bitmap_line_xdyi bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@1
bitmap_line_xdyi::@2 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @11 bitmap_line_xdyi bitmap_line_xdyi::@5 bitmap_line_xdyi::@1 bitmap_line_xdyi::@2
bitmap_line_xdyi::@return dominated by main bitmap_line_xdyi::@return main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @11 bitmap_line_xdyi bitmap_line_xdyi::@5 bitmap_line_xdyi::@1 bitmap_line_xdyi::@2
bitmap_plot dominated by main main::@1 main::@3 main::@4 @begin bitmap_plot lines::@1 bitmap_line lines @11
bitmap_plot::@return dominated by main main::@1 main::@3 main::@4 @begin bitmap_plot bitmap_plot::@return lines::@1 bitmap_line lines @11
bitmap_line_ydxi dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @11
bitmap_line_ydxi::@1 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @11 bitmap_line_ydxi::@1
bitmap_line_ydxi::@5 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @11 bitmap_line_ydxi::@1 bitmap_line_ydxi::@5
bitmap_line_ydxi::@3 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @11 bitmap_line_ydxi::@3 bitmap_line_ydxi::@1 bitmap_line_ydxi::@5
bitmap_line_ydxi::@2 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @11 bitmap_line_ydxi::@1 bitmap_line_ydxi::@2 bitmap_line_ydxi::@5
bitmap_line_ydxi::@return dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi bitmap_line_ydxi::@return lines::@1 bitmap_line lines @11 bitmap_line_ydxi::@1 bitmap_line_ydxi::@2 bitmap_line_ydxi::@5
bitmap_line_xdyd dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @11 bitmap_line_xdyd
bitmap_line_xdyd::@1 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@1 lines::@1 bitmap_line lines @11 bitmap_line_xdyd
bitmap_line_xdyd::@5 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@5 bitmap_line_xdyd::@1 lines::@1 bitmap_line lines @11 bitmap_line_xdyd
bitmap_line_xdyd::@3 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@1 lines::@1 bitmap_line lines @11 bitmap_line_xdyd
bitmap_line_xdyd::@2 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@5 bitmap_line_xdyd::@2 bitmap_line_xdyd::@1 lines::@1 bitmap_line lines @11 bitmap_line_xdyd
bitmap_line_xdyd::@return dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@5 bitmap_line_xdyd::@2 bitmap_line_xdyd::@1 lines::@1 bitmap_line bitmap_line_xdyd::@return lines @11 bitmap_line_xdyd
bitmap_line_ydxd dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @11
bitmap_line_ydxd::@1 dominated by main main::@1 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @11
bitmap_line_ydxd::@5 dominated by main main::@1 bitmap_line_ydxd::@5 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @11
bitmap_line_ydxd::@3 dominated by main main::@1 bitmap_line_ydxd::@3 bitmap_line_ydxd::@5 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @11
bitmap_line_ydxd::@2 dominated by main main::@1 bitmap_line_ydxd::@2 bitmap_line_ydxd::@5 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @11
bitmap_line_ydxd::@return dominated by main main::@1 bitmap_line_ydxd::@2 bitmap_line_ydxd::@5 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd bitmap_line_ydxd::@return lines::@1 bitmap_line lines @11
init_screen dominated by main main::@3 main::@4 @begin init_screen @11
init_screen::@1 dominated by main main::@3 main::@4 @begin init_screen init_screen::@1 @11
init_screen::@return dominated by main main::@3 main::@4 @begin init_screen init_screen::@1 @11 init_screen::@return
bitmap_clear dominated by main main::@3 @begin bitmap_clear @11
bitmap_clear::@1 dominated by main main::@3 bitmap_clear::@1 @begin bitmap_clear @11
bitmap_clear::@2 dominated by main main::@3 bitmap_clear::@1 bitmap_clear::@2 @begin bitmap_clear @11
bitmap_clear::@3 dominated by bitmap_clear::@3 main main::@3 bitmap_clear::@1 bitmap_clear::@2 @begin bitmap_clear @11
bitmap_clear::@return dominated by bitmap_clear::@3 main main::@3 bitmap_clear::@1 bitmap_clear::@2 @begin bitmap_clear::@return bitmap_clear @11
bitmap_init dominated by main @begin @11 bitmap_init
bitmap_init::@1 dominated by main @begin bitmap_init::@1 @11 bitmap_init
bitmap_init::@2 dominated by main @begin bitmap_init::@2 bitmap_init::@1 @11 bitmap_init
bitmap_init::@3 dominated by main @begin bitmap_init::@2 bitmap_init::@3 bitmap_init::@1 @11 bitmap_init
bitmap_init::@7 dominated by main @begin bitmap_init::@2 bitmap_init::@3 bitmap_init::@1 bitmap_init::@7 @11 bitmap_init
bitmap_init::@4 dominated by main @begin bitmap_init::@2 bitmap_init::@3 bitmap_init::@1 bitmap_init::@4 @11 bitmap_init
bitmap_init::@return dominated by main @begin bitmap_init::@2 bitmap_init::@3 bitmap_init::@1 bitmap_init::@4 bitmap_init::@return @11 bitmap_init
bitmap_init::@10 dominated by main @begin bitmap_init::@10 bitmap_init::@1 @11 bitmap_init
@14 dominated by @begin @14
@end dominated by @end @begin @14
main dominated by main @begin @14
main::@3 dominated by main main::@3 @begin @14
main::@4 dominated by main main::@3 main::@4 @begin @14
main::@1 dominated by main main::@1 main::@3 main::@4 @begin @14
lines dominated by main main::@1 main::@3 main::@4 @begin lines @14
lines::@1 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 lines @14
lines::@3 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 lines::@3 lines @14
lines::@return dominated by main main::@1 main::@3 main::@4 @begin lines::@return lines::@1 lines::@3 lines @14
bitmap_line dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @14
bitmap_line::@15 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@15 lines::@1 bitmap_line lines @14
bitmap_line::@16 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@16 bitmap_line::@15 lines::@1 bitmap_line lines @14
bitmap_line::@17 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@17 bitmap_line::@16 bitmap_line::@15 lines::@1 bitmap_line lines @14
bitmap_line::@return dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@return lines::@1 bitmap_line lines @14
bitmap_line::@3 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@16 bitmap_line::@15 lines::@1 bitmap_line::@3 bitmap_line lines @14
bitmap_line::@2 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@15 lines::@1 bitmap_line::@2 bitmap_line lines @14
bitmap_line::@20 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@15 bitmap_line::@20 lines::@1 bitmap_line::@2 bitmap_line lines @14
bitmap_line::@6 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@15 lines::@1 bitmap_line::@2 bitmap_line::@6 bitmap_line lines @14
bitmap_line::@1 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line::@1 bitmap_line lines @14
bitmap_line::@23 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@23 lines::@1 bitmap_line::@1 bitmap_line lines @14
bitmap_line::@24 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line::@24 bitmap_line::@23 lines::@1 bitmap_line::@1 bitmap_line lines @14
bitmap_line::@10 dominated by main bitmap_line::@10 main::@1 main::@3 main::@4 @begin bitmap_line::@23 lines::@1 bitmap_line::@1 bitmap_line lines @14
bitmap_line::@9 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line::@1 bitmap_line::@9 bitmap_line lines @14
bitmap_line::@27 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line::@1 bitmap_line::@27 bitmap_line::@9 bitmap_line lines @14
bitmap_line::@13 dominated by main bitmap_line::@13 main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line::@1 bitmap_line::@9 bitmap_line lines @14
bitmap_line_xdyi dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @14 bitmap_line_xdyi
bitmap_line_xdyi::@1 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @14 bitmap_line_xdyi bitmap_line_xdyi::@1
bitmap_line_xdyi::@5 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @14 bitmap_line_xdyi bitmap_line_xdyi::@5 bitmap_line_xdyi::@1
bitmap_line_xdyi::@3 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @14 bitmap_line_xdyi bitmap_line_xdyi::@5 bitmap_line_xdyi::@3 bitmap_line_xdyi::@1
bitmap_line_xdyi::@2 dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @14 bitmap_line_xdyi bitmap_line_xdyi::@5 bitmap_line_xdyi::@1 bitmap_line_xdyi::@2
bitmap_line_xdyi::@return dominated by main bitmap_line_xdyi::@return main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @14 bitmap_line_xdyi bitmap_line_xdyi::@5 bitmap_line_xdyi::@1 bitmap_line_xdyi::@2
bitmap_plot dominated by main main::@1 main::@3 main::@4 @begin bitmap_plot lines::@1 bitmap_line lines @14
bitmap_plot::@return dominated by main main::@1 main::@3 main::@4 @begin bitmap_plot bitmap_plot::@return lines::@1 bitmap_line lines @14
bitmap_line_ydxi dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @14
bitmap_line_ydxi::@1 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @14 bitmap_line_ydxi::@1
bitmap_line_ydxi::@5 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @14 bitmap_line_ydxi::@1 bitmap_line_ydxi::@5
bitmap_line_ydxi::@3 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @14 bitmap_line_ydxi::@3 bitmap_line_ydxi::@1 bitmap_line_ydxi::@5
bitmap_line_ydxi::@2 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi lines::@1 bitmap_line lines @14 bitmap_line_ydxi::@1 bitmap_line_ydxi::@2 bitmap_line_ydxi::@5
bitmap_line_ydxi::@return dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxi bitmap_line_ydxi::@return lines::@1 bitmap_line lines @14 bitmap_line_ydxi::@1 bitmap_line_ydxi::@2 bitmap_line_ydxi::@5
bitmap_line_xdyd dominated by main main::@1 main::@3 main::@4 @begin lines::@1 bitmap_line lines @14 bitmap_line_xdyd
bitmap_line_xdyd::@1 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@1 lines::@1 bitmap_line lines @14 bitmap_line_xdyd
bitmap_line_xdyd::@5 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@5 bitmap_line_xdyd::@1 lines::@1 bitmap_line lines @14 bitmap_line_xdyd
bitmap_line_xdyd::@3 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@5 bitmap_line_xdyd::@3 bitmap_line_xdyd::@1 lines::@1 bitmap_line lines @14 bitmap_line_xdyd
bitmap_line_xdyd::@2 dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@5 bitmap_line_xdyd::@2 bitmap_line_xdyd::@1 lines::@1 bitmap_line lines @14 bitmap_line_xdyd
bitmap_line_xdyd::@return dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_xdyd::@5 bitmap_line_xdyd::@2 bitmap_line_xdyd::@1 lines::@1 bitmap_line bitmap_line_xdyd::@return lines @14 bitmap_line_xdyd
bitmap_line_ydxd dominated by main main::@1 main::@3 main::@4 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @14
bitmap_line_ydxd::@1 dominated by main main::@1 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @14
bitmap_line_ydxd::@5 dominated by main main::@1 bitmap_line_ydxd::@5 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @14
bitmap_line_ydxd::@3 dominated by main main::@1 bitmap_line_ydxd::@3 bitmap_line_ydxd::@5 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @14
bitmap_line_ydxd::@2 dominated by main main::@1 bitmap_line_ydxd::@2 bitmap_line_ydxd::@5 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd lines::@1 bitmap_line lines @14
bitmap_line_ydxd::@return dominated by main main::@1 bitmap_line_ydxd::@2 bitmap_line_ydxd::@5 main::@3 main::@4 bitmap_line_ydxd::@1 @begin bitmap_line_ydxd bitmap_line_ydxd::@return lines::@1 bitmap_line lines @14
init_screen dominated by main main::@3 main::@4 @begin init_screen @14
init_screen::@1 dominated by main main::@3 main::@4 @begin init_screen init_screen::@1 @14
init_screen::@return dominated by main main::@3 main::@4 @begin init_screen init_screen::@1 @14 init_screen::@return
bitmap_clear dominated by main main::@3 @begin bitmap_clear @14
bitmap_clear::@1 dominated by main main::@3 bitmap_clear::@1 @begin bitmap_clear @14
bitmap_clear::@2 dominated by main main::@3 bitmap_clear::@1 bitmap_clear::@2 @begin bitmap_clear @14
bitmap_clear::@3 dominated by bitmap_clear::@3 main main::@3 bitmap_clear::@1 bitmap_clear::@2 @begin bitmap_clear @14
bitmap_clear::@return dominated by bitmap_clear::@3 main main::@3 bitmap_clear::@1 bitmap_clear::@2 @begin bitmap_clear::@return bitmap_clear @14
bitmap_init dominated by main @begin @14 bitmap_init
bitmap_init::@1 dominated by main @begin bitmap_init::@1 @14 bitmap_init
bitmap_init::@2 dominated by main @begin bitmap_init::@2 bitmap_init::@1 @14 bitmap_init
bitmap_init::@3 dominated by main @begin bitmap_init::@2 bitmap_init::@3 bitmap_init::@1 @14 bitmap_init
bitmap_init::@7 dominated by main @begin bitmap_init::@2 bitmap_init::@3 bitmap_init::@1 bitmap_init::@7 @14 bitmap_init
bitmap_init::@4 dominated by main @begin bitmap_init::@2 bitmap_init::@3 bitmap_init::@1 bitmap_init::@4 @14 bitmap_init
bitmap_init::@return dominated by main @begin bitmap_init::@2 bitmap_init::@3 bitmap_init::@1 bitmap_init::@4 bitmap_init::@return @14 bitmap_init
bitmap_init::@10 dominated by main @begin bitmap_init::@10 bitmap_init::@1 @14 bitmap_init
NATURAL LOOPS
Found back edge: Loop head: main::@1 tails: main::@1 blocks: null
@ -4331,15 +4435,15 @@ INITIAL ASM
.const lines_cnt = 8
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
b11_from_bbegin:
jmp b11
//SEG4 @11
b11:
//SEG3 [1] phi from @begin to @14 [phi:@begin->@14]
b14_from_bbegin:
jmp b14
//SEG4 @14
b14:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @11 to @end [phi:@11->@end]
bend_from_b11:
//SEG6 [3] phi from @14 to @end [phi:@14->@end]
bend_from_b14:
jmp bend
//SEG7 @end
bend:
@ -5746,15 +5850,15 @@ ASSEMBLER BEFORE OPTIMIZATION
.const lines_cnt = 8
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
b11_from_bbegin:
jmp b11
//SEG4 @11
b11:
//SEG3 [1] phi from @begin to @14 [phi:@begin->@14]
b14_from_bbegin:
jmp b14
//SEG4 @14
b14:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @11 to @end [phi:@11->@end]
bend_from_b11:
//SEG6 [3] phi from @14 to @end [phi:@14->@end]
bend_from_b14:
jmp bend
//SEG7 @end
bend:
@ -6701,7 +6805,7 @@ bitmap_init: {
lines_y: .byte $a, $28, $3c, $50, $6e, $50, $3c, $28, $a
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b11
Removing instruction jmp b14
Removing instruction jmp bend
Removing instruction jmp b3
Removing instruction jmp b4
@ -6783,8 +6887,8 @@ Replacing label b1_from_b2 with b1
Replacing label b4_from_b3 with b4
Replacing label b3_from_b4 with b3
Removing instruction bbegin:
Removing instruction b11_from_bbegin:
Removing instruction bend_from_b11:
Removing instruction b14_from_bbegin:
Removing instruction bend_from_b14:
Removing instruction b3_from_main:
Removing instruction b4_from_b3:
Removing instruction init_screen_from_b4:
@ -6819,7 +6923,7 @@ Removing instruction b4_from_b7:
Removing instruction b10_from_b1:
Removing instruction b2_from_b10:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b11:
Removing instruction b14:
Removing instruction bend:
Removing instruction bitmap_init_from_main:
Removing instruction b3:
@ -6887,7 +6991,7 @@ Removing unreachable instruction jmp b2
Succesful ASM optimization Pass5UnreachableCodeElimination
FINAL SYMBOL TABLE
(label) @11
(label) @14
(label) @begin
(label) @end
(byte*) BGCOL
@ -7242,11 +7346,11 @@ Score: 221049
.label BITMAP = $2000
.const lines_cnt = 8
//SEG2 @begin
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
//SEG4 @11
//SEG3 [1] phi from @begin to @14 [phi:@begin->@14]
//SEG4 @14
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @11 to @end [phi:@11->@end]
//SEG6 [3] phi from @14 to @end [phi:@14->@end]
//SEG7 @end
//SEG8 main
main: {

View File

@ -1,4 +1,4 @@
(label) @11
(label) @14
(label) @begin
(label) @end
(byte*) BGCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@5
@5: scope:[] from @begin
to:@8
@8: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @5
@end: scope:[] from @8
[3] phi() [ ] ( )
main: scope:[main] from @5
main: scope:[main] from @8
asm { sei }
[5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] )
[6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] )

View File

@ -402,6 +402,24 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Adding pre/post-modifier (byte*) gfx_init_screen0::ch ← ++ (byte*) gfx_init_screen0::ch
Adding pre/post-modifier (byte) gfx_init_plane_charset8::gfxbCpuBank ← ++ (byte) gfx_init_plane_charset8::gfxbCpuBank
Adding pre/post-modifier (byte*) gfx_init_plane_charset8::chargen ← ++ (byte*) gfx_init_plane_charset8::chargen
@ -413,6 +431,9 @@ SYMBOLS
(label) @3
(label) @4
(label) @5
(label) @6
(label) @7
(label) @8
(label) @begin
(label) @end
(byte*) BGCOL
@ -692,6 +713,34 @@ SYMBOLS
(label) main::@return
(byte) main::j
(byte) main::rst
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -850,6 +899,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte*) DTV_FEATURE ← ((byte*)) (word/dword/signed dword) 53311
(byte) DTV_FEATURE_ENABLE ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_FEATURE_DISABLE_TIL_RESET ← (byte/signed byte/word/signed word/dword/signed dword) 2
@ -881,7 +975,7 @@ INITIAL CONTROL FLOW GRAPH
(dword) DTV_COLOR_BANK_DEFAULT ← (dword/signed dword) 120832
(byte*) DTV_GRAPHICS_VIC_BANK ← ((byte*)) (word/dword/signed dword) 53309
(byte*) DTV_GRAPHICS_HICOL_BANK ← ((byte*)) (word/dword/signed dword) 53310
to:@1
to:@4
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from
(byte*) dtvSetCpuBankSegment1::cpuBank ← ((byte*)) (byte/word/signed word/dword/signed dword) 255
*((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx
@ -890,7 +984,7 @@ dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from
dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1
return
to:@return
@1: scope:[] from @begin
@4: scope:[] from @3
(byte*) DTV_BLITTER_SRCA_LO ← ((byte*)) (word/dword/signed dword) 54048
(byte*) DTV_BLITTER_SRCA_MI ← ((byte*)) (word/dword/signed dword) 54049
(byte*) DTV_BLITTER_SRCA_HI ← ((byte*)) (word/dword/signed dword) 54050
@ -957,7 +1051,7 @@ dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBan
(byte) DTV_BLIT_STATUS_IRQ ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte*) SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 31744
(byte*) CHARSET8 ← ((byte*)) (word/dword/signed dword) 32768
to:@2
to:@5
main: scope:[main] from
asm { sei }
*((byte*) PROCPORT_DDR) ← (byte) PROCPORT_DDR_MEMORY_MASK
@ -1069,8 +1163,8 @@ main::@16: scope:[main] from
main::@return: scope:[main] from main::@4
return
to:@return
@2: scope:[] from @1
to:@3
@5: scope:[] from @4
to:@6
gfx_init: scope:[gfx_init] from
(void~) gfx_init::$0 ← call gfx_init_screen0
(void~) gfx_init::$1 ← call gfx_init_plane_charset8
@ -1078,8 +1172,8 @@ gfx_init: scope:[gfx_init] from
gfx_init::@return: scope:[gfx_init] from gfx_init
return
to:@return
@3: scope:[] from @2
to:@4
@6: scope:[] from @5
to:@7
gfx_init_screen0: scope:[gfx_init_screen0] from
(byte*) gfx_init_screen0::ch ← (byte*) SCREEN
(byte) gfx_init_screen0::cy ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1108,8 +1202,8 @@ gfx_init_screen0::@4: scope:[gfx_init_screen0] from gfx_init_screen0::@3
gfx_init_screen0::@return: scope:[gfx_init_screen0] from gfx_init_screen0::@4
return
to:@return
@4: scope:[] from @3
to:@5
@7: scope:[] from @6
to:@8
gfx_init_plane_charset8: scope:[gfx_init_plane_charset8] from
(byte*~) gfx_init_plane_charset8::$0 ← (byte*) CHARSET8 / (word/signed word/dword/signed dword) 16384
(byte~) gfx_init_plane_charset8::$1 ← ((byte)) (byte*~) gfx_init_plane_charset8::$0
@ -1173,11 +1267,15 @@ gfx_init_plane_charset8::@8: scope:[gfx_init_plane_charset8] from gfx_init_plan
gfx_init_plane_charset8::@return: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@8
return
to:@return
@5: scope:[] from @4
@8: scope:[] from @7
call main
to:@end
@end: scope:[] from @5
@end: scope:[] from @8
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Eliminating unused variable (byte) PROCPORT_RAM_ALL and assignment [3] (byte) PROCPORT_RAM_ALL ← (byte/signed byte/word/signed word/dword/signed dword) 48
Eliminating unused variable (byte) PROCPORT_KERNEL_IO and assignment [6] (byte) PROCPORT_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 54
Eliminating unused variable (byte) PROCPORT_BASIC_KERNEL_IO and assignment [7] (byte) PROCPORT_BASIC_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 55
@ -1305,6 +1403,8 @@ Eliminating unused variable - keeping the call (void~) gfx_init::$0
Eliminating unused variable - keeping the call (void~) gfx_init::$1
Eliminating unused variable - keeping the call (void~) gfx_init_plane_charset8::$2
Eliminating unused variable - keeping the call (void~) gfx_init_plane_charset8::$16
Removing empty block @1
Removing empty block @2
Removing empty block main::@9
Removing empty block main::@10
Removing empty block main::@4
@ -1314,10 +1414,10 @@ Removing empty block main::@13
Removing empty block main::@14
Removing empty block main::@15
Removing empty block main::@16
Removing empty block @2
Removing empty block @3
Removing empty block @5
Removing empty block @6
Removing empty block gfx_init_screen0::@4
Removing empty block @4
Removing empty block @7
PROCEDURE MODIFY VARIABLE ANALYSIS
Completing Phi functions...
@ -1347,6 +1447,8 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) VIC_MEMORY#0 ← ((byte*)) (word/dword/signed dword) 53272
(byte*) CIA2_PORT_A#0 ← ((byte*)) (word/dword/signed dword) 56576
(byte*) CIA2_PORT_A_DDR#0 ← ((byte*)) (word/dword/signed dword) 56578
to:@3
@3: scope:[] from @begin
(byte*) DTV_FEATURE#0 ← ((byte*)) (word/dword/signed dword) 53311
(byte) DTV_FEATURE_ENABLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) DTV_CONTROL#0 ← ((byte*)) (word/dword/signed dword) 53308
@ -1367,7 +1469,7 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) DTV_PLANEB_STEP#0 ← ((byte*)) (word/dword/signed dword) 53324
(byte*) DTV_PLANEB_MODULO_LO#0 ← ((byte*)) (word/dword/signed dword) 53319
(byte*) DTV_PLANEB_MODULO_HI#0 ← ((byte*)) (word/dword/signed dword) 53320
to:@1
to:@4
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_charset8 gfx_init_plane_charset8::@8
(byte) dtvSetCpuBankSegment1::cpuBankIdx#2 ← phi( gfx_init_plane_charset8/(byte) dtvSetCpuBankSegment1::cpuBankIdx#0 gfx_init_plane_charset8::@8/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 )
(byte*) dtvSetCpuBankSegment1::cpuBank#0 ← ((byte*)) (byte/word/signed word/dword/signed dword) 255
@ -1377,11 +1479,11 @@ dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_plane_charse
dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1
return
to:@return
@1: scope:[] from @begin
@4: scope:[] from @3
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 31744
(byte*) CHARSET8#0 ← ((byte*)) (word/dword/signed dword) 32768
to:@5
main: scope:[main] from @5
to:@8
main: scope:[main] from @8
asm { sei }
*((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0
*((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0
@ -1633,17 +1735,18 @@ gfx_init_plane_charset8::@10: scope:[gfx_init_plane_charset8] from gfx_init_pla
gfx_init_plane_charset8::@return: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8::@10
return
to:@return
@5: scope:[] from @1
@8: scope:[] from @4
call main
to:@6
@6: scope:[] from @5
to:@9
@9: scope:[] from @8
to:@end
@end: scope:[] from @6
@end: scope:[] from @9
SYMBOL TABLE SSA
(label) @1
(label) @5
(label) @6
(label) @3
(label) @4
(label) @8
(label) @9
(label) @begin
(label) @end
(byte*) BORDERCOL
@ -1918,7 +2021,7 @@ SYMBOL TABLE SSA
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) gfx_init::@2
Culled Empty Block (label) gfx_init_plane_charset8::@10
Culled Empty Block (label) @6
Culled Empty Block (label) @9
Succesful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not (bool~) gfx_init_plane_charset8::$9 ← (byte~) gfx_init_plane_charset8::$7 == (byte/signed byte/word/signed word/dword/signed dword) 0 from (bool~) gfx_init_plane_charset8::$8 ← (byte~) gfx_init_plane_charset8::$7 != (byte/signed byte/word/signed word/dword/signed dword) 0
Succesful SSA optimization Pass2UnaryNotSimplification
@ -2084,7 +2187,8 @@ Eliminating unused constant (const byte) gfx_init_plane_charset8::gfxbCpuBank#1
Succesful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) @1
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@6
Not culling empty block because it shares successor with its predecessor. (label) gfx_init_plane_charset8::@5
@ -2176,16 +2280,16 @@ Constant inlined main::$7 = (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0
Constant inlined main::$8 = <(const byte*) SCREEN#0
Constant inlined gfx_init_plane_charset8::$3 = ((word))(const byte*) CHARSET8#0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @5 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 gfx_init gfx_init::@1 gfx_init::@return gfx_init_plane_charset8 gfx_init_plane_charset8::@9 gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return gfx_init_screen0 gfx_init_screen0::@1 gfx_init_screen0::@2 gfx_init_screen0::@3 gfx_init_screen0::@return
Block Sequence Planned @begin @8 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 gfx_init gfx_init::@1 gfx_init::@return gfx_init_plane_charset8 gfx_init_plane_charset8::@9 gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return gfx_init_screen0 gfx_init_screen0::@1 gfx_init_screen0::@2 gfx_init_screen0::@3 gfx_init_screen0::@return
Added new block during phi lifting main::@18(between main::@1 and main::@1)
Added new block during phi lifting gfx_init_plane_charset8::@11(between gfx_init_plane_charset8::@7 and gfx_init_plane_charset8::@1)
Added new block during phi lifting gfx_init_plane_charset8::@12(between gfx_init_plane_charset8::@6 and gfx_init_plane_charset8::@2)
Added new block during phi lifting gfx_init_plane_charset8::@13(between gfx_init_plane_charset8::@4 and gfx_init_plane_charset8::@3)
Added new block during phi lifting gfx_init_screen0::@5(between gfx_init_screen0::@3 and gfx_init_screen0::@1)
Added new block during phi lifting gfx_init_screen0::@6(between gfx_init_screen0::@2 and gfx_init_screen0::@2)
Block Sequence Planned @begin @5 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 main::@18 gfx_init gfx_init::@1 gfx_init::@return gfx_init_plane_charset8 gfx_init_plane_charset8::@9 gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@return gfx_init_plane_charset8::@11 gfx_init_plane_charset8::@12 gfx_init_plane_charset8::@13 dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return gfx_init_screen0 gfx_init_screen0::@1 gfx_init_screen0::@2 gfx_init_screen0::@3 gfx_init_screen0::@return gfx_init_screen0::@5 gfx_init_screen0::@6
Block Sequence Planned @begin @8 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 main::@18 gfx_init gfx_init::@1 gfx_init::@return gfx_init_plane_charset8 gfx_init_plane_charset8::@9 gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@return gfx_init_plane_charset8::@11 gfx_init_plane_charset8::@12 gfx_init_plane_charset8::@13 dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return gfx_init_screen0 gfx_init_screen0::@1 gfx_init_screen0::@2 gfx_init_screen0::@3 gfx_init_screen0::@return gfx_init_screen0::@5 gfx_init_screen0::@6
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @5
Adding NOP phi() at start of @8
Adding NOP phi() at start of @end
Adding NOP phi() at start of gfx_init
Adding NOP phi() at start of gfx_init::@1
@ -2253,9 +2357,9 @@ Culled Empty Block (label) gfx_init_plane_charset8::@12
Culled Empty Block (label) gfx_init_plane_charset8::@13
Culled Empty Block (label) gfx_init_screen0::@5
Culled Empty Block (label) gfx_init_screen0::@6
Block Sequence Planned @begin @5 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 gfx_init gfx_init::@1 gfx_init::@return gfx_init_plane_charset8 gfx_init_plane_charset8::@9 gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return gfx_init_screen0 gfx_init_screen0::@1 gfx_init_screen0::@2 gfx_init_screen0::@3 gfx_init_screen0::@return
Block Sequence Planned @begin @8 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 gfx_init gfx_init::@1 gfx_init::@return gfx_init_plane_charset8 gfx_init_plane_charset8::@9 gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return gfx_init_screen0 gfx_init_screen0::@1 gfx_init_screen0::@2 gfx_init_screen0::@3 gfx_init_screen0::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @5
Adding NOP phi() at start of @8
Adding NOP phi() at start of @end
Adding NOP phi() at start of gfx_init
Adding NOP phi() at start of gfx_init::@1
@ -2282,14 +2386,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@5
@5: scope:[] from @begin
to:@8
@8: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @5
@end: scope:[] from @8
[3] phi() [ ] ( )
main: scope:[main] from @5
main: scope:[main] from @8
asm { sei }
[5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] )
[6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] )
@ -2447,36 +2551,36 @@ gfx_init_screen0::@return: scope:[gfx_init_screen0] from gfx_init_screen0::@3
DOMINATORS
@begin dominated by @begin
@5 dominated by @begin @5
@end dominated by @end @begin @5
main dominated by main @begin @5
main::@17 dominated by main @begin main::@17 @5
main::@1 dominated by main main::@1 @begin main::@17 @5
main::@3 dominated by main main::@1 main::@3 @begin main::@17 @5
main::@5 dominated by main main::@1 main::@5 main::@3 @begin main::@17 @5
main::@7 dominated by main::@7 main main::@1 main::@5 main::@3 @begin main::@17 @5
main::@8 dominated by main::@7 main::@8 main main::@1 main::@5 main::@3 @begin main::@17 @5
gfx_init dominated by main gfx_init @begin @5
gfx_init::@1 dominated by main gfx_init gfx_init::@1 @begin @5
gfx_init::@return dominated by main gfx_init gfx_init::@1 @begin gfx_init::@return @5
gfx_init_plane_charset8 dominated by main gfx_init gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@9 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@1 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@2 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@3 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@5 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5 gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@4 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@6 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@7 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@8 dominated by gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init::@1 gfx_init_plane_charset8 @begin @5
gfx_init_plane_charset8::@return dominated by gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init::@1 gfx_init_plane_charset8 @begin @5 gfx_init_plane_charset8::@return
dtvSetCpuBankSegment1 dominated by dtvSetCpuBankSegment1 main gfx_init gfx_init::@1 gfx_init_plane_charset8 @begin @5
dtvSetCpuBankSegment1::@return dominated by dtvSetCpuBankSegment1 main gfx_init gfx_init::@1 gfx_init_plane_charset8 @begin dtvSetCpuBankSegment1::@return @5
gfx_init_screen0 dominated by main gfx_init_screen0 gfx_init @begin @5
gfx_init_screen0::@1 dominated by main gfx_init_screen0::@1 gfx_init_screen0 gfx_init @begin @5
gfx_init_screen0::@2 dominated by main gfx_init_screen0::@2 gfx_init_screen0::@1 gfx_init_screen0 gfx_init @begin @5
gfx_init_screen0::@3 dominated by gfx_init_screen0::@3 main gfx_init_screen0::@2 gfx_init_screen0::@1 gfx_init_screen0 gfx_init @begin @5
gfx_init_screen0::@return dominated by gfx_init_screen0::@3 main gfx_init_screen0::@2 gfx_init_screen0::@1 gfx_init_screen0 gfx_init @begin gfx_init_screen0::@return @5
@8 dominated by @begin @8
@end dominated by @end @begin @8
main dominated by main @begin @8
main::@17 dominated by main @begin main::@17 @8
main::@1 dominated by main main::@1 @begin main::@17 @8
main::@3 dominated by main main::@1 main::@3 @begin main::@17 @8
main::@5 dominated by main main::@1 main::@5 main::@3 @begin main::@17 @8
main::@7 dominated by main::@7 main main::@1 main::@5 main::@3 @begin main::@17 @8
main::@8 dominated by main::@7 main::@8 main main::@1 main::@5 main::@3 @begin main::@17 @8
gfx_init dominated by main gfx_init @begin @8
gfx_init::@1 dominated by main gfx_init gfx_init::@1 @begin @8
gfx_init::@return dominated by main gfx_init gfx_init::@1 @begin gfx_init::@return @8
gfx_init_plane_charset8 dominated by main gfx_init gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@9 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@1 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@2 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@3 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@5 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@5 gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@4 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@6 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@7 dominated by gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@8 dominated by gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init::@1 gfx_init_plane_charset8 @begin @8
gfx_init_plane_charset8::@return dominated by gfx_init_plane_charset8::@8 gfx_init_plane_charset8::@9 main gfx_init gfx_init_plane_charset8::@1 gfx_init_plane_charset8::@2 gfx_init_plane_charset8::@3 gfx_init_plane_charset8::@4 gfx_init_plane_charset8::@6 gfx_init_plane_charset8::@7 gfx_init::@1 gfx_init_plane_charset8 @begin @8 gfx_init_plane_charset8::@return
dtvSetCpuBankSegment1 dominated by dtvSetCpuBankSegment1 main gfx_init gfx_init::@1 gfx_init_plane_charset8 @begin @8
dtvSetCpuBankSegment1::@return dominated by dtvSetCpuBankSegment1 main gfx_init gfx_init::@1 gfx_init_plane_charset8 @begin dtvSetCpuBankSegment1::@return @8
gfx_init_screen0 dominated by main gfx_init_screen0 gfx_init @begin @8
gfx_init_screen0::@1 dominated by main gfx_init_screen0::@1 gfx_init_screen0 gfx_init @begin @8
gfx_init_screen0::@2 dominated by main gfx_init_screen0::@2 gfx_init_screen0::@1 gfx_init_screen0 gfx_init @begin @8
gfx_init_screen0::@3 dominated by gfx_init_screen0::@3 main gfx_init_screen0::@2 gfx_init_screen0::@1 gfx_init_screen0 gfx_init @begin @8
gfx_init_screen0::@return dominated by gfx_init_screen0::@3 main gfx_init_screen0::@2 gfx_init_screen0::@1 gfx_init_screen0 gfx_init @begin gfx_init_screen0::@return @8
NATURAL LOOPS
Found back edge: Loop head: main::@1 tails: main::@1 blocks: null
@ -2755,15 +2859,15 @@ INITIAL ASM
.label CHARSET8 = $8000
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
jmp b5
//SEG4 @5
b5:
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
b8_from_bbegin:
jmp b8
//SEG4 @8
b8:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
//SEG6 [3] phi from @8 to @end [phi:@8->@end]
bend_from_b8:
jmp bend
//SEG7 @end
bend:
@ -3502,15 +3606,15 @@ ASSEMBLER BEFORE OPTIMIZATION
.label CHARSET8 = $8000
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
jmp b5
//SEG4 @5
b5:
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
b8_from_bbegin:
jmp b8
//SEG4 @8
b8:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
//SEG6 [3] phi from @8 to @end [phi:@8->@end]
bend_from_b8:
jmp bend
//SEG7 @end
bend:
@ -4006,7 +4110,7 @@ gfx_init_screen0: {
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b5
Removing instruction jmp b8
Removing instruction jmp bend
Removing instruction jmp b17
Removing instruction jmp b1
@ -4045,8 +4149,8 @@ Replacing label b1_from_b7 with b1
Replacing label b2_from_b2 with b2
Replacing label b1_from_b3 with b1
Removing instruction bbegin:
Removing instruction b5_from_bbegin:
Removing instruction bend_from_b5:
Removing instruction b8_from_bbegin:
Removing instruction bend_from_b8:
Removing instruction b1_from_b1:
Removing instruction b1_from_gfx_init:
Removing instruction gfx_init_plane_charset8_from_b1:
@ -4058,7 +4162,7 @@ Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b5:
Removing instruction b8:
Removing instruction bend:
Removing instruction gfx_init_from_main:
Removing instruction b17:
@ -4094,7 +4198,7 @@ Removing instruction jmp b2
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
(label) @5
(label) @8
(label) @begin
(label) @end
(byte*) BORDERCOL
@ -4335,11 +4439,11 @@ Score: 75363
.label SCREEN = $7c00
.label CHARSET8 = $8000
//SEG2 @begin
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
//SEG4 @5
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
//SEG4 @8
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
//SEG6 [3] phi from @8 to @end [phi:@8->@end]
//SEG7 @end
//SEG8 main
main: {

View File

@ -1,4 +1,4 @@
(label) @5
(label) @8
(label) @begin
(label) @end
(byte*) BORDERCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@3
@3: scope:[] from @begin
to:@6
@6: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
[3] phi() [ ] ( )
main: scope:[main] from @3
main: scope:[main] from @6
asm { sei }
[5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] )
[6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] )

View File

@ -369,6 +369,24 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Adding pre/post-modifier (byte) gfx_init_chunky::gfxbCpuBank ← ++ (byte) gfx_init_chunky::gfxbCpuBank
Adding pre/post-modifier (byte) gfx_init_chunky::gfxbCpuBank ← ++ (byte) gfx_init_chunky::gfxbCpuBank
Adding pre/post-modifier (byte*) gfx_init_chunky::gfxb ← ++ (byte*) gfx_init_chunky::gfxb
@ -376,6 +394,9 @@ SYMBOLS
(label) @1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @6
(label) @begin
(label) @end
(byte*) BGCOL
@ -624,6 +645,34 @@ SYMBOLS
(label) main::@return
(byte) main::j
(byte) main::rst
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -782,6 +831,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte*) DTV_FEATURE ← ((byte*)) (word/dword/signed dword) 53311
(byte) DTV_FEATURE_ENABLE ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_FEATURE_DISABLE_TIL_RESET ← (byte/signed byte/word/signed word/dword/signed dword) 2
@ -813,7 +907,7 @@ INITIAL CONTROL FLOW GRAPH
(dword) DTV_COLOR_BANK_DEFAULT ← (dword/signed dword) 120832
(byte*) DTV_GRAPHICS_VIC_BANK ← ((byte*)) (word/dword/signed dword) 53309
(byte*) DTV_GRAPHICS_HICOL_BANK ← ((byte*)) (word/dword/signed dword) 53310
to:@1
to:@4
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from
(byte*) dtvSetCpuBankSegment1::cpuBank ← ((byte*)) (byte/word/signed word/dword/signed dword) 255
*((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx
@ -822,7 +916,7 @@ dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from
dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1
return
to:@return
@1: scope:[] from @begin
@4: scope:[] from @3
(byte*) DTV_BLITTER_SRCA_LO ← ((byte*)) (word/dword/signed dword) 54048
(byte*) DTV_BLITTER_SRCA_MI ← ((byte*)) (word/dword/signed dword) 54049
(byte*) DTV_BLITTER_SRCA_HI ← ((byte*)) (word/dword/signed dword) 54050
@ -888,7 +982,7 @@ dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBan
(byte) DTV_BLIT_STATUS_BUSY ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_STATUS_IRQ ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte*) CHUNKY ← ((byte*)) (word/dword/signed dword) 32768
to:@2
to:@5
main: scope:[main] from
asm { sei }
*((byte*) PROCPORT_DDR) ← (byte) PROCPORT_DDR_MEMORY_MASK
@ -993,8 +1087,8 @@ main::@16: scope:[main] from
main::@return: scope:[main] from main::@4
return
to:@return
@2: scope:[] from @1
to:@3
@5: scope:[] from @4
to:@6
gfx_init_chunky: scope:[gfx_init_chunky] from
(byte*~) gfx_init_chunky::$0 ← (byte*) CHUNKY / (word/signed word/dword/signed dword) 16384
(byte~) gfx_init_chunky::$1 ← ((byte)) (byte*~) gfx_init_chunky::$0
@ -1040,11 +1134,15 @@ gfx_init_chunky::@6: scope:[gfx_init_chunky] from gfx_init_chunky::@5
gfx_init_chunky::@return: scope:[gfx_init_chunky] from gfx_init_chunky::@6
return
to:@return
@3: scope:[] from @2
@6: scope:[] from @5
call main
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Eliminating unused variable (byte) PROCPORT_RAM_ALL and assignment [3] (byte) PROCPORT_RAM_ALL ← (byte/signed byte/word/signed word/dword/signed dword) 48
Eliminating unused variable (byte) PROCPORT_RAM_CHARROM and assignment [5] (byte) PROCPORT_RAM_CHARROM ← (byte/signed byte/word/signed word/dword/signed dword) 49
Eliminating unused variable (byte) PROCPORT_KERNEL_IO and assignment [6] (byte) PROCPORT_KERNEL_IO ← (byte/signed byte/word/signed word/dword/signed dword) 54
@ -1178,6 +1276,8 @@ Eliminating unused variable - keeping the call (void~) main::$0
Eliminating unused variable - keeping the call (void~) gfx_init_chunky::$2
Eliminating unused variable - keeping the call (void~) gfx_init_chunky::$5
Eliminating unused variable - keeping the call (void~) gfx_init_chunky::$12
Removing empty block @1
Removing empty block @2
Removing empty block main::@9
Removing empty block main::@10
Removing empty block main::@4
@ -1187,7 +1287,7 @@ Removing empty block main::@13
Removing empty block main::@14
Removing empty block main::@15
Removing empty block main::@16
Removing empty block @2
Removing empty block @5
PROCEDURE MODIFY VARIABLE ANALYSIS
Completing Phi functions...
@ -1213,6 +1313,8 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) VIC_MEMORY#0 ← ((byte*)) (word/dword/signed dword) 53272
(byte*) CIA2_PORT_A#0 ← ((byte*)) (word/dword/signed dword) 56576
(byte*) CIA2_PORT_A_DDR#0 ← ((byte*)) (word/dword/signed dword) 56578
to:@3
@3: scope:[] from @begin
(byte*) DTV_FEATURE#0 ← ((byte*)) (word/dword/signed dword) 53311
(byte) DTV_FEATURE_ENABLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) DTV_CONTROL#0 ← ((byte*)) (word/dword/signed dword) 53308
@ -1228,7 +1330,7 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) DTV_PLANEB_STEP#0 ← ((byte*)) (word/dword/signed dword) 53324
(byte*) DTV_PLANEB_MODULO_LO#0 ← ((byte*)) (word/dword/signed dword) 53319
(byte*) DTV_PLANEB_MODULO_HI#0 ← ((byte*)) (word/dword/signed dword) 53320
to:@1
to:@4
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_chunky gfx_init_chunky::@4 gfx_init_chunky::@6
(byte) dtvSetCpuBankSegment1::cpuBankIdx#3 ← phi( gfx_init_chunky/(byte) dtvSetCpuBankSegment1::cpuBankIdx#0 gfx_init_chunky::@4/(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 gfx_init_chunky::@6/(byte) dtvSetCpuBankSegment1::cpuBankIdx#2 )
(byte*) dtvSetCpuBankSegment1::cpuBank#0 ← ((byte*)) (byte/word/signed word/dword/signed dword) 255
@ -1238,10 +1340,10 @@ dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from gfx_init_chunky gfx_i
dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1
return
to:@return
@1: scope:[] from @begin
@4: scope:[] from @3
(byte*) CHUNKY#0 ← ((byte*)) (word/dword/signed dword) 32768
to:@3
main: scope:[main] from @3
to:@6
main: scope:[main] from @6
asm { sei }
*((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0
*((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0
@ -1407,17 +1509,18 @@ gfx_init_chunky::@9: scope:[gfx_init_chunky] from gfx_init_chunky::@6
gfx_init_chunky::@return: scope:[gfx_init_chunky] from gfx_init_chunky::@9
return
to:@return
@3: scope:[] from @1
@6: scope:[] from @4
call main
to:@4
@4: scope:[] from @3
to:@7
@7: scope:[] from @6
to:@end
@end: scope:[] from @4
@end: scope:[] from @7
SYMBOL TABLE SSA
(label) @1
(label) @3
(label) @4
(label) @6
(label) @7
(label) @begin
(label) @end
(byte*) BORDERCOL
@ -1607,7 +1710,7 @@ SYMBOL TABLE SSA
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) gfx_init_chunky::@9
Culled Empty Block (label) @4
Culled Empty Block (label) @7
Succesful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not (bool~) gfx_init_chunky::$4 ← (byte*) gfx_init_chunky::gfxb#3 != (word/dword/signed dword) 32768 from (bool~) gfx_init_chunky::$3 ← (byte*) gfx_init_chunky::gfxb#3 == (word/dword/signed dword) 32768
Succesful SSA optimization Pass2UnaryNotSimplification
@ -1730,7 +1833,8 @@ if() condition always true - replacing block destination if(true) goto main::@3
Succesful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) @1
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@6
Culled Empty Block (label) gfx_init_chunky::@7
@ -1809,14 +1913,14 @@ Constant inlined main::$9 = <(const byte*) CHUNKY#0
Constant inlined main::$7 = (const byte) VIC_DEN#0|(const byte) VIC_ECM#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
Constant inlined main::$8 = (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @3 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2 gfx_init_chunky::@4 gfx_init_chunky::@8 gfx_init_chunky::@3 gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return
Block Sequence Planned @begin @6 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2 gfx_init_chunky::@4 gfx_init_chunky::@8 gfx_init_chunky::@3 gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return
Added new block during phi lifting main::@18(between main::@1 and main::@1)
Added new block during phi lifting gfx_init_chunky::@10(between gfx_init_chunky::@5 and gfx_init_chunky::@1)
Added new block during phi lifting gfx_init_chunky::@11(between gfx_init_chunky::@3 and gfx_init_chunky::@2)
Added new block during phi lifting gfx_init_chunky::@12(between gfx_init_chunky::@2 and gfx_init_chunky::@3)
Block Sequence Planned @begin @3 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 main::@18 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2 gfx_init_chunky::@4 gfx_init_chunky::@8 gfx_init_chunky::@3 gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@return gfx_init_chunky::@10 gfx_init_chunky::@11 gfx_init_chunky::@12 dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return
Block Sequence Planned @begin @6 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 main::@18 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2 gfx_init_chunky::@4 gfx_init_chunky::@8 gfx_init_chunky::@3 gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@return gfx_init_chunky::@10 gfx_init_chunky::@11 gfx_init_chunky::@12 dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @6
Adding NOP phi() at start of @end
Adding NOP phi() at start of gfx_init_chunky
Adding NOP phi() at start of gfx_init_chunky::@6
@ -1854,9 +1958,9 @@ Culled Empty Block (label) main::@18
Culled Empty Block (label) gfx_init_chunky::@10
Culled Empty Block (label) gfx_init_chunky::@11
Culled Empty Block (label) gfx_init_chunky::@12
Block Sequence Planned @begin @3 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2 gfx_init_chunky::@4 gfx_init_chunky::@8 gfx_init_chunky::@3 gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return
Block Sequence Planned @begin @6 @end main main::@17 main::@1 main::@3 main::@5 main::@7 main::@8 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2 gfx_init_chunky::@4 gfx_init_chunky::@8 gfx_init_chunky::@3 gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@return dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @6
Adding NOP phi() at start of @end
Adding NOP phi() at start of gfx_init_chunky
Adding NOP phi() at start of gfx_init_chunky::@6
@ -1871,14 +1975,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@3
@3: scope:[] from @begin
to:@6
@6: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
[3] phi() [ ] ( )
main: scope:[main] from @3
main: scope:[main] from @6
asm { sei }
[5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] )
[6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] )
@ -1980,26 +2084,26 @@ dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBan
DOMINATORS
@begin dominated by @begin
@3 dominated by @begin @3
@end dominated by @begin @end @3
main dominated by @begin main @3
main::@17 dominated by @begin main::@17 main @3
main::@1 dominated by @begin main::@17 main @3 main::@1
main::@3 dominated by @begin main::@17 main @3 main::@1 main::@3
main::@5 dominated by @begin main::@17 main @3 main::@1 main::@5 main::@3
main::@7 dominated by main::@7 @begin main::@17 main @3 main::@1 main::@5 main::@3
main::@8 dominated by main::@7 @begin main::@8 main::@17 main @3 main::@1 main::@5 main::@3
gfx_init_chunky dominated by @begin main @3 gfx_init_chunky
gfx_init_chunky::@1 dominated by @begin main @3 gfx_init_chunky gfx_init_chunky::@1
gfx_init_chunky::@2 dominated by @begin main @3 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@4 dominated by @begin main @3 gfx_init_chunky::@4 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@8 dominated by @begin main @3 gfx_init_chunky::@4 gfx_init_chunky gfx_init_chunky::@8 gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@3 dominated by @begin main gfx_init_chunky::@3 @3 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@5 dominated by @begin main gfx_init_chunky::@5 gfx_init_chunky::@3 @3 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@6 dominated by @begin main gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@3 @3 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@return dominated by @begin main gfx_init_chunky::@return gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@3 @3 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
dtvSetCpuBankSegment1 dominated by @begin dtvSetCpuBankSegment1 main @3 gfx_init_chunky
dtvSetCpuBankSegment1::@return dominated by @begin dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return main @3 gfx_init_chunky
@6 dominated by @begin @6
@end dominated by @begin @end @6
main dominated by @begin main @6
main::@17 dominated by @begin main::@17 main @6
main::@1 dominated by @begin main::@17 main @6 main::@1
main::@3 dominated by @begin main::@17 main @6 main::@1 main::@3
main::@5 dominated by @begin main::@17 main @6 main::@1 main::@5 main::@3
main::@7 dominated by main::@7 @begin main::@17 main @6 main::@1 main::@5 main::@3
main::@8 dominated by main::@7 @begin main::@8 main::@17 main @6 main::@1 main::@5 main::@3
gfx_init_chunky dominated by @begin main @6 gfx_init_chunky
gfx_init_chunky::@1 dominated by @begin main @6 gfx_init_chunky gfx_init_chunky::@1
gfx_init_chunky::@2 dominated by @begin main @6 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@4 dominated by @begin main gfx_init_chunky::@4 @6 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@8 dominated by @begin main gfx_init_chunky::@4 @6 gfx_init_chunky gfx_init_chunky::@8 gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@3 dominated by @begin main gfx_init_chunky::@3 @6 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@5 dominated by @begin main gfx_init_chunky::@5 gfx_init_chunky::@3 @6 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@6 dominated by @begin main gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@3 @6 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
gfx_init_chunky::@return dominated by @begin main gfx_init_chunky::@return gfx_init_chunky::@5 gfx_init_chunky::@6 gfx_init_chunky::@3 @6 gfx_init_chunky gfx_init_chunky::@1 gfx_init_chunky::@2
dtvSetCpuBankSegment1 dominated by @begin dtvSetCpuBankSegment1 main @6 gfx_init_chunky
dtvSetCpuBankSegment1::@return dominated by @begin dtvSetCpuBankSegment1 dtvSetCpuBankSegment1::@return main @6 gfx_init_chunky
NATURAL LOOPS
Found back edge: Loop head: main::@1 tails: main::@1 blocks: null
@ -2187,15 +2291,15 @@ INITIAL ASM
.label CHUNKY = $8000
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
b3_from_bbegin:
jmp b3
//SEG4 @3
b3:
//SEG3 [1] phi from @begin to @6 [phi:@begin->@6]
b6_from_bbegin:
jmp b6
//SEG4 @6
b6:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @3 to @end [phi:@3->@end]
bend_from_b3:
//SEG6 [3] phi from @6 to @end [phi:@6->@end]
bend_from_b6:
jmp bend
//SEG7 @end
bend:
@ -2712,15 +2816,15 @@ ASSEMBLER BEFORE OPTIMIZATION
.label CHUNKY = $8000
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
b3_from_bbegin:
jmp b3
//SEG4 @3
b3:
//SEG3 [1] phi from @begin to @6 [phi:@begin->@6]
b6_from_bbegin:
jmp b6
//SEG4 @6
b6:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @3 to @end [phi:@3->@end]
bend_from_b3:
//SEG6 [3] phi from @6 to @end [phi:@6->@end]
bend_from_b6:
jmp bend
//SEG7 @end
bend:
@ -3077,7 +3181,7 @@ dtvSetCpuBankSegment1: {
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b3
Removing instruction jmp b6
Removing instruction jmp bend
Removing instruction jmp b17
Removing instruction jmp b1
@ -3105,8 +3209,8 @@ Replacing label b2_from_b3 with b2
Replacing label b2_from_b3 with b2
Replacing label b1_from_b5 with b1
Removing instruction bbegin:
Removing instruction b3_from_bbegin:
Removing instruction bend_from_b3:
Removing instruction b6_from_bbegin:
Removing instruction bend_from_b6:
Removing instruction b1_from_b1:
Removing instruction b1_from_b5:
Removing instruction b2_from_b1:
@ -3115,7 +3219,7 @@ Removing instruction b3_from_b2:
Removing instruction b6_from_b5:
Removing instruction dtvSetCpuBankSegment1_from_b6:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b3:
Removing instruction b6:
Removing instruction bend:
Removing instruction gfx_init_chunky_from_main:
Removing instruction b17:
@ -3139,7 +3243,7 @@ Removing instruction jmp b3
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
(label) @3
(label) @6
(label) @begin
(label) @end
(byte*) BORDERCOL
@ -3312,11 +3416,11 @@ Score: 19888
.label DTV_PLANEB_MODULO_HI = $d048
.label CHUNKY = $8000
//SEG2 @begin
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
//SEG4 @3
//SEG3 [1] phi from @begin to @6 [phi:@begin->@6]
//SEG4 @6
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @3 to @end [phi:@3->@end]
//SEG6 [3] phi from @6 to @end [phi:@6->@end]
//SEG7 @end
//SEG8 main
main: {

View File

@ -1,4 +1,4 @@
(label) @3
(label) @6
(label) @begin
(label) @end
(byte*) BORDERCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
to:@5
@5: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
[3] phi() [ ] ( )
main: scope:[main] from @2
main: scope:[main] from @5
[4] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] )
[5] *((const byte*) DTV_BLITTER_CONTROL2#0) ← (const byte) DTV_BLIT_CLEAR_IRQ#0 [ ] ( main:2 [ ] )
[6] *((const byte*) DTV_BLITTER_SRCA_LO#0) ← <(const byte[]) SRCA#0 [ ] ( main:2 [ ] )

View File

@ -344,9 +344,30 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
SYMBOLS
(label) @1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @begin
(label) @end
(byte*) BGCOL
@ -545,6 +566,34 @@ SYMBOLS
(label) main::@4
(label) main::@return
(byte) main::r
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -701,6 +750,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte*) DTV_FEATURE ← ((byte*)) (word/dword/signed dword) 53311
(byte) DTV_FEATURE_ENABLE ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_FEATURE_DISABLE_TIL_RESET ← (byte/signed byte/word/signed word/dword/signed dword) 2
@ -732,7 +826,7 @@ INITIAL CONTROL FLOW GRAPH
(dword) DTV_COLOR_BANK_DEFAULT ← (dword/signed dword) 120832
(byte*) DTV_GRAPHICS_VIC_BANK ← ((byte*)) (word/dword/signed dword) 53309
(byte*) DTV_GRAPHICS_HICOL_BANK ← ((byte*)) (word/dword/signed dword) 53310
to:@1
to:@4
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from
(byte*) dtvSetCpuBankSegment1::cpuBank ← ((byte*)) (byte/word/signed word/dword/signed dword) 255
*((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx
@ -741,7 +835,7 @@ dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from
dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1
return
to:@return
@1: scope:[] from @begin
@4: scope:[] from @3
(byte*) DTV_BLITTER_SRCA_LO ← ((byte*)) (word/dword/signed dword) 54048
(byte*) DTV_BLITTER_SRCA_MI ← ((byte*)) (word/dword/signed dword) 54049
(byte*) DTV_BLITTER_SRCA_HI ← ((byte*)) (word/dword/signed dword) 54050
@ -810,7 +904,7 @@ dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBan
(byte[]) SRCA ← { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
(byte) SRCA_LEN ← (byte/signed byte/word/signed word/dword/signed dword) 9
(byte[]) SRCB ← { (byte/word/signed word/dword/signed dword) 128 }
to:@2
to:@5
main: scope:[main] from
*((byte*) DTV_FEATURE) ← (byte) DTV_FEATURE_ENABLE
*((byte*) DTV_BLITTER_CONTROL2) ← (byte) DTV_BLIT_CLEAR_IRQ
@ -882,11 +976,15 @@ main::@4: scope:[main] from main::@3
main::@return: scope:[main] from main::@4
return
to:@return
@2: scope:[] from @1
@5: scope:[] from @4
call main
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Removing unused procedure dtvSetCpuBankSegment1
Eliminating unused variable (byte*) PROCPORT_DDR and assignment [0] (byte*) PROCPORT_DDR ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0
Eliminating unused variable (byte) PROCPORT_DDR_MEMORY_MASK and assignment [1] (byte) PROCPORT_DDR_MEMORY_MASK ← (byte/signed byte/word/signed word/dword/signed dword) 7
@ -1007,6 +1105,8 @@ Eliminating unused variable (byte) DTV_BLIT_SUB and assignment [152] (byte) DTV_
Eliminating unused variable (byte) DTV_BLIT_SRCA_CONT and assignment [155] (byte) DTV_BLIT_SRCA_CONT ← (byte/signed byte/word/signed word/dword/signed dword) 2
Eliminating unused variable (byte) DTV_BLIT_SRCB_CONT and assignment [156] (byte) DTV_BLIT_SRCB_CONT ← (byte/signed byte/word/signed word/dword/signed dword) 4
Eliminating unused variable (byte) DTV_BLIT_STATUS_IRQ and assignment [159] (byte) DTV_BLIT_STATUS_IRQ ← (byte/signed byte/word/signed word/dword/signed dword) 2
Removing empty block @1
Removing empty block @2
Removing empty block main::@4
PROCEDURE MODIFY VARIABLE ANALYSIS
@ -1016,10 +1116,12 @@ Completing Phi functions...
CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
@begin: scope:[] from
to:@3
@3: scope:[] from @begin
(byte*) DTV_FEATURE#0 ← ((byte*)) (word/dword/signed dword) 53311
(byte) DTV_FEATURE_ENABLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
to:@1
@1: scope:[] from @begin
to:@4
@4: scope:[] from @3
(byte*) DTV_BLITTER_SRCA_LO#0 ← ((byte*)) (word/dword/signed dword) 54048
(byte*) DTV_BLITTER_SRCA_MI#0 ← ((byte*)) (word/dword/signed dword) 54049
(byte*) DTV_BLITTER_SRCA_HI#0 ← ((byte*)) (word/dword/signed dword) 54050
@ -1063,9 +1165,9 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte[]) SRCA#0 ← { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
(byte) SRCA_LEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 9
(byte[]) SRCB#0 ← { (byte/word/signed word/dword/signed dword) 128 }
to:@2
main: scope:[main] from @2
(byte*) DTV_BLITTER_ALU#1 ← phi( @2/(byte*) DTV_BLITTER_ALU#2 )
to:@5
main: scope:[main] from @5
(byte*) DTV_BLITTER_ALU#1 ← phi( @5/(byte*) DTV_BLITTER_ALU#2 )
*((byte*) DTV_FEATURE#0) ← (byte) DTV_FEATURE_ENABLE#0
*((byte*) DTV_BLITTER_CONTROL2#0) ← (byte) DTV_BLIT_CLEAR_IRQ#0
(byte~) main::$0 ← < (byte[]) SRCA#0
@ -1137,18 +1239,19 @@ main::@3: scope:[main] from main::@2
main::@return: scope:[main] from main::@3
return
to:@return
@2: scope:[] from @1
(byte*) DTV_BLITTER_ALU#2 ← phi( @1/(byte*) DTV_BLITTER_ALU#0 )
@5: scope:[] from @4
(byte*) DTV_BLITTER_ALU#2 ← phi( @4/(byte*) DTV_BLITTER_ALU#0 )
call main
to:@3
@3: scope:[] from @2
to:@6
@6: scope:[] from @5
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @6
(label) @begin
(label) @end
(byte*) DTV_BLITTER_ALU
@ -1277,7 +1380,7 @@ SYMBOL TABLE SSA
(byte) main::r#4
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) @3
Culled Empty Block (label) @6
Succesful SSA optimization Pass2CullEmptyBlocks
Not aliassing across scopes: DTV_BLITTER_ALU#1 DTV_BLITTER_ALU#2
Alias (byte) main::r#1 = (byte) main::r#4
@ -1360,7 +1463,8 @@ Succesful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$14 = main::$13|DTV_BLIT_DEST_FWD#0
Constant (const byte) main::$19 = main::$18|DTV_BLIT_DEST_FWD#0
Succesful SSA optimization Pass2ConstantIdentification
Culled Empty Block (label) @1
Culled Empty Block (label) @3
Culled Empty Block (label) @4
Culled Empty Block (label) main::@1
Succesful SSA optimization Pass2CullEmptyBlocks
OPTIMIZING CONTROL FLOW GRAPH
@ -1386,11 +1490,11 @@ Constant inlined main::$9 = >(const byte*) SCREEN#0
Constant inlined main::$7 = >(word/signed word/dword/signed dword) 256
Constant inlined main::$8 = <(const byte*) SCREEN#0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@return
Block Sequence Planned @begin @5 @end main main::@2 main::@3 main::@return
Added new block during phi lifting main::@5(between main::@3 and main::@2)
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@return main::@5
Block Sequence Planned @begin @5 @end main main::@2 main::@3 main::@return main::@5
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
@ -1404,9 +1508,9 @@ Created 1 initial phi equivalence classes
Coalesced [43] main::r#5 ← main::r#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) main::@5
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@return
Block Sequence Planned @begin @5 @end main main::@2 main::@3 main::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
Propagating live ranges...
Propagating live ranges...
@ -1417,14 +1521,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
to:@5
@5: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
[3] phi() [ ] ( )
main: scope:[main] from @2
main: scope:[main] from @5
[4] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] )
[5] *((const byte*) DTV_BLITTER_CONTROL2#0) ← (const byte) DTV_BLIT_CLEAR_IRQ#0 [ ] ( main:2 [ ] )
[6] *((const byte*) DTV_BLITTER_SRCA_LO#0) ← <(const byte[]) SRCA#0 [ ] ( main:2 [ ] )
@ -1474,12 +1578,12 @@ main::@return: scope:[main] from main::@3
DOMINATORS
@begin dominated by @begin
@2 dominated by @2 @begin
@end dominated by @2 @begin @end
main dominated by @2 @begin main
main::@2 dominated by @2 @begin main::@2 main
main::@3 dominated by @2 @begin main::@2 main main::@3
main::@return dominated by main::@return @2 @begin main::@2 main main::@3
@5 dominated by @begin @5
@end dominated by @begin @5 @end
main dominated by @begin @5 main
main::@2 dominated by @begin @5 main::@2 main
main::@3 dominated by @begin @5 main::@2 main main::@3
main::@return dominated by main::@return @begin @5 main::@2 main main::@3
NATURAL LOOPS
Found back edge: Loop head: main::@2 tails: main::@2 blocks: null
@ -1610,15 +1714,15 @@ INITIAL ASM
.const SRCA_LEN = 9
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG4 @2
b2:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
jmp b5
//SEG4 @5
b5:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
jmp bend
//SEG7 @end
bend:
@ -1896,15 +2000,15 @@ ASSEMBLER BEFORE OPTIMIZATION
.const SRCA_LEN = 9
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG4 @2
b2:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
jmp b5
//SEG4 @5
b5:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
jmp bend
//SEG7 @end
bend:
@ -2047,7 +2151,7 @@ main: {
SRCB: .byte $80
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp b5
Removing instruction jmp bend
Removing instruction jmp b2
Removing instruction jmp b3
@ -2062,11 +2166,11 @@ Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b2_from_b3 with b2
Removing instruction bbegin:
Removing instruction b2_from_bbegin:
Removing instruction bend_from_b2:
Removing instruction b5_from_bbegin:
Removing instruction bend_from_b5:
Removing instruction b2_from_b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b2:
Removing instruction b5:
Removing instruction bend:
Removing instruction b2_from_main:
Removing instruction b3:
@ -2084,7 +2188,7 @@ Removing instruction jmp b2
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
(label) @2
(label) @5
(label) @begin
(label) @end
(byte*) DTV_BLITTER_ALU
@ -2242,11 +2346,11 @@ Score: 1567
.label SCREEN = $400
.const SRCA_LEN = 9
//SEG2 @begin
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
//SEG4 @2
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
//SEG4 @5
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
//SEG7 @end
//SEG8 main
main: {

View File

@ -1,4 +1,4 @@
(label) @2
(label) @5
(label) @begin
(label) @end
(byte*) DTV_BLITTER_ALU

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
to:@5
@5: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
[3] phi() [ ] ( )
main: scope:[main] from @2
main: scope:[main] from @5
asm { sei }
[5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] )
[6] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0|(const byte) DTV_BADLINE_OFF#0 [ ] ( main:2 [ ] )

View File

@ -311,11 +311,32 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Adding pre/post-modifier *((byte*) BGCOL) ← ++ *((byte*) BGCOL)
Adding pre/post-modifier *((byte[16]) main::palette + (byte) main::c) ← ++ *((byte[16]) main::palette + (byte) main::c)
SYMBOLS
(label) @1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @begin
(label) @end
(byte*) BGCOL
@ -508,6 +529,34 @@ SYMBOLS
(byte) main::c
(byte[16]) main::palette
(byte) main::r
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -663,6 +712,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte*) DTV_FEATURE ← ((byte*)) (word/dword/signed dword) 53311
(byte) DTV_FEATURE_ENABLE ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_FEATURE_DISABLE_TIL_RESET ← (byte/signed byte/word/signed word/dword/signed dword) 2
@ -694,7 +788,7 @@ INITIAL CONTROL FLOW GRAPH
(dword) DTV_COLOR_BANK_DEFAULT ← (dword/signed dword) 120832
(byte*) DTV_GRAPHICS_VIC_BANK ← ((byte*)) (word/dword/signed dword) 53309
(byte*) DTV_GRAPHICS_HICOL_BANK ← ((byte*)) (word/dword/signed dword) 53310
to:@1
to:@4
dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from
(byte*) dtvSetCpuBankSegment1::cpuBank ← ((byte*)) (byte/word/signed word/dword/signed dword) 255
*((byte*) dtvSetCpuBankSegment1::cpuBank) ← (byte) dtvSetCpuBankSegment1::cpuBankIdx
@ -703,7 +797,7 @@ dtvSetCpuBankSegment1: scope:[dtvSetCpuBankSegment1] from
dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBankSegment1
return
to:@return
@1: scope:[] from @begin
@4: scope:[] from @3
(byte*) DTV_BLITTER_SRCA_LO ← ((byte*)) (word/dword/signed dword) 54048
(byte*) DTV_BLITTER_SRCA_MI ← ((byte*)) (word/dword/signed dword) 54049
(byte*) DTV_BLITTER_SRCA_HI ← ((byte*)) (word/dword/signed dword) 54050
@ -768,7 +862,7 @@ dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBan
(byte) DTV_BLIT_DEST_CONT ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) DTV_BLIT_STATUS_BUSY ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) DTV_BLIT_STATUS_IRQ ← (byte/signed byte/word/signed word/dword/signed dword) 2
to:@2
to:@5
main: scope:[main] from
asm { sei }
*((byte*) DTV_FEATURE) ← (byte) DTV_FEATURE_ENABLE
@ -828,11 +922,15 @@ main::@16: scope:[main] from
main::@return: scope:[main] from main::@3
return
to:@return
@2: scope:[] from @1
@5: scope:[] from @4
call main
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Removing unused procedure dtvSetCpuBankSegment1
Eliminating unused variable (byte*) PROCPORT_DDR and assignment [0] (byte*) PROCPORT_DDR ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0
Eliminating unused variable (byte) PROCPORT_DDR_MEMORY_MASK and assignment [1] (byte) PROCPORT_DDR_MEMORY_MASK ← (byte/signed byte/word/signed word/dword/signed dword) 7
@ -986,6 +1084,8 @@ Eliminating unused variable (byte) DTV_BLIT_DEST_CONT and assignment [157] (byte
Eliminating unused variable (byte) DTV_BLIT_STATUS_BUSY and assignment [158] (byte) DTV_BLIT_STATUS_BUSY ← (byte/signed byte/word/signed word/dword/signed dword) 1
Eliminating unused variable (byte) DTV_BLIT_STATUS_IRQ and assignment [159] (byte) DTV_BLIT_STATUS_IRQ ← (byte/signed byte/word/signed word/dword/signed dword) 2
Removing empty block @1
Removing empty block @2
Removing empty block @4
Removing empty block main::@9
Removing empty block main::@3
Removing empty block main::@10
@ -1002,6 +1102,8 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
@begin: scope:[] from
(byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) 53266
(byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) 53281
to:@3
@3: scope:[] from @begin
(byte*) DTV_FEATURE#0 ← ((byte*)) (word/dword/signed dword) 53311
(byte) DTV_FEATURE_ENABLE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) DTV_CONTROL#0 ← ((byte*)) (word/dword/signed dword) 53308
@ -1009,8 +1111,8 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte) DTV_HIGHCOLOR#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) DTV_BADLINE_OFF#0 ← (byte/signed byte/word/signed word/dword/signed dword) 32
(byte*) DTV_PALETTE#0 ← ((byte*)) (word/dword/signed dword) 53760
to:@2
main: scope:[main] from @2
to:@5
main: scope:[main] from @5
asm { sei }
*((byte*) DTV_FEATURE#0) ← (byte) DTV_FEATURE_ENABLE#0
(byte~) main::$0 ← (byte) DTV_HIGHCOLOR#0 | (byte) DTV_BORDER_OFF#0
@ -1055,16 +1157,17 @@ main::@8: scope:[main] from main::@14 main::@8
main::@return: scope:[main] from main::@1
return
to:@return
@2: scope:[] from @begin
@5: scope:[] from @3
call main
to:@3
@3: scope:[] from @2
to:@6
@6: scope:[] from @5
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
SYMBOL TABLE SSA
(label) @2
(label) @3
(label) @5
(label) @6
(label) @begin
(label) @end
(byte*) BGCOL
@ -1114,7 +1217,7 @@ SYMBOL TABLE SSA
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@5
Culled Empty Block (label) @3
Culled Empty Block (label) @6
Succesful SSA optimization Pass2CullEmptyBlocks
Simple Condition (bool~) main::$2 if(*((byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 64) goto main::@4
Simple Condition (bool~) main::$3 if((byte) main::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@7
@ -1141,6 +1244,7 @@ if() condition always true - replacing block destination if(true) goto main::@4
Succesful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) @3
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@14
Succesful SSA optimization Pass2CullEmptyBlocks
@ -1154,12 +1258,12 @@ Constant inlined main::c#0 = (byte/signed byte/word/signed word/dword/signed dwo
Constant inlined main::$1 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0|(const byte) DTV_BADLINE_OFF#0
Constant inlined main::$0 = (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @2 @end main main::@4 main::@6 main::@7 main::@8
Block Sequence Planned @begin @5 @end main main::@4 main::@6 main::@7 main::@8
Added new block during phi lifting main::@17(between main::@7 and main::@7)
Added new block during phi lifting main::@18(between main::@8 and main::@8)
Block Sequence Planned @begin @2 @end main main::@4 main::@6 main::@7 main::@8 main::@18 main::@17
Block Sequence Planned @begin @5 @end main main::@4 main::@6 main::@7 main::@8 main::@18 main::@17
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
@ -1174,9 +1278,9 @@ Coalesced [20] main::r#3 ← main::r#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) main::@18
Culled Empty Block (label) main::@17
Block Sequence Planned @begin @2 @end main main::@4 main::@6 main::@7 main::@8
Block Sequence Planned @begin @5 @end main main::@4 main::@6 main::@7 main::@8
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
Propagating live ranges...
Propagating live ranges...
@ -1186,14 +1290,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
to:@5
@5: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
[3] phi() [ ] ( )
main: scope:[main] from @2
main: scope:[main] from @5
asm { sei }
[5] *((const byte*) DTV_FEATURE#0) ← (const byte) DTV_FEATURE_ENABLE#0 [ ] ( main:2 [ ] )
[6] *((const byte*) DTV_CONTROL#0) ← (const byte) DTV_HIGHCOLOR#0|(const byte) DTV_BORDER_OFF#0|(const byte) DTV_BADLINE_OFF#0 [ ] ( main:2 [ ] )
@ -1221,13 +1325,13 @@ main::@8: scope:[main] from main::@7 main::@8
DOMINATORS
@begin dominated by @begin
@2 dominated by @2 @begin
@end dominated by @2 @begin @end
main dominated by @2 @begin main
main::@4 dominated by @2 @begin main main::@4
main::@6 dominated by @2 @begin main main::@6 main::@4
main::@7 dominated by @2 main::@7 @begin main main::@6 main::@4
main::@8 dominated by @2 main::@7 @begin main::@8 main main::@6 main::@4
@5 dominated by @begin @5
@end dominated by @begin @5 @end
main dominated by @begin @5 main
main::@4 dominated by @begin @5 main main::@4
main::@6 dominated by @begin @5 main main::@6 main::@4
main::@7 dominated by main::@7 @begin @5 main main::@6 main::@4
main::@8 dominated by main::@7 @begin main::@8 @5 main main::@6 main::@4
NATURAL LOOPS
Found back edge: Loop head: main::@4 tails: main::@4 blocks: null
@ -1301,15 +1405,15 @@ INITIAL ASM
.label DTV_PALETTE = $d200
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG4 @2
b2:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
jmp b5
//SEG4 @5
b5:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
jmp bend
//SEG7 @end
bend:
@ -1451,15 +1555,15 @@ ASSEMBLER BEFORE OPTIMIZATION
.label DTV_PALETTE = $d200
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG4 @2
b2:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
jmp b5
//SEG4 @5
b5:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
jmp bend
//SEG7 @end
bend:
@ -1556,7 +1660,7 @@ main: {
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp b5
Removing instruction jmp bend
Removing instruction jmp b4
Removing instruction jmp b6
@ -1566,12 +1670,12 @@ Succesful ASM optimization Pass5NextJumpElimination
Replacing label b7_from_b7 with b7
Replacing label b8_from_b8 with b8
Removing instruction bbegin:
Removing instruction b2_from_bbegin:
Removing instruction bend_from_b2:
Removing instruction b5_from_bbegin:
Removing instruction bend_from_b5:
Removing instruction b7_from_b7:
Removing instruction b8_from_b8:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b2:
Removing instruction b5:
Removing instruction bend:
Removing instruction b6:
Removing instruction b7_from_b6:
@ -1582,7 +1686,7 @@ Removing instruction jmp b8
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
(label) @2
(label) @5
(label) @begin
(label) @end
(byte*) BGCOL
@ -1639,11 +1743,11 @@ Score: 10180
.const DTV_BADLINE_OFF = $20
.label DTV_PALETTE = $d200
//SEG2 @begin
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
//SEG4 @2
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
//SEG4 @5
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
//SEG7 @end
//SEG8 main
main: {

View File

@ -1,4 +1,4 @@
(label) @2
(label) @5
(label) @begin
(label) @end
(byte*) BGCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@59
@59: scope:[] from @begin
to:@62
@62: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @59
@end: scope:[] from @62
[3] phi() [ ] ( )
main: scope:[main] from @59
main: scope:[main] from @62
asm { sei }
[5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] )
[6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] )

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
(label) @59
(label) @62
(label) @begin
(label) @end
(byte*) BGCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@45
@45: scope:[] from @begin
to:@48
@48: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @45
@end: scope:[] from @48
[3] phi() [ ] ( )
main: scope:[main] from @45
main: scope:[main] from @48
asm { sei }
[5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] )
[6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] )

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
(label) @45
(label) @48
(label) @begin
(label) @end
(byte*) BGCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@15
@15: scope:[] from @begin
to:@18
@18: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @15
@end: scope:[] from @18
[3] phi() [ ] ( )
main: scope:[main] from @15
main: scope:[main] from @18
[4] phi() [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main main::@1

View File

@ -189,6 +189,24 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Importing multiply.kc
PARSING src/test/java/dk/camelot64/kickc/test/kc/multiply.kc
// Simple binary multiplication implementation
@ -510,6 +528,9 @@ SYMBOLS
(label) @13
(label) @14
(label) @15
(label) @16
(label) @17
(label) @18
(label) @2
(label) @3
(label) @4
@ -1003,6 +1024,34 @@ SYMBOLS
(label) print_str_at::@return
(byte*) print_str_at::at
(byte*) print_str_at::str
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Fixing lo/hi-lvalue with new tmpVar mul8s::$16 mul8s::$16 ← mul8s::$8
Fixing lo/hi-lvalue with new tmpVar mul8s::$17 mul8s::$17 ← mul8s::$14
@ -1116,6 +1165,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
to:@4
mul8u: scope:[mul8u] from
(word) mul8u::res ← (byte/signed byte/word/signed word/dword/signed dword) 0
(word) mul8u::mb ← ((word)) (byte) mul8u::b
@ -1155,8 +1249,8 @@ mul8u::@return: scope:[mul8u] from mul8u::@3 mul8u::@9
to:@return
mul8u::@9: scope:[mul8u] from
to:mul8u::@return
@1: scope:[] from @begin
to:@2
@4: scope:[] from @3
to:@5
mul8s: scope:[mul8s] from
(byte~) mul8s::$0 ← ((byte)) (signed byte) mul8s::a
(byte~) mul8s::$1 ← ((byte)) (signed byte) mul8s::b
@ -1197,8 +1291,8 @@ mul8s::@return: scope:[mul8s] from mul8s::@2 mul8s::@5
to:@return
mul8s::@5: scope:[mul8s] from
to:mul8s::@return
@2: scope:[] from @1
to:@3
@5: scope:[] from @4
to:@6
mul8su: scope:[mul8su] from
(byte~) mul8su::$0 ← ((byte)) (signed byte) mul8su::a
(byte~) mul8su::$1 ← ((byte)) (byte) mul8su::b
@ -1226,8 +1320,8 @@ mul8su::@return: scope:[mul8su] from mul8su::@1 mul8su::@3
to:@return
mul8su::@3: scope:[mul8su] from
to:mul8su::@return
@3: scope:[] from @2
to:@4
@6: scope:[] from @5
to:@7
mul16u: scope:[mul16u] from
(dword) mul16u::res ← (byte/signed byte/word/signed word/dword/signed dword) 0
(dword) mul16u::mb ← ((dword)) (word) mul16u::b
@ -1267,8 +1361,8 @@ mul16u::@return: scope:[mul16u] from mul16u::@3 mul16u::@9
to:@return
mul16u::@9: scope:[mul16u] from
to:mul16u::@return
@4: scope:[] from @3
to:@5
@7: scope:[] from @6
to:@8
mul16s: scope:[mul16s] from
(word~) mul16s::$0 ← ((word)) (signed word) mul16s::a
(word~) mul16s::$1 ← ((word)) (signed word) mul16s::b
@ -1309,7 +1403,7 @@ mul16s::@return: scope:[mul16s] from mul16s::@2 mul16s::@5
to:@return
mul16s::@5: scope:[mul16s] from
to:mul16s::@return
@5: scope:[] from @4
@8: scope:[] from @7
(byte) KEY_DEL ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) KEY_RETURN ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) KEY_CRSR_RIGHT ← (byte/signed byte/word/signed word/dword/signed dword) 2
@ -1377,7 +1471,7 @@ mul16s::@5: scope:[mul16s] from
(byte[]) keyboard_char_keycodes ← { (byte) KEY_AT, (byte) KEY_A, (byte) KEY_B, (byte) KEY_C, (byte) KEY_D, (byte) KEY_E, (byte) KEY_F, (byte) KEY_G, (byte) KEY_H, (byte) KEY_I, (byte) KEY_J, (byte) KEY_K, (byte) KEY_L, (byte) KEY_M, (byte) KEY_N, (byte) KEY_O, (byte) KEY_P, (byte) KEY_Q, (byte) KEY_R, (byte) KEY_S, (byte) KEY_T, (byte) KEY_U, (byte) KEY_V, (byte) KEY_W, (byte) KEY_X, (byte) KEY_Y, (byte) KEY_Z, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP, (byte) KEY_ARROW_LEFT, (byte) KEY_SPACE, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK, (byte) KEY_PLUS, (byte) KEY_COMMA, (byte) KEY_MINUS, (byte) KEY_DOT, (byte) KEY_SLASH, (byte) KEY_0, (byte) KEY_1, (byte) KEY_2, (byte) KEY_3, (byte) KEY_4, (byte) KEY_5, (byte) KEY_6, (byte) KEY_7, (byte) KEY_8, (byte) KEY_9, (byte) KEY_COLON, (byte) KEY_SEMICOLON, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 }
(byte[8]) keyboard_matrix_row_bitmask ← { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte[8]) keyboard_matrix_col_bitmask ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
to:@6
to:@9
keyboard_init: scope:[keyboard_init] from
*((byte*) CIA1_PORT_A_DDR) ← (byte/word/signed word/dword/signed dword) 255
*((byte*) CIA1_PORT_B_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1385,8 +1479,8 @@ keyboard_init: scope:[keyboard_init] from
keyboard_init::@return: scope:[keyboard_init] from keyboard_init
return
to:@return
@6: scope:[] from @5
to:@7
@9: scope:[] from @8
to:@10
keyboard_matrix_read: scope:[keyboard_matrix_read] from
*((byte*) CIA1_PORT_A) ← *((byte[8]) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid)
(byte~) keyboard_matrix_read::$0 ← ~ *((byte*) CIA1_PORT_B)
@ -1399,8 +1493,8 @@ keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matri
to:@return
keyboard_matrix_read::@1: scope:[keyboard_matrix_read] from
to:keyboard_matrix_read::@return
@7: scope:[] from @6
to:@8
@10: scope:[] from @9
to:@11
keyboard_key_pressed: scope:[keyboard_key_pressed] from
(byte~) keyboard_key_pressed::$0 ← (byte) keyboard_key_pressed::key & (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) keyboard_key_pressed::colidx ← (byte~) keyboard_key_pressed::$0
@ -1416,8 +1510,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
to:@return
keyboard_key_pressed::@1: scope:[keyboard_key_pressed] from
to:keyboard_key_pressed::@return
@8: scope:[] from @7
to:@9
@11: scope:[] from @10
to:@12
keyboard_get_keycode: scope:[keyboard_get_keycode] from
(byte) keyboard_get_keycode::return ← *((byte[]) keyboard_char_keycodes + (byte) keyboard_get_keycode::ch)
to:keyboard_get_keycode::@return
@ -1427,7 +1521,7 @@ keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_k
to:@return
keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from
to:keyboard_get_keycode::@return
@9: scope:[] from @8
@12: scope:[] from @11
(byte[8]) keyboard_events ← { fill( 8, 0) }
(byte) keyboard_events_size ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) keyboard_modifiers ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1438,7 +1532,7 @@ keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from
(byte~) $0 ← (byte) KEY_MODIFIER_LSHIFT | (byte) KEY_MODIFIER_RSHIFT
(byte) KEY_MODIFIER_SHIFT ← (byte~) $0
(byte[8]) keyboard_scan_values ← { fill( 8, 0) }
to:@10
to:@13
keyboard_event_scan: scope:[keyboard_event_scan] from
(byte) keyboard_event_scan::keycode ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) keyboard_event_scan::row ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1551,8 +1645,8 @@ keyboard_event_scan::@24: scope:[keyboard_event_scan] from keyboard_event_scan:
keyboard_event_scan::@return: scope:[keyboard_event_scan] from keyboard_event_scan::@12
return
to:@return
@10: scope:[] from @9
to:@11
@13: scope:[] from @12
to:@14
keyboard_event_pressed: scope:[keyboard_event_pressed] from
(byte~) keyboard_event_pressed::$0 ← (byte) keyboard_event_pressed::keycode >> (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) keyboard_event_pressed::row_bits ← *((byte[8]) keyboard_scan_values + (byte~) keyboard_event_pressed::$0)
@ -1566,8 +1660,8 @@ keyboard_event_pressed::@return: scope:[keyboard_event_pressed] from keyboard_e
to:@return
keyboard_event_pressed::@1: scope:[keyboard_event_pressed] from
to:keyboard_event_pressed::@return
@11: scope:[] from @10
to:@12
@14: scope:[] from @13
to:@15
keyboard_event_get: scope:[keyboard_event_get] from
(bool~) keyboard_event_get::$0 ← (byte) keyboard_events_size == (byte/signed byte/word/signed word/dword/signed dword) 0
if((bool~) keyboard_event_get::$0) goto keyboard_event_get::@1
@ -1591,9 +1685,9 @@ keyboard_event_get::@5: scope:[keyboard_event_get] from
to:keyboard_event_get::@1
keyboard_event_get::@6: scope:[keyboard_event_get] from
to:keyboard_event_get::@2
@12: scope:[] from @11
@15: scope:[] from @14
(byte*) SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@13
to:@16
main: scope:[main] from
(byte*) main::sc ← (byte*) SCREEN
to:main::@1
@ -1713,8 +1807,8 @@ main::@24: scope:[main] from main::@23
main::@return: scope:[main] from main::@24
return
to:@return
@13: scope:[] from @12
to:@14
@16: scope:[] from @15
to:@17
print_str_at: scope:[print_str_at] from
to:print_str_at::@1
print_str_at::@1: scope:[print_str_at] from print_str_at print_str_at::@2
@ -1737,8 +1831,8 @@ print_str_at::@6: scope:[print_str_at] from
print_str_at::@return: scope:[print_str_at] from print_str_at::@3
return
to:@return
@14: scope:[] from @13
to:@15
@17: scope:[] from @16
to:@18
plot_chargen: scope:[plot_chargen] from
asm { sei }
(word~) plot_chargen::$0 ← ((word)) (byte) plot_chargen::ch
@ -1799,11 +1893,15 @@ plot_chargen::@8: scope:[plot_chargen] from plot_chargen::@7
plot_chargen::@return: scope:[plot_chargen] from plot_chargen::@8
return
to:@return
@15: scope:[] from @14
@18: scope:[] from @17
call main
to:@end
@end: scope:[] from @15
@end: scope:[] from @18
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Removing unused procedure mul8s
Removing unused procedure mul8su
Removing unused procedure mul16s
@ -1902,31 +2000,34 @@ Creating constant string variable for inline (const string) main::str "f1@"
Creating constant string variable for inline (const string) main::str1 "f3@"
Creating constant string variable for inline (const string) main::str2 "f5@"
Creating constant string variable for inline (const string) main::str3 "f7@"
Removing empty block @1
Removing empty block @2
Removing empty block @3
Removing empty block mul8u::@5
Removing empty block mul8u::@6
Removing empty block mul8u::@8
Removing empty block mul8u::@9
Removing empty block @1
Removing empty block @2
Removing empty block @3
Removing empty block @4
Removing empty block @5
Removing empty block @6
Removing empty block keyboard_matrix_read::@1
Removing empty block @7
Removing empty block keyboard_key_pressed::@1
Removing empty block @8
Removing empty block keyboard_get_keycode::@1
Removing empty block @9
Removing empty block keyboard_matrix_read::@1
Removing empty block @10
Removing empty block keyboard_key_pressed::@1
Removing empty block @11
Removing empty block keyboard_get_keycode::@1
Removing empty block @12
Removing empty block @13
Removing empty block @14
Removing empty block main::@20
Removing empty block main::@24
Removing empty block @13
Removing empty block @16
Removing empty block print_str_at::@4
Removing empty block print_str_at::@3
Removing empty block print_str_at::@5
Removing empty block print_str_at::@6
Removing empty block @14
Removing empty block @17
PROCEDURE MODIFY VARIABLE ANALYSIS
Completing Phi functions...
@ -1955,7 +2056,7 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) CHARGEN#0 ← ((byte*)) (word/dword/signed dword) 53248
(byte*) CIA1_PORT_A#0 ← ((byte*)) (word/dword/signed dword) 56320
(byte*) CIA1_PORT_B#0 ← ((byte*)) (word/dword/signed dword) 56321
to:@5
to:@8
mul8u: scope:[mul8u] from plot_chargen::@1
(byte) mul8u::a#5 ← phi( plot_chargen::@1/(byte) mul8u::a#1 )
(byte) mul8u::b#1 ← phi( plot_chargen::@1/(byte) mul8u::b#0 )
@ -2003,7 +2104,7 @@ mul8u::@return: scope:[mul8u] from mul8u::@3
(word) mul8u::return#1 ← (word) mul8u::return#3
return
to:@return
@5: scope:[] from @begin
@8: scope:[] from @begin
(byte) KEY_F7#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) KEY_F1#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4
(byte) KEY_F3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5
@ -2062,7 +2163,7 @@ mul8u::@return: scope:[mul8u] from mul8u::@3
(byte[]) keyboard_char_keycodes#0 ← { (byte) KEY_AT#0, (byte) KEY_A#0, (byte) KEY_B#0, (byte) KEY_C#0, (byte) KEY_D#0, (byte) KEY_E#0, (byte) KEY_F#0, (byte) KEY_G#0, (byte) KEY_H#0, (byte) KEY_I#0, (byte) KEY_J#0, (byte) KEY_K#0, (byte) KEY_L#0, (byte) KEY_M#0, (byte) KEY_N#0, (byte) KEY_O#0, (byte) KEY_P#0, (byte) KEY_Q#0, (byte) KEY_R#0, (byte) KEY_S#0, (byte) KEY_T#0, (byte) KEY_U#0, (byte) KEY_V#0, (byte) KEY_W#0, (byte) KEY_X#0, (byte) KEY_Y#0, (byte) KEY_Z#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP#0, (byte) KEY_ARROW_LEFT#0, (byte) KEY_SPACE#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK#0, (byte) KEY_PLUS#0, (byte) KEY_COMMA#0, (byte) KEY_MINUS#0, (byte) KEY_DOT#0, (byte) KEY_SLASH#0, (byte) KEY_0#0, (byte) KEY_1#0, (byte) KEY_2#0, (byte) KEY_3#0, (byte) KEY_4#0, (byte) KEY_5#0, (byte) KEY_6#0, (byte) KEY_7#0, (byte) KEY_8#0, (byte) KEY_9#0, (byte) KEY_COLON#0, (byte) KEY_SEMICOLON#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 }
(byte[8]) keyboard_matrix_row_bitmask#0 ← { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte[8]) keyboard_matrix_col_bitmask#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
to:@12
to:@15
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
(byte) keyboard_matrix_read::rowid#1 ← phi( keyboard_key_pressed/(byte) keyboard_matrix_read::rowid#0 )
*((byte*) CIA1_PORT_A#0) ← *((byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#1)
@ -2106,11 +2207,11 @@ keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_k
(byte) keyboard_get_keycode::return#1 ← (byte) keyboard_get_keycode::return#3
return
to:@return
@12: scope:[] from @5
@15: scope:[] from @8
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@15
main: scope:[main] from @15
(byte*) SCREEN#1 ← phi( @15/(byte*) SCREEN#8 )
to:@18
main: scope:[main] from @18
(byte*) SCREEN#1 ← phi( @18/(byte*) SCREEN#8 )
(byte*) main::sc#0 ← (byte*) SCREEN#1
to:main::@1
main::@1: scope:[main] from main main::@1
@ -2493,19 +2594,19 @@ plot_chargen::@8: scope:[plot_chargen] from plot_chargen::@7
plot_chargen::@return: scope:[plot_chargen] from plot_chargen::@8
return
to:@return
@15: scope:[] from @12
(byte*) SCREEN#8 ← phi( @12/(byte*) SCREEN#0 )
@18: scope:[] from @15
(byte*) SCREEN#8 ← phi( @15/(byte*) SCREEN#0 )
call main
to:@16
@16: scope:[] from @15
to:@19
@19: scope:[] from @18
to:@end
@end: scope:[] from @16
@end: scope:[] from @19
SYMBOL TABLE SSA
(label) @12
(label) @15
(label) @16
(label) @5
(label) @18
(label) @19
(label) @8
(label) @begin
(label) @end
(byte*) CHARGEN
@ -3033,7 +3134,7 @@ SYMBOL TABLE SSA
(byte*) print_str_at::str#7
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) @16
Culled Empty Block (label) @19
Succesful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not (bool~) mul8u::$3 ← (byte~) mul8u::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from (bool~) mul8u::$2 ← (byte~) mul8u::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not (bool~) main::$17 ← (byte~) main::$15 == (byte/signed byte/word/signed word/dword/signed dword) 0 from (bool~) main::$16 ← (byte~) main::$15 != (byte/signed byte/word/signed word/dword/signed dword) 0
@ -3418,8 +3519,8 @@ Succesful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) mul8u::@3
Culled Empty Block (label) @5
Culled Empty Block (label) @12
Culled Empty Block (label) @8
Culled Empty Block (label) @15
Culled Empty Block (label) main::@28
Culled Empty Block (label) main::@14
Not culling empty block because it shares successor with its predecessor. (label) main::@15
@ -3674,7 +3775,7 @@ Constant inlined main::$7 = (const byte*) SCREEN#0+(byte/signed byte/word/signed
Constant inlined main::pressed#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined plot_chargen::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @15 @end main main::@1 main::@13 main::@25 main::@26 main::@27 main::@2 main::@29 main::@3 main::@30 main::@15 main::@4 main::@31 main::@16 main::@5 main::@32 main::@17 main::@6 main::@33 main::@18 main::@7 main::@34 main::@19 main::@9 main::@10 main::@35 main::@21 main::@36 main::@11 main::@22 main::@12 plot_chargen plot_chargen::@5 plot_chargen::@1 plot_chargen::@9 plot_chargen::@2 plot_chargen::@3 plot_chargen::@6 plot_chargen::@4 plot_chargen::@7 plot_chargen::@8 plot_chargen::@return mul8u mul8u::@1 mul8u::@return mul8u::@2 mul8u::@7 mul8u::@4 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return print_str_at print_str_at::@1 print_str_at::@return print_str_at::@2
Block Sequence Planned @begin @18 @end main main::@1 main::@13 main::@25 main::@26 main::@27 main::@2 main::@29 main::@3 main::@30 main::@15 main::@4 main::@31 main::@16 main::@5 main::@32 main::@17 main::@6 main::@33 main::@18 main::@7 main::@34 main::@19 main::@9 main::@10 main::@35 main::@21 main::@36 main::@11 main::@22 main::@12 plot_chargen plot_chargen::@5 plot_chargen::@1 plot_chargen::@9 plot_chargen::@2 plot_chargen::@3 plot_chargen::@6 plot_chargen::@4 plot_chargen::@7 plot_chargen::@8 plot_chargen::@return mul8u mul8u::@1 mul8u::@return mul8u::@2 mul8u::@7 mul8u::@4 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return print_str_at print_str_at::@1 print_str_at::@return print_str_at::@2
Added new block during phi lifting main::@38(between main::@1 and main::@1)
Added new block during phi lifting main::@39(between main::@29 and main::@2)
Added new block during phi lifting main::@40(between main::@12 and main::@3)
@ -3687,9 +3788,9 @@ Added new block during phi lifting plot_chargen::@10(between plot_chargen and pl
Added new block during phi lifting plot_chargen::@11(between plot_chargen::@7 and plot_chargen::@2)
Added new block during phi lifting plot_chargen::@12(between plot_chargen::@4 and plot_chargen::@3)
Added new block during phi lifting mul8u::@10(between mul8u::@2 and mul8u::@4)
Block Sequence Planned @begin @15 @end main main::@1 main::@13 main::@25 main::@26 main::@27 main::@2 main::@29 main::@3 main::@30 main::@15 main::@4 main::@31 main::@16 main::@5 main::@32 main::@17 main::@6 main::@33 main::@18 main::@7 main::@34 main::@19 main::@9 main::@10 main::@35 main::@21 main::@36 main::@11 main::@22 main::@12 main::@40 main::@45 main::@44 main::@43 main::@42 main::@41 main::@39 main::@38 plot_chargen plot_chargen::@5 plot_chargen::@1 plot_chargen::@9 plot_chargen::@2 plot_chargen::@3 plot_chargen::@6 plot_chargen::@4 plot_chargen::@7 plot_chargen::@8 plot_chargen::@return plot_chargen::@11 plot_chargen::@12 plot_chargen::@10 mul8u mul8u::@1 mul8u::@return mul8u::@2 mul8u::@7 mul8u::@4 mul8u::@10 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return print_str_at print_str_at::@1 print_str_at::@return print_str_at::@2
Block Sequence Planned @begin @18 @end main main::@1 main::@13 main::@25 main::@26 main::@27 main::@2 main::@29 main::@3 main::@30 main::@15 main::@4 main::@31 main::@16 main::@5 main::@32 main::@17 main::@6 main::@33 main::@18 main::@7 main::@34 main::@19 main::@9 main::@10 main::@35 main::@21 main::@36 main::@11 main::@22 main::@12 main::@40 main::@45 main::@44 main::@43 main::@42 main::@41 main::@39 main::@38 plot_chargen plot_chargen::@5 plot_chargen::@1 plot_chargen::@9 plot_chargen::@2 plot_chargen::@3 plot_chargen::@6 plot_chargen::@4 plot_chargen::@7 plot_chargen::@8 plot_chargen::@return plot_chargen::@11 plot_chargen::@12 plot_chargen::@10 mul8u mul8u::@1 mul8u::@return mul8u::@2 mul8u::@7 mul8u::@4 mul8u::@10 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return print_str_at print_str_at::@1 print_str_at::@return print_str_at::@2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @15
Adding NOP phi() at start of @18
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@13
@ -3780,9 +3881,9 @@ Culled Empty Block (label) plot_chargen::@11
Culled Empty Block (label) plot_chargen::@12
Culled Empty Block (label) plot_chargen::@10
Culled Empty Block (label) mul8u::@10
Block Sequence Planned @begin @15 @end main main::@1 main::@13 main::@25 main::@26 main::@27 main::@2 main::@29 main::@3 main::@30 main::@4 main::@31 main::@5 main::@32 main::@6 main::@33 main::@7 main::@34 main::@19 main::@9 main::@10 main::@35 main::@21 main::@36 main::@11 main::@22 main::@12 main::@44 main::@43 main::@42 main::@41 plot_chargen plot_chargen::@5 plot_chargen::@1 plot_chargen::@9 plot_chargen::@2 plot_chargen::@3 plot_chargen::@6 plot_chargen::@4 plot_chargen::@7 plot_chargen::@8 plot_chargen::@return mul8u mul8u::@1 mul8u::@return mul8u::@2 mul8u::@7 mul8u::@4 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return print_str_at print_str_at::@1 print_str_at::@return print_str_at::@2
Block Sequence Planned @begin @18 @end main main::@1 main::@13 main::@25 main::@26 main::@27 main::@2 main::@29 main::@3 main::@30 main::@4 main::@31 main::@5 main::@32 main::@6 main::@33 main::@7 main::@34 main::@19 main::@9 main::@10 main::@35 main::@21 main::@36 main::@11 main::@22 main::@12 main::@44 main::@43 main::@42 main::@41 plot_chargen plot_chargen::@5 plot_chargen::@1 plot_chargen::@9 plot_chargen::@2 plot_chargen::@3 plot_chargen::@6 plot_chargen::@4 plot_chargen::@7 plot_chargen::@8 plot_chargen::@return mul8u mul8u::@1 mul8u::@return mul8u::@2 mul8u::@7 mul8u::@4 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return print_str_at print_str_at::@1 print_str_at::@return print_str_at::@2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @15
Adding NOP phi() at start of @18
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@13
@ -3815,14 +3916,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@15
@15: scope:[] from @begin
to:@18
@18: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @15
@end: scope:[] from @18
[3] phi() [ ] ( )
main: scope:[main] from @15
main: scope:[main] from @18
[4] phi() [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main main::@1
@ -4082,67 +4183,67 @@ print_str_at::@2: scope:[print_str_at] from print_str_at::@1
DOMINATORS
@begin dominated by @begin
@15 dominated by @begin @15
@end dominated by @end @begin @15
main dominated by main @begin @15
main::@1 dominated by main main::@1 @begin @15
main::@13 dominated by main main::@1 @begin @15 main::@13
main::@25 dominated by main main::@1 @begin main::@25 @15 main::@13
main::@26 dominated by main main::@1 @begin main::@26 main::@25 @15 main::@13
main::@27 dominated by main main::@1 @begin main::@27 main::@26 main::@25 @15 main::@13
main::@2 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 @15 main::@13
main::@29 dominated by main main::@1 main::@2 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@3 dominated by main main::@1 main::@2 main::@3 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@30 dominated by main main::@1 main::@2 main::@3 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@4 dominated by main main::@1 main::@2 main::@3 main::@4 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@31 dominated by main main::@1 main::@2 main::@3 main::@4 main::@31 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@5 dominated by main main::@1 main::@2 main::@5 main::@3 main::@4 main::@31 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@32 dominated by main main::@1 main::@2 main::@5 main::@3 main::@4 main::@31 main::@30 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@6 dominated by main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@33 dominated by main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@7 dominated by main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@34 dominated by main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@19 dominated by main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 @15 main::@19 main::@13
main::@9 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@10 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 main::@10 @15 main::@13
main::@35 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@27 main::@29 main::@26 main::@25 main::@10 @15 main::@13
main::@21 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@21 main::@27 main::@29 main::@26 main::@25 main::@10 @15 main::@13
main::@36 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@36 main::@21 main::@27 main::@29 main::@26 main::@25 main::@10 @15 main::@13
main::@11 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@27 main::@29 main::@26 main::@25 main::@11 main::@10 @15 main::@13
main::@22 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@22 main::@27 main::@29 main::@26 main::@25 main::@11 main::@10 @15 main::@13
main::@12 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@27 main::@29 main::@26 main::@25 main::@11 main::@10 @15 main::@13 main::@12
main::@44 dominated by main::@44 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@43 dominated by main::@43 main main::@1 main::@2 main::@5 main::@3 main::@4 main::@31 main::@30 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@42 dominated by main::@42 main main::@1 main::@2 main::@3 main::@4 main::@31 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13
main::@41 dominated by main::@41 main main::@1 main::@2 main::@3 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13
plot_chargen dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 @15 main::@13 plot_chargen
plot_chargen::@5 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 @15 plot_chargen::@5 main::@13 plot_chargen
plot_chargen::@1 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 @15 main::@13 plot_chargen plot_chargen::@1
plot_chargen::@9 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @15 main::@13 plot_chargen plot_chargen::@1
plot_chargen::@2 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @15 main::@13 plot_chargen plot_chargen::@2 plot_chargen::@1
plot_chargen::@3 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @15 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@6 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @15 plot_chargen::@6 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@4 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @15 plot_chargen::@4 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@7 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @15 plot_chargen::@7 plot_chargen::@4 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@8 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 plot_chargen::@8 @15 plot_chargen::@7 plot_chargen::@4 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@return dominated by main main::@1 main::@2 plot_chargen::@return @begin main::@27 main::@26 main::@25 plot_chargen::@9 plot_chargen::@8 @15 plot_chargen::@7 plot_chargen::@4 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
mul8u dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @15 main::@13 plot_chargen plot_chargen::@1
mul8u::@1 dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @15 main::@13 plot_chargen plot_chargen::@1 mul8u::@1
mul8u::@return dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @15 main::@13 mul8u::@return plot_chargen plot_chargen::@1 mul8u::@1
mul8u::@2 dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @15 main::@13 plot_chargen plot_chargen::@1 mul8u::@2 mul8u::@1
mul8u::@7 dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @15 main::@13 mul8u::@7 plot_chargen plot_chargen::@1 mul8u::@2 mul8u::@1
mul8u::@4 dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @15 main::@13 plot_chargen plot_chargen::@1 mul8u::@2 mul8u::@1 mul8u::@4
keyboard_key_pressed dominated by main main::@1 main::@2 main::@3 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13 keyboard_key_pressed
keyboard_key_pressed::@2 dominated by main main::@1 main::@2 keyboard_key_pressed::@2 main::@3 @begin main::@27 main::@29 main::@26 main::@25 @15 main::@13 keyboard_key_pressed
keyboard_key_pressed::@return dominated by main main::@1 main::@2 keyboard_key_pressed::@2 main::@3 @begin main::@27 main::@29 main::@26 main::@25 keyboard_key_pressed::@return @15 main::@13 keyboard_key_pressed
keyboard_matrix_read dominated by main main::@1 main::@2 main::@3 @begin keyboard_matrix_read main::@27 main::@29 main::@26 main::@25 @15 main::@13 keyboard_key_pressed
keyboard_matrix_read::@return dominated by main main::@1 main::@2 main::@3 @begin keyboard_matrix_read main::@27 main::@29 main::@26 main::@25 @15 main::@13 keyboard_matrix_read::@return keyboard_key_pressed
keyboard_get_keycode dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 keyboard_get_keycode main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 main::@10 @15 main::@13
keyboard_get_keycode::@return dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 keyboard_get_keycode main::@31 main::@30 main::@33 @begin main::@32 main::@34 keyboard_get_keycode::@return main::@27 main::@29 main::@26 main::@25 main::@10 @15 main::@13
print_str_at dominated by main main::@1 @begin print_str_at @15 main::@13
print_str_at::@1 dominated by main main::@1 @begin print_str_at @15 print_str_at::@1 main::@13
print_str_at::@return dominated by main main::@1 @begin print_str_at @15 print_str_at::@1 main::@13 print_str_at::@return
print_str_at::@2 dominated by main main::@1 @begin print_str_at @15 print_str_at::@1 print_str_at::@2 main::@13
@18 dominated by @begin @18
@end dominated by @end @begin @18
main dominated by main @begin @18
main::@1 dominated by main main::@1 @begin @18
main::@13 dominated by main main::@1 @begin @18 main::@13
main::@25 dominated by main main::@1 @begin main::@25 @18 main::@13
main::@26 dominated by main main::@1 @begin main::@26 main::@25 @18 main::@13
main::@27 dominated by main main::@1 @begin main::@27 main::@26 main::@25 @18 main::@13
main::@2 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 @18 main::@13
main::@29 dominated by main main::@1 main::@2 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@3 dominated by main main::@1 main::@2 main::@3 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@30 dominated by main main::@1 main::@2 main::@3 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@4 dominated by main main::@1 main::@2 main::@3 main::@4 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@31 dominated by main main::@1 main::@2 main::@3 main::@4 main::@31 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@5 dominated by main main::@1 main::@2 main::@5 main::@3 main::@4 main::@31 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@32 dominated by main main::@1 main::@2 main::@5 main::@3 main::@4 main::@31 main::@30 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@6 dominated by main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@33 dominated by main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@7 dominated by main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@34 dominated by main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@19 dominated by main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 @18 main::@19 main::@13
main::@9 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@10 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 main::@10 @18 main::@13
main::@35 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@27 main::@29 main::@26 main::@25 main::@10 @18 main::@13
main::@21 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@21 main::@27 main::@29 main::@26 main::@25 main::@10 @18 main::@13
main::@36 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@36 main::@21 main::@27 main::@29 main::@26 main::@25 main::@10 @18 main::@13
main::@11 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@27 main::@29 main::@26 main::@25 main::@11 main::@10 @18 main::@13
main::@22 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@22 main::@27 main::@29 main::@26 main::@25 main::@11 main::@10 @18 main::@13
main::@12 dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@35 main::@34 main::@27 main::@29 main::@26 main::@25 main::@11 main::@10 @18 main::@13 main::@12
main::@44 dominated by main::@44 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 main::@31 main::@30 main::@33 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@43 dominated by main::@43 main main::@1 main::@2 main::@5 main::@3 main::@4 main::@31 main::@30 @begin main::@32 main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@42 dominated by main::@42 main main::@1 main::@2 main::@3 main::@4 main::@31 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13
main::@41 dominated by main::@41 main main::@1 main::@2 main::@3 main::@30 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13
plot_chargen dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 @18 main::@13 plot_chargen
plot_chargen::@5 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@5 @18 main::@13 plot_chargen
plot_chargen::@1 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 @18 main::@13 plot_chargen plot_chargen::@1
plot_chargen::@9 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @18 main::@13 plot_chargen plot_chargen::@1
plot_chargen::@2 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @18 main::@13 plot_chargen plot_chargen::@2 plot_chargen::@1
plot_chargen::@3 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @18 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@6 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 plot_chargen::@6 @18 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@4 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 @18 plot_chargen::@4 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@7 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 plot_chargen::@7 @18 plot_chargen::@4 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@8 dominated by main main::@1 main::@2 @begin main::@27 main::@26 main::@25 plot_chargen::@9 plot_chargen::@8 plot_chargen::@7 @18 plot_chargen::@4 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
plot_chargen::@return dominated by main main::@1 main::@2 plot_chargen::@return @begin main::@27 main::@26 main::@25 plot_chargen::@9 plot_chargen::@8 plot_chargen::@7 @18 plot_chargen::@4 main::@13 plot_chargen plot_chargen::@3 plot_chargen::@2 plot_chargen::@1
mul8u dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @18 main::@13 plot_chargen plot_chargen::@1
mul8u::@1 dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @18 main::@13 plot_chargen plot_chargen::@1 mul8u::@1
mul8u::@return dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @18 main::@13 mul8u::@return plot_chargen plot_chargen::@1 mul8u::@1
mul8u::@2 dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @18 main::@13 plot_chargen plot_chargen::@1 mul8u::@2 mul8u::@1
mul8u::@7 dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @18 main::@13 mul8u::@7 plot_chargen plot_chargen::@1 mul8u::@2 mul8u::@1
mul8u::@4 dominated by main main::@1 main::@2 @begin mul8u main::@27 main::@26 main::@25 @18 main::@13 plot_chargen plot_chargen::@1 mul8u::@2 mul8u::@1 mul8u::@4
keyboard_key_pressed dominated by main main::@1 main::@2 main::@3 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13 keyboard_key_pressed
keyboard_key_pressed::@2 dominated by main main::@1 main::@2 keyboard_key_pressed::@2 main::@3 @begin main::@27 main::@29 main::@26 main::@25 @18 main::@13 keyboard_key_pressed
keyboard_key_pressed::@return dominated by main main::@1 main::@2 keyboard_key_pressed::@2 main::@3 @begin main::@27 main::@29 main::@26 main::@25 keyboard_key_pressed::@return @18 main::@13 keyboard_key_pressed
keyboard_matrix_read dominated by main main::@1 main::@2 main::@3 @begin keyboard_matrix_read main::@27 main::@29 main::@26 main::@25 @18 main::@13 keyboard_key_pressed
keyboard_matrix_read::@return dominated by main main::@1 main::@2 main::@3 @begin keyboard_matrix_read main::@27 main::@29 main::@26 main::@25 @18 main::@13 keyboard_matrix_read::@return keyboard_key_pressed
keyboard_get_keycode dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 keyboard_get_keycode main::@31 main::@30 main::@33 @begin main::@32 main::@34 main::@27 main::@29 main::@26 main::@25 main::@10 @18 main::@13
keyboard_get_keycode::@return dominated by main::@9 main::@7 main main::@1 main::@2 main::@5 main::@6 main::@3 main::@4 keyboard_get_keycode main::@31 main::@30 main::@33 @begin main::@32 main::@34 keyboard_get_keycode::@return main::@27 main::@29 main::@26 main::@25 main::@10 @18 main::@13
print_str_at dominated by main main::@1 @begin print_str_at @18 main::@13
print_str_at::@1 dominated by main main::@1 @begin print_str_at print_str_at::@1 @18 main::@13
print_str_at::@return dominated by main main::@1 @begin print_str_at print_str_at::@1 @18 main::@13 print_str_at::@return
print_str_at::@2 dominated by main main::@1 @begin print_str_at print_str_at::@1 @18 print_str_at::@2 main::@13
NATURAL LOOPS
Found back edge: Loop head: main::@1 tails: main::@1 blocks: null
@ -4600,17 +4701,17 @@ INITIAL ASM
.label SCREEN = $400
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @15 [phi:@begin->@15]
b15_from_bbegin:
jmp b15
//SEG4 @15
b15:
//SEG3 [1] phi from @begin to @18 [phi:@begin->@18]
b18_from_bbegin:
jmp b18
//SEG4 @18
b18:
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @15 to main [phi:@15->main]
main_from_b15:
//SEG6 [4] phi from @18 to main [phi:@18->main]
main_from_b18:
jsr main
//SEG7 [3] phi from @15 to @end [phi:@15->@end]
bend_from_b15:
//SEG7 [3] phi from @18 to @end [phi:@18->@end]
bend_from_b18:
jmp bend
//SEG8 @end
bend:
@ -5727,17 +5828,17 @@ ASSEMBLER BEFORE OPTIMIZATION
.label SCREEN = $400
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @15 [phi:@begin->@15]
b15_from_bbegin:
jmp b15
//SEG4 @15
b15:
//SEG3 [1] phi from @begin to @18 [phi:@begin->@18]
b18_from_bbegin:
jmp b18
//SEG4 @18
b18:
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @15 to main [phi:@15->main]
main_from_b15:
//SEG6 [4] phi from @18 to main [phi:@18->main]
main_from_b18:
jsr main
//SEG7 [3] phi from @15 to @end [phi:@15->@end]
bend_from_b15:
//SEG7 [3] phi from @18 to @end [phi:@18->@end]
bend_from_b18:
jmp bend
//SEG8 @end
bend:
@ -6502,7 +6603,7 @@ print_str_at: {
keyboard_char_keycodes: .byte KEY_AT, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, $3f, KEY_POUND, $3f, KEY_ARROW_UP, KEY_ARROW_LEFT, KEY_SPACE, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, KEY_ASTERISK, KEY_PLUS, KEY_COMMA, KEY_MINUS, KEY_DOT, KEY_SLASH, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON, $3f, KEY_EQUALS, $3f, $3f
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b15
Removing instruction jmp b18
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b13
@ -6572,9 +6673,9 @@ Replacing label b2_from_b7 with b2
Replacing label b4_from_b2 with b4
Replacing label b1_from_b2 with b1
Removing instruction bbegin:
Removing instruction b15_from_bbegin:
Removing instruction main_from_b15:
Removing instruction bend_from_b15:
Removing instruction b18_from_bbegin:
Removing instruction main_from_b18:
Removing instruction bend_from_b18:
Removing instruction b1_from_b1:
Removing instruction b13_from_b1:
Removing instruction print_str_at_from_b13:
@ -6613,7 +6714,7 @@ Removing instruction b4_from_b7:
Removing instruction b1_from_print_str_at:
Removing instruction b1_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b15:
Removing instruction b18:
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b13:
@ -6688,7 +6789,7 @@ Removing unreachable instruction jmp b4
Succesful ASM optimization Pass5UnreachableCodeElimination
FINAL SYMBOL TABLE
(label) @15
(label) @18
(label) @begin
(label) @end
(byte*) CHARGEN
@ -7106,12 +7207,12 @@ Score: 628899
.const KEY_Q = $3e
.label SCREEN = $400
//SEG2 @begin
//SEG3 [1] phi from @begin to @15 [phi:@begin->@15]
//SEG4 @15
//SEG3 [1] phi from @begin to @18 [phi:@begin->@18]
//SEG4 @18
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @15 to main [phi:@15->main]
//SEG6 [4] phi from @18 to main [phi:@18->main]
jsr main
//SEG7 [3] phi from @15 to @end [phi:@15->@end]
//SEG7 [3] phi from @18 to @end [phi:@18->@end]
//SEG8 @end
//SEG9 main
main: {

View File

@ -1,4 +1,4 @@
(label) @15
(label) @18
(label) @begin
(label) @end
(byte*) CHARGEN

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@10
@10: scope:[] from @begin
to:@13
@13: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @10
@end: scope:[] from @13
[3] phi() [ ] ( )
main: scope:[main] from @10
main: scope:[main] from @13
[4] *((const byte*) BORDERCOL#0) ← (const byte) GREEN#0 [ ] ( main:2 [ ] )
to:main::@2
main::@2: scope:[main] from main main::@2

View File

@ -381,6 +381,24 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Adding pre/post-modifier (byte) keyboard_events_size ← ++ (byte) keyboard_events_size
Adding pre/post-modifier (byte) keyboard_events_size ← ++ (byte) keyboard_events_size
Adding pre/post-modifier (byte) keyboard_event_scan::keycode ← ++ (byte) keyboard_event_scan::keycode
@ -392,6 +410,9 @@ SYMBOLS
(byte~) $0
(label) @1
(label) @10
(label) @11
(label) @12
(label) @13
(label) @2
(label) @3
(label) @4
@ -699,6 +720,34 @@ SYMBOLS
(label) pressed::@8
(label) pressed::@9
(label) pressed::@return
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -804,6 +853,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte) KEY_DEL ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) KEY_RETURN ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) KEY_CRSR_RIGHT ← (byte/signed byte/word/signed word/dword/signed dword) 2
@ -871,7 +965,7 @@ INITIAL CONTROL FLOW GRAPH
(byte[]) keyboard_char_keycodes ← { (byte) KEY_AT, (byte) KEY_A, (byte) KEY_B, (byte) KEY_C, (byte) KEY_D, (byte) KEY_E, (byte) KEY_F, (byte) KEY_G, (byte) KEY_H, (byte) KEY_I, (byte) KEY_J, (byte) KEY_K, (byte) KEY_L, (byte) KEY_M, (byte) KEY_N, (byte) KEY_O, (byte) KEY_P, (byte) KEY_Q, (byte) KEY_R, (byte) KEY_S, (byte) KEY_T, (byte) KEY_U, (byte) KEY_V, (byte) KEY_W, (byte) KEY_X, (byte) KEY_Y, (byte) KEY_Z, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP, (byte) KEY_ARROW_LEFT, (byte) KEY_SPACE, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK, (byte) KEY_PLUS, (byte) KEY_COMMA, (byte) KEY_MINUS, (byte) KEY_DOT, (byte) KEY_SLASH, (byte) KEY_0, (byte) KEY_1, (byte) KEY_2, (byte) KEY_3, (byte) KEY_4, (byte) KEY_5, (byte) KEY_6, (byte) KEY_7, (byte) KEY_8, (byte) KEY_9, (byte) KEY_COLON, (byte) KEY_SEMICOLON, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 }
(byte[8]) keyboard_matrix_row_bitmask ← { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte[8]) keyboard_matrix_col_bitmask ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
to:@1
to:@4
keyboard_init: scope:[keyboard_init] from
*((byte*) CIA1_PORT_A_DDR) ← (byte/word/signed word/dword/signed dword) 255
*((byte*) CIA1_PORT_B_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -879,8 +973,8 @@ keyboard_init: scope:[keyboard_init] from
keyboard_init::@return: scope:[keyboard_init] from keyboard_init
return
to:@return
@1: scope:[] from @begin
to:@2
@4: scope:[] from @3
to:@5
keyboard_matrix_read: scope:[keyboard_matrix_read] from
*((byte*) CIA1_PORT_A) ← *((byte[8]) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid)
(byte~) keyboard_matrix_read::$0 ← ~ *((byte*) CIA1_PORT_B)
@ -893,8 +987,8 @@ keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matri
to:@return
keyboard_matrix_read::@1: scope:[keyboard_matrix_read] from
to:keyboard_matrix_read::@return
@2: scope:[] from @1
to:@3
@5: scope:[] from @4
to:@6
keyboard_key_pressed: scope:[keyboard_key_pressed] from
(byte~) keyboard_key_pressed::$0 ← (byte) keyboard_key_pressed::key & (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) keyboard_key_pressed::colidx ← (byte~) keyboard_key_pressed::$0
@ -910,8 +1004,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
to:@return
keyboard_key_pressed::@1: scope:[keyboard_key_pressed] from
to:keyboard_key_pressed::@return
@3: scope:[] from @2
to:@4
@6: scope:[] from @5
to:@7
keyboard_get_keycode: scope:[keyboard_get_keycode] from
(byte) keyboard_get_keycode::return ← *((byte[]) keyboard_char_keycodes + (byte) keyboard_get_keycode::ch)
to:keyboard_get_keycode::@return
@ -921,7 +1015,7 @@ keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_k
to:@return
keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from
to:keyboard_get_keycode::@return
@4: scope:[] from @3
@7: scope:[] from @6
(byte[8]) keyboard_events ← { fill( 8, 0) }
(byte) keyboard_events_size ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) keyboard_modifiers ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -932,7 +1026,7 @@ keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from
(byte~) $0 ← (byte) KEY_MODIFIER_LSHIFT | (byte) KEY_MODIFIER_RSHIFT
(byte) KEY_MODIFIER_SHIFT ← (byte~) $0
(byte[8]) keyboard_scan_values ← { fill( 8, 0) }
to:@5
to:@8
keyboard_event_scan: scope:[keyboard_event_scan] from
(byte) keyboard_event_scan::keycode ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) keyboard_event_scan::row ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1045,8 +1139,8 @@ keyboard_event_scan::@24: scope:[keyboard_event_scan] from keyboard_event_scan:
keyboard_event_scan::@return: scope:[keyboard_event_scan] from keyboard_event_scan::@12
return
to:@return
@5: scope:[] from @4
to:@6
@8: scope:[] from @7
to:@9
keyboard_event_pressed: scope:[keyboard_event_pressed] from
(byte~) keyboard_event_pressed::$0 ← (byte) keyboard_event_pressed::keycode >> (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) keyboard_event_pressed::row_bits ← *((byte[8]) keyboard_scan_values + (byte~) keyboard_event_pressed::$0)
@ -1060,8 +1154,8 @@ keyboard_event_pressed::@return: scope:[keyboard_event_pressed] from keyboard_e
to:@return
keyboard_event_pressed::@1: scope:[keyboard_event_pressed] from
to:keyboard_event_pressed::@return
@6: scope:[] from @5
to:@7
@9: scope:[] from @8
to:@10
keyboard_event_get: scope:[keyboard_event_get] from
(bool~) keyboard_event_get::$0 ← (byte) keyboard_events_size == (byte/signed byte/word/signed word/dword/signed dword) 0
if((bool~) keyboard_event_get::$0) goto keyboard_event_get::@1
@ -1085,8 +1179,8 @@ keyboard_event_get::@5: scope:[keyboard_event_get] from
to:keyboard_event_get::@1
keyboard_event_get::@6: scope:[keyboard_event_get] from
to:keyboard_event_get::@2
@7: scope:[] from @6
to:@8
@10: scope:[] from @9
to:@11
main: scope:[main] from
*((byte*) BORDERCOL) ← (byte) GREEN
to:main::@1
@ -1107,9 +1201,9 @@ main::@6: scope:[main] from
main::@return: scope:[main] from main::@3
return
to:@return
@8: scope:[] from @7
@11: scope:[] from @10
(byte*) SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@9
to:@12
menu: scope:[menu] from
to:menu::@1
menu::@1: scope:[menu] from menu menu::@6
@ -1164,8 +1258,8 @@ menu::@14: scope:[menu] from
to:menu::@6
menu::@15: scope:[menu] from
to:menu::@3
@9: scope:[] from @8
to:@10
@12: scope:[] from @11
to:@13
pressed: scope:[pressed] from
*((byte*) BGCOL) ← ++ *((byte*) BGCOL)
to:pressed::@1
@ -1195,11 +1289,15 @@ pressed::@8: scope:[pressed] from
to:pressed::@4
pressed::@9: scope:[pressed] from
to:pressed::@3
@10: scope:[] from @9
@13: scope:[] from @12
call main
to:@end
@end: scope:[] from @10
@end: scope:[] from @13
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Removing unused procedure keyboard_init
Removing unused procedure keyboard_get_keycode
Removing unused procedure keyboard_event_scan
@ -1338,14 +1436,16 @@ Eliminating unused variable (byte~) $0 and assignment [75] (byte~) $0 ← (byte)
Eliminating unused variable (byte) KEY_MODIFIER_LSHIFT and assignment [27] (byte) KEY_MODIFIER_LSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 1
Eliminating unused variable (byte) KEY_MODIFIER_RSHIFT and assignment [28] (byte) KEY_MODIFIER_RSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 2
Removing empty block @1
Removing empty block keyboard_matrix_read::@1
Removing empty block @2
Removing empty block keyboard_key_pressed::@1
Removing empty block @3
Removing empty block @4
Removing empty block keyboard_matrix_read::@1
Removing empty block @5
Removing empty block keyboard_key_pressed::@1
Removing empty block @6
Removing empty block @7
Removing empty block @8
Removing empty block @9
Removing empty block @10
Removing empty block main::@4
Removing empty block main::@3
Removing empty block main::@5
@ -1357,7 +1457,7 @@ Removing empty block menu::@10
Removing empty block menu::@12
Removing empty block menu::@14
Removing empty block menu::@15
Removing empty block @9
Removing empty block @12
Removing empty block pressed::@5
Removing empty block pressed::@3
Removing empty block pressed::@6
@ -1388,13 +1488,15 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) CIA1_PORT_B#0 ← ((byte*)) (word/dword/signed dword) 56321
(byte) RED#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2
(byte) GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5
to:@3
@3: scope:[] from @begin
(byte) KEY_E#0 ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) KEY_C#0 ← (byte/signed byte/word/signed word/dword/signed dword) 20
(byte) KEY_I#0 ← (byte/signed byte/word/signed word/dword/signed dword) 33
(byte) KEY_SPACE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 60
(byte[8]) keyboard_matrix_row_bitmask#0 ← { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte[8]) keyboard_matrix_col_bitmask#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
to:@8
to:@11
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
(byte) keyboard_matrix_read::rowid#1 ← phi( keyboard_key_pressed/(byte) keyboard_matrix_read::rowid#0 )
*((byte*) CIA1_PORT_A#0) ← *((byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#1)
@ -1429,8 +1531,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
(byte) keyboard_key_pressed::return#1 ← (byte) keyboard_key_pressed::return#6
return
to:@return
main: scope:[main] from @10
(byte*) SCREEN#12 ← phi( @10/(byte*) SCREEN#14 )
main: scope:[main] from @13
(byte*) SCREEN#12 ← phi( @13/(byte*) SCREEN#14 )
*((byte*) BORDERCOL#0) ← (byte) GREEN#0
to:main::@1
main::@1: scope:[main] from main main::@7
@ -1447,9 +1549,9 @@ main::@7: scope:[main] from main::@2
main::@return: scope:[main] from main::@1
return
to:@return
@8: scope:[] from @begin
@11: scope:[] from @3
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@10
to:@13
menu: scope:[menu] from main::@2
(byte*) SCREEN#9 ← phi( main::@2/(byte*) SCREEN#10 )
to:menu::@1
@ -1542,18 +1644,19 @@ pressed::@4: scope:[pressed] from pressed::@10
pressed::@return: scope:[pressed] from pressed::@1 pressed::@10
return
to:@return
@10: scope:[] from @8
(byte*) SCREEN#14 ← phi( @8/(byte*) SCREEN#0 )
@13: scope:[] from @11
(byte*) SCREEN#14 ← phi( @11/(byte*) SCREEN#0 )
call main
to:@11
@11: scope:[] from @10
to:@14
@14: scope:[] from @13
to:@end
@end: scope:[] from @11
@end: scope:[] from @14
SYMBOL TABLE SSA
(label) @10
(label) @11
(label) @8
(label) @13
(label) @14
(label) @3
(label) @begin
(label) @end
(byte*) BGCOL
@ -1681,7 +1784,7 @@ SYMBOL TABLE SSA
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) menu::@18
Culled Empty Block (label) pressed::@4
Culled Empty Block (label) @11
Culled Empty Block (label) @14
Succesful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not (bool~) menu::$2 ← (byte~) menu::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 from (bool~) menu::$1 ← (byte~) menu::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not (bool~) menu::$6 ← (byte~) menu::$4 == (byte/signed byte/word/signed word/dword/signed dword) 0 from (bool~) menu::$5 ← (byte~) menu::$4 != (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1778,9 +1881,10 @@ if() condition always true - replacing block destination if(true) goto pressed::
Succesful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) @3
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@7
Culled Empty Block (label) @8
Culled Empty Block (label) @11
Culled Empty Block (label) menu::@1
Culled Empty Block (label) pressed::@1
Succesful SSA optimization Pass2CullEmptyBlocks
@ -1816,10 +1920,10 @@ Constant inlined keyboard_key_pressed::key#1 = (const byte) KEY_I#0
Constant inlined keyboard_key_pressed::key#2 = (const byte) KEY_E#0
Constant inlined keyboard_key_pressed::key#3 = (const byte) KEY_SPACE#0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @10 @end main main::@2 menu menu::@2 menu::@16 menu::@9 menu::@return menu::@4 menu::@17 menu::@11 menu::@5 menu::@19 menu::@13 menu::@6 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return pressed pressed::@2 pressed::@10 pressed::@return
Block Sequence Planned @begin @10 @end main main::@2 menu menu::@2 menu::@16 menu::@9 menu::@return menu::@4 menu::@17 menu::@11 menu::@5 menu::@19 menu::@13 menu::@6 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return pressed pressed::@2 pressed::@10 pressed::@return
Block Sequence Planned @begin @13 @end main main::@2 menu menu::@2 menu::@16 menu::@9 menu::@return menu::@4 menu::@17 menu::@11 menu::@5 menu::@19 menu::@13 menu::@6 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return pressed pressed::@2 pressed::@10 pressed::@return
Block Sequence Planned @begin @13 @end main main::@2 menu menu::@2 menu::@16 menu::@9 menu::@return menu::@4 menu::@17 menu::@11 menu::@5 menu::@19 menu::@13 menu::@6 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return pressed pressed::@2 pressed::@10 pressed::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @10
Adding NOP phi() at start of @13
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of menu
@ -1844,9 +1948,9 @@ Propagating live ranges...
Propagating live ranges...
Created 1 initial phi equivalence classes
Coalesced down to 1 phi equivalence classes
Block Sequence Planned @begin @10 @end main main::@2 menu menu::@2 menu::@16 menu::@9 menu::@return menu::@4 menu::@17 menu::@11 menu::@5 menu::@19 menu::@13 menu::@6 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return pressed pressed::@2 pressed::@10 pressed::@return
Block Sequence Planned @begin @13 @end main main::@2 menu menu::@2 menu::@16 menu::@9 menu::@return menu::@4 menu::@17 menu::@11 menu::@5 menu::@19 menu::@13 menu::@6 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return pressed pressed::@2 pressed::@10 pressed::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @10
Adding NOP phi() at start of @13
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of menu
@ -1866,14 +1970,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@10
@10: scope:[] from @begin
to:@13
@13: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @10
@end: scope:[] from @13
[3] phi() [ ] ( )
main: scope:[main] from @10
main: scope:[main] from @13
[4] *((const byte*) BORDERCOL#0) ← (const byte) GREEN#0 [ ] ( main:2 [ ] )
to:main::@2
main::@2: scope:[main] from main main::@2
@ -1968,31 +2072,31 @@ pressed::@return: scope:[pressed] from pressed::@10
DOMINATORS
@begin dominated by @begin
@10 dominated by @10 @begin
@end dominated by @end @10 @begin
main dominated by main @10 @begin
main::@2 dominated by main main::@2 @10 @begin
menu dominated by main main::@2 @10 @begin menu
menu::@2 dominated by main main::@2 @10 @begin menu::@2 menu
menu::@16 dominated by main main::@2 @10 @begin menu::@2 menu menu::@16
menu::@9 dominated by main main::@2 @10 @begin menu::@2 menu menu::@9 menu::@16
menu::@return dominated by main main::@2 @10 @begin menu::@return menu::@2 menu menu::@16
menu::@4 dominated by main main::@2 @10 @begin menu::@4 menu::@2 menu menu::@16
menu::@17 dominated by main main::@2 @10 @begin menu::@4 menu::@2 menu menu::@17 menu::@16
menu::@11 dominated by main main::@2 @10 @begin menu::@4 menu::@2 menu menu::@11 menu::@17 menu::@16
menu::@5 dominated by main main::@2 @10 menu::@5 @begin menu::@4 menu::@2 menu menu::@17 menu::@16
menu::@19 dominated by main main::@2 @10 menu::@5 @begin menu::@4 menu::@2 menu menu::@19 menu::@17 menu::@16
menu::@13 dominated by main main::@2 @10 menu::@5 @begin menu::@4 menu::@2 menu menu::@19 menu::@13 menu::@17 menu::@16
menu::@6 dominated by main main::@2 @10 menu::@5 @begin menu::@6 menu::@4 menu::@2 menu menu::@19 menu::@17 menu::@16
keyboard_key_pressed dominated by main main::@2 @10 @begin menu::@2 menu keyboard_key_pressed
keyboard_key_pressed::@2 dominated by main main::@2 keyboard_key_pressed::@2 @10 @begin menu::@2 menu keyboard_key_pressed
keyboard_key_pressed::@return dominated by main keyboard_key_pressed::@return main::@2 keyboard_key_pressed::@2 @10 @begin menu::@2 menu keyboard_key_pressed
keyboard_matrix_read dominated by keyboard_matrix_read main main::@2 @10 @begin menu::@2 menu keyboard_key_pressed
keyboard_matrix_read::@return dominated by keyboard_matrix_read main main::@2 @10 @begin menu::@2 menu keyboard_matrix_read::@return keyboard_key_pressed
pressed dominated by main main::@2 @10 @begin pressed menu::@2 menu menu::@9 menu::@16
pressed::@2 dominated by main pressed::@2 main::@2 @10 @begin pressed menu::@2 menu menu::@9 menu::@16
pressed::@10 dominated by pressed::@10 main pressed::@2 main::@2 @10 @begin pressed menu::@2 menu menu::@9 menu::@16
pressed::@return dominated by pressed::@10 main pressed::@2 main::@2 @10 @begin pressed menu::@2 menu menu::@9 pressed::@return menu::@16
@13 dominated by @13 @begin
@end dominated by @end @13 @begin
main dominated by main @13 @begin
main::@2 dominated by main main::@2 @13 @begin
menu dominated by main main::@2 @13 @begin menu
menu::@2 dominated by main main::@2 @13 @begin menu::@2 menu
menu::@16 dominated by main main::@2 @13 @begin menu::@2 menu menu::@16
menu::@9 dominated by main main::@2 @13 @begin menu::@2 menu menu::@9 menu::@16
menu::@return dominated by main main::@2 @13 @begin menu::@return menu::@2 menu menu::@16
menu::@4 dominated by main main::@2 @13 @begin menu::@4 menu::@2 menu menu::@16
menu::@17 dominated by main main::@2 @13 @begin menu::@4 menu::@2 menu menu::@17 menu::@16
menu::@11 dominated by main main::@2 @13 @begin menu::@4 menu::@2 menu menu::@11 menu::@17 menu::@16
menu::@5 dominated by main main::@2 @13 menu::@5 @begin menu::@4 menu::@2 menu menu::@17 menu::@16
menu::@19 dominated by main main::@2 @13 menu::@5 @begin menu::@4 menu::@2 menu menu::@19 menu::@17 menu::@16
menu::@13 dominated by main main::@2 @13 menu::@5 @begin menu::@4 menu::@2 menu menu::@19 menu::@13 menu::@17 menu::@16
menu::@6 dominated by main main::@2 @13 menu::@5 @begin menu::@6 menu::@4 menu::@2 menu menu::@19 menu::@17 menu::@16
keyboard_key_pressed dominated by main main::@2 @13 @begin menu::@2 menu keyboard_key_pressed
keyboard_key_pressed::@2 dominated by main main::@2 keyboard_key_pressed::@2 @13 @begin menu::@2 menu keyboard_key_pressed
keyboard_key_pressed::@return dominated by main keyboard_key_pressed::@return main::@2 keyboard_key_pressed::@2 @13 @begin menu::@2 menu keyboard_key_pressed
keyboard_matrix_read dominated by keyboard_matrix_read main main::@2 @13 @begin menu::@2 menu keyboard_key_pressed
keyboard_matrix_read::@return dominated by keyboard_matrix_read main main::@2 @13 @begin menu::@2 menu keyboard_matrix_read::@return keyboard_key_pressed
pressed dominated by main main::@2 @13 @begin pressed menu::@2 menu menu::@9 menu::@16
pressed::@2 dominated by main pressed::@2 main::@2 @13 @begin pressed menu::@2 menu menu::@9 menu::@16
pressed::@10 dominated by pressed::@10 main pressed::@2 main::@2 @13 @begin pressed menu::@2 menu menu::@9 menu::@16
pressed::@return dominated by pressed::@10 main pressed::@2 main::@2 @13 @begin pressed menu::@2 menu menu::@9 pressed::@return menu::@16
NATURAL LOOPS
Found back edge: Loop head: main::@2 tails: main::@2 blocks: null
@ -2134,15 +2238,15 @@ INITIAL ASM
.label SCREEN = $400
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @10 [phi:@begin->@10]
b10_from_bbegin:
jmp b10
//SEG4 @10
b10:
//SEG3 [1] phi from @begin to @13 [phi:@begin->@13]
b13_from_bbegin:
jmp b13
//SEG4 @13
b13:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @10 to @end [phi:@10->@end]
bend_from_b10:
//SEG6 [3] phi from @13 to @end [phi:@13->@end]
bend_from_b13:
jmp bend
//SEG7 @end
bend:
@ -2462,15 +2566,15 @@ ASSEMBLER BEFORE OPTIMIZATION
.label SCREEN = $400
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @10 [phi:@begin->@10]
b10_from_bbegin:
jmp b10
//SEG4 @10
b10:
//SEG3 [1] phi from @begin to @13 [phi:@begin->@13]
b13_from_bbegin:
jmp b13
//SEG4 @13
b13:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @10 to @end [phi:@10->@end]
bend_from_b10:
//SEG6 [3] phi from @13 to @end [phi:@13->@end]
bend_from_b13:
jmp bend
//SEG7 @end
bend:
@ -2673,7 +2777,7 @@ pressed: {
keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b10
Removing instruction jmp b13
Removing instruction jmp bend
Removing instruction jmp b2
Removing instruction jmp b2
@ -2699,8 +2803,8 @@ Replacing label b5_from_b17 with b5
Replacing label b2_from_b6 with b2
Replacing label b2_from_b10 with b2
Removing instruction bbegin:
Removing instruction b10_from_bbegin:
Removing instruction bend_from_b10:
Removing instruction b13_from_bbegin:
Removing instruction bend_from_b13:
Removing instruction b2_from_main:
Removing instruction b2_from_b2:
Removing instruction menu_from_b2:
@ -2716,7 +2820,7 @@ Removing instruction b2_from_pressed:
Removing instruction b2_from_b10:
Removing instruction keyboard_key_pressed_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b10:
Removing instruction b13:
Removing instruction bend:
Removing instruction b16:
Removing instruction b9:
@ -2732,7 +2836,7 @@ Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @10
(label) @13
(label) @begin
(label) @end
(byte*) BGCOL
@ -2846,11 +2950,11 @@ Score: 2851
.const KEY_SPACE = $3c
.label SCREEN = $400
//SEG2 @begin
//SEG3 [1] phi from @begin to @10 [phi:@begin->@10]
//SEG4 @10
//SEG3 [1] phi from @begin to @13 [phi:@begin->@13]
//SEG4 @13
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @10 to @end [phi:@10->@end]
//SEG6 [3] phi from @13 to @end [phi:@13->@end]
//SEG7 @end
//SEG8 main
main: {

View File

@ -1,4 +1,4 @@
(label) @10
(label) @13
(label) @begin
(label) @end
(byte*) BGCOL

View File

@ -1,21 +1,96 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label PROCPORT_DDR = 0
.const PROCPORT_DDR_MEMORY_MASK = 7
.label PROCPORT = 1
.const PROCPORT_RAM_IO = $35
.label BORDERCOL = $d020
.label D011 = $d011
.const VIC_BMM = $20
.const VIC_DEN = $10
.const VIC_RSEL = 8
.label D018 = $d018
.label CIA2_PORT_A = $dd00
.label CIA2_PORT_A_DDR = $dd02
.label BITMAP = $a000
.label SCREEN = $8800
.const DELAY = 8
jsr main
main: {
.const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6
.const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f
sei
lda #PROCPORT_DDR_MEMORY_MASK
sta PROCPORT_DDR
lda #PROCPORT_RAM_IO
sta PROCPORT
lda #VIC_BMM|VIC_DEN|VIC_RSEL|3
sta D011
lda #3
sta CIA2_PORT_A_DDR
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
lda #toD0181_return
sta D018
jsr bitmap_init
jsr bitmap_clear
jsr screen_fill
ldx #0
b1:
jsr init
jsr point_init
txa
lsr
tay
lda x_start,x
sta bitmap_plot.x
lda x_start+1,x
sta bitmap_plot.x+1
lda y_start,y
jsr bitmap_plot
inx
inx
cpx #8
bne b1
b3:
inc BORDERCOL
jmp b3
}
bitmap_plot: {
.label _1 = 7
.label x = 3
.label plotter = 5
.label _3 = 5
tay
lda bitmap_plot_yhi,y
sta _3+1
lda bitmap_plot_ylo,y
sta _3
lda x
and #<$fff8
sta _1
lda x+1
and #>$fff8
sta _1+1
lda plotter
clc
adc _1
sta plotter
lda plotter+1
adc _1+1
sta plotter+1
lda x
tay
lda bitmap_plot_bit,y
ldy #0
ora (plotter),y
sta (plotter),y
rts
}
init: {
.label _0 = 2
.label _2 = 2
.label _3 = 2
point_init: {
.label _0 = 3
.label _2 = 3
.label _3 = 3
lda x_start,x
sta _0
lda x_start+1,x
@ -51,9 +126,122 @@ init: {
sta y_cur,x
lda _3+1
sta y_cur+1,x
txa
lsr
tay
lda #DELAY
sta delay,y
rts
}
screen_fill: {
.const ch = $10
.label screen = 3
.label y = 2
lda #0
sta y
lda #<SCREEN
sta screen
lda #>SCREEN
sta screen+1
b1:
ldx #0
b2:
lda #ch
ldy #0
sta (screen),y
inc screen
bne !+
inc screen+1
!:
inx
cpx #$28
bne b2
inc y
lda y
cmp #$19
bne b1
rts
}
bitmap_clear: {
.label bitmap = 3
.label y = 2
.label _3 = 3
lda bitmap_plot_ylo+0
sta _3
lda bitmap_plot_yhi+0
sta _3+1
lda #0
sta y
b1:
ldx #0
b2:
lda #0
tay
sta (bitmap),y
inc bitmap
bne !+
inc bitmap+1
!:
inx
cpx #$c8
bne b2
inc y
lda y
cmp #$28
bne b1
rts
}
bitmap_init: {
.label _3 = 2
.label yoffs = 3
ldx #0
lda #$80
b1:
sta bitmap_plot_bit,x
lsr
cmp #0
bne b2
lda #$80
b2:
inx
cpx #0
bne b1
lda #<BITMAP
sta yoffs
lda #>BITMAP
sta yoffs+1
ldx #0
b3:
txa
and #7
sta _3
lda yoffs
ora _3
sta bitmap_plot_ylo,x
lda yoffs+1
sta bitmap_plot_yhi,x
txa
and #7
cmp #7
bne b4
clc
lda yoffs
adc #<$28*8
sta yoffs
lda yoffs+1
adc #>$28*8
sta yoffs+1
b4:
inx
cpx #0
bne b3
rts
}
x_start: .word $a, $14, $1e, $1e
y_start: .byte $a, $a, $a, $14
x_cur: .fill 8, 0
y_cur: .fill 8, 0
delay: .fill 4, 0
bitmap_plot_ylo: .fill $100, 0
bitmap_plot_yhi: .fill $100, 0
bitmap_plot_bit: .fill $100, 0

View File

@ -1,35 +1,166 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
to:@9
@9: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @2
@end: scope:[] from @9
[3] phi() [ ] ( )
main: scope:[main] from @2
[4] phi() [ ] ( main:2 [ ] )
main: scope:[main] from @9
asm { sei }
[5] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 [ ] ( main:2 [ ] )
[6] *((const byte*) PROCPORT#0) ← (const byte) PROCPORT_RAM_IO#0 [ ] ( main:2 [ ] )
[7] *((const byte*) D011#0) ← (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] )
to:main::vicSelectGfxBank1
main::vicSelectGfxBank1: scope:[main] from main
[8] *((const byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] )
to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1
[9] phi() [ ] ( main:2 [ ] )
to:main::vicSelectGfxBank1_@1
main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001
[10] *((const byte*) CIA2_PORT_A#0) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] )
to:main::toD0181
main::toD0181: scope:[main] from main::vicSelectGfxBank1_@1
[11] phi() [ ] ( main:2 [ ] )
to:main::@10
main::@10: scope:[main] from main::toD0181
[12] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] )
[13] call bitmap_init [ ] ( main:2 [ ] )
to:main::@11
main::@11: scope:[main] from main::@10
[14] phi() [ ] ( main:2 [ ] )
[15] call bitmap_clear [ ] ( main:2 [ ] )
to:main::@12
main::@12: scope:[main] from main::@11
[16] phi() [ ] ( main:2 [ ] )
[17] call screen_fill [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::i#1 ) [ main::i#2 ] ( main:2 [ main::i#2 ] )
[6] (byte) init::point_idx#0 ← (byte) main::i#2 [ main::i#2 init::point_idx#0 ] ( main:2 [ main::i#2 init::point_idx#0 ] )
[7] call init [ main::i#2 ] ( main:2 [ main::i#2 ] )
main::@1: scope:[main] from main::@12 main::@15
[18] (byte) main::i#2 ← phi( main::@12/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@15/(byte) main::i#1 ) [ main::i#2 ] ( main:2 [ main::i#2 ] )
[19] (byte) point_init::point_idx#0 ← (byte) main::i#2 [ main::i#2 point_init::point_idx#0 ] ( main:2 [ main::i#2 point_init::point_idx#0 ] )
[20] call point_init [ main::i#2 ] ( main:2 [ main::i#2 ] )
to:main::@14
main::@14: scope:[main] from main::@1
[21] (byte~) main::$9 ← (byte) main::i#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$9 ] ( main:2 [ main::i#2 main::$9 ] )
[22] (word) bitmap_plot::x#0 ← *((const word[4]) x_start#0 + (byte) main::i#2) [ main::i#2 main::$9 bitmap_plot::x#0 ] ( main:2 [ main::i#2 main::$9 bitmap_plot::x#0 ] )
[23] (byte) bitmap_plot::y#0 ← *((const byte[4]) y_start#0 + (byte~) main::$9) [ main::i#2 bitmap_plot::x#0 bitmap_plot::y#0 ] ( main:2 [ main::i#2 bitmap_plot::x#0 bitmap_plot::y#0 ] )
[24] call bitmap_plot [ main::i#2 ] ( main:2 [ main::i#2 ] )
to:main::@15
main::@15: scope:[main] from main::@14
[25] (byte) main::i#1 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ main::i#1 ] ( main:2 [ main::i#1 ] )
[26] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] )
to:main::@3
main::@3: scope:[main] from main::@1
[8] (byte) main::i#1 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ main::i#1 ] ( main:2 [ main::i#1 ] )
[9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] )
to:main::@return
main::@return: scope:[main] from main::@3
[10] return [ ] ( main:2 [ ] )
main::@3: scope:[main] from main::@15 main::@3
[27] *((const byte*) BORDERCOL#0) ← ++ *((const byte*) BORDERCOL#0) [ ] ( main:2 [ ] )
to:main::@3
bitmap_plot: scope:[bitmap_plot] from main::@14
[28] (word~) bitmap_plot::$3 ← *((const byte[256]) bitmap_plot_yhi#0 + (byte) bitmap_plot::y#0) w= *((const byte[256]) bitmap_plot_ylo#0 + (byte) bitmap_plot::y#0) [ bitmap_plot::x#0 bitmap_plot::$3 ] ( main:2::bitmap_plot:24 [ main::i#2 bitmap_plot::x#0 bitmap_plot::$3 ] )
[29] (word~) bitmap_plot::$1 ← (word) bitmap_plot::x#0 & (word/dword/signed dword) 65528 [ bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] ( main:2::bitmap_plot:24 [ main::i#2 bitmap_plot::x#0 bitmap_plot::$3 bitmap_plot::$1 ] )
[30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word~) bitmap_plot::$3 + (word~) bitmap_plot::$1 [ bitmap_plot::x#0 bitmap_plot::plotter#1 ] ( main:2::bitmap_plot:24 [ main::i#2 bitmap_plot::x#0 bitmap_plot::plotter#1 ] )
[31] (byte~) bitmap_plot::$2 ← < (word) bitmap_plot::x#0 [ bitmap_plot::plotter#1 bitmap_plot::$2 ] ( main:2::bitmap_plot:24 [ main::i#2 bitmap_plot::plotter#1 bitmap_plot::$2 ] )
[32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const byte[256]) bitmap_plot_bit#0 + (byte~) bitmap_plot::$2) [ ] ( main:2::bitmap_plot:24 [ main::i#2 ] )
to:bitmap_plot::@return
bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot
[33] return [ ] ( main:2::bitmap_plot:24 [ main::i#2 ] )
to:@return
init: scope:[init] from main::@1
[11] (word~) init::$0 ← *((const word[4]) x_start#0 + (byte) init::point_idx#0) << (byte/signed byte/word/signed word/dword/signed dword) 4 [ init::point_idx#0 init::$0 ] ( main:2::init:7 [ main::i#2 init::point_idx#0 init::$0 ] )
[12] *((const word[4]) x_cur#0 + (byte) init::point_idx#0) ← (word~) init::$0 [ init::point_idx#0 ] ( main:2::init:7 [ main::i#2 init::point_idx#0 ] )
[13] (byte~) init::$1 ← (byte) init::point_idx#0 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ init::point_idx#0 init::$1 ] ( main:2::init:7 [ main::i#2 init::point_idx#0 init::$1 ] )
[14] (word~) init::$2 ← ((word)) *((const byte[4]) y_start#0 + (byte~) init::$1) [ init::point_idx#0 init::$2 ] ( main:2::init:7 [ main::i#2 init::point_idx#0 init::$2 ] )
[15] (word~) init::$3 ← (word~) init::$2 << (byte/signed byte/word/signed word/dword/signed dword) 4 [ init::point_idx#0 init::$3 ] ( main:2::init:7 [ main::i#2 init::point_idx#0 init::$3 ] )
[16] *((const word[4]) y_cur#0 + (byte) init::point_idx#0) ← (word~) init::$3 [ ] ( main:2::init:7 [ main::i#2 ] )
to:init::@return
init::@return: scope:[init] from init
[17] return [ ] ( main:2::init:7 [ main::i#2 ] )
point_init: scope:[point_init] from main::@1
[34] (word~) point_init::$0 ← *((const word[4]) x_start#0 + (byte) point_init::point_idx#0) << (byte/signed byte/word/signed word/dword/signed dword) 4 [ point_init::point_idx#0 point_init::$0 ] ( main:2::point_init:20 [ main::i#2 point_init::point_idx#0 point_init::$0 ] )
[35] *((const word[4]) x_cur#0 + (byte) point_init::point_idx#0) ← (word~) point_init::$0 [ point_init::point_idx#0 ] ( main:2::point_init:20 [ main::i#2 point_init::point_idx#0 ] )
[36] (byte~) point_init::$1 ← (byte) point_init::point_idx#0 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ point_init::point_idx#0 point_init::$1 ] ( main:2::point_init:20 [ main::i#2 point_init::point_idx#0 point_init::$1 ] )
[37] (word~) point_init::$2 ← ((word)) *((const byte[4]) y_start#0 + (byte~) point_init::$1) [ point_init::point_idx#0 point_init::$2 ] ( main:2::point_init:20 [ main::i#2 point_init::point_idx#0 point_init::$2 ] )
[38] (word~) point_init::$3 ← (word~) point_init::$2 << (byte/signed byte/word/signed word/dword/signed dword) 4 [ point_init::point_idx#0 point_init::$3 ] ( main:2::point_init:20 [ main::i#2 point_init::point_idx#0 point_init::$3 ] )
[39] *((const word[4]) y_cur#0 + (byte) point_init::point_idx#0) ← (word~) point_init::$3 [ point_init::point_idx#0 ] ( main:2::point_init:20 [ main::i#2 point_init::point_idx#0 ] )
[40] (byte~) point_init::$4 ← (byte) point_init::point_idx#0 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ point_init::$4 ] ( main:2::point_init:20 [ main::i#2 point_init::$4 ] )
[41] *((const byte[4]) delay#0 + (byte~) point_init::$4) ← (const byte) DELAY#0 [ ] ( main:2::point_init:20 [ main::i#2 ] )
to:point_init::@return
point_init::@return: scope:[point_init] from point_init
[42] return [ ] ( main:2::point_init:20 [ main::i#2 ] )
to:@return
screen_fill: scope:[screen_fill] from main::@12
[43] phi() [ ] ( main:2::screen_fill:17 [ ] )
to:screen_fill::@1
screen_fill::@1: scope:[screen_fill] from screen_fill screen_fill::@3
[44] (byte) screen_fill::y#4 ← phi( screen_fill/(byte/signed byte/word/signed word/dword/signed dword) 0 screen_fill::@3/(byte) screen_fill::y#1 ) [ screen_fill::screen#3 screen_fill::y#4 ] ( main:2::screen_fill:17 [ screen_fill::screen#3 screen_fill::y#4 ] )
[44] (byte*) screen_fill::screen#3 ← phi( screen_fill/(const byte*) SCREEN#0 screen_fill::@3/(byte*) screen_fill::screen#1 ) [ screen_fill::screen#3 screen_fill::y#4 ] ( main:2::screen_fill:17 [ screen_fill::screen#3 screen_fill::y#4 ] )
to:screen_fill::@2
screen_fill::@2: scope:[screen_fill] from screen_fill::@1 screen_fill::@2
[45] (byte) screen_fill::x#2 ← phi( screen_fill::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 screen_fill::@2/(byte) screen_fill::x#1 ) [ screen_fill::y#4 screen_fill::screen#2 screen_fill::x#2 ] ( main:2::screen_fill:17 [ screen_fill::y#4 screen_fill::screen#2 screen_fill::x#2 ] )
[45] (byte*) screen_fill::screen#2 ← phi( screen_fill::@1/(byte*) screen_fill::screen#3 screen_fill::@2/(byte*) screen_fill::screen#1 ) [ screen_fill::y#4 screen_fill::screen#2 screen_fill::x#2 ] ( main:2::screen_fill:17 [ screen_fill::y#4 screen_fill::screen#2 screen_fill::x#2 ] )
[46] *((byte*) screen_fill::screen#2) ← (const byte) screen_fill::ch#0 [ screen_fill::y#4 screen_fill::screen#2 screen_fill::x#2 ] ( main:2::screen_fill:17 [ screen_fill::y#4 screen_fill::screen#2 screen_fill::x#2 ] )
[47] (byte*) screen_fill::screen#1 ← ++ (byte*) screen_fill::screen#2 [ screen_fill::y#4 screen_fill::screen#1 screen_fill::x#2 ] ( main:2::screen_fill:17 [ screen_fill::y#4 screen_fill::screen#1 screen_fill::x#2 ] )
[48] (byte) screen_fill::x#1 ← ++ (byte) screen_fill::x#2 [ screen_fill::y#4 screen_fill::screen#1 screen_fill::x#1 ] ( main:2::screen_fill:17 [ screen_fill::y#4 screen_fill::screen#1 screen_fill::x#1 ] )
[49] if((byte) screen_fill::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto screen_fill::@2 [ screen_fill::y#4 screen_fill::screen#1 screen_fill::x#1 ] ( main:2::screen_fill:17 [ screen_fill::y#4 screen_fill::screen#1 screen_fill::x#1 ] )
to:screen_fill::@3
screen_fill::@3: scope:[screen_fill] from screen_fill::@2
[50] (byte) screen_fill::y#1 ← ++ (byte) screen_fill::y#4 [ screen_fill::screen#1 screen_fill::y#1 ] ( main:2::screen_fill:17 [ screen_fill::screen#1 screen_fill::y#1 ] )
[51] if((byte) screen_fill::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto screen_fill::@1 [ screen_fill::screen#1 screen_fill::y#1 ] ( main:2::screen_fill:17 [ screen_fill::screen#1 screen_fill::y#1 ] )
to:screen_fill::@return
screen_fill::@return: scope:[screen_fill] from screen_fill::@3
[52] return [ ] ( main:2::screen_fill:17 [ ] )
to:@return
bitmap_clear: scope:[bitmap_clear] from main::@11
[53] (word~) bitmap_clear::$3 ← *((const byte[256]) bitmap_plot_yhi#0+(byte/signed byte/word/signed word/dword/signed dword) 0) w= *((const byte[256]) bitmap_plot_ylo#0+(byte/signed byte/word/signed word/dword/signed dword) 0) [ bitmap_clear::$3 ] ( main:2::bitmap_clear:15 [ bitmap_clear::$3 ] )
[54] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3 [ bitmap_clear::bitmap#5 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#5 ] )
to:bitmap_clear::@1
bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3
[55] (byte) bitmap_clear::y#4 ← phi( bitmap_clear/(byte/signed byte/word/signed word/dword/signed dword) 0 bitmap_clear::@3/(byte) bitmap_clear::y#1 ) [ bitmap_clear::bitmap#3 bitmap_clear::y#4 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#3 bitmap_clear::y#4 ] )
[55] (byte*) bitmap_clear::bitmap#3 ← phi( bitmap_clear/(byte*~) bitmap_clear::bitmap#5 bitmap_clear::@3/(byte*) bitmap_clear::bitmap#1 ) [ bitmap_clear::bitmap#3 bitmap_clear::y#4 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#3 bitmap_clear::y#4 ] )
to:bitmap_clear::@2
bitmap_clear::@2: scope:[bitmap_clear] from bitmap_clear::@1 bitmap_clear::@2
[56] (byte) bitmap_clear::x#2 ← phi( bitmap_clear::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 bitmap_clear::@2/(byte) bitmap_clear::x#1 ) [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::bitmap_clear:15 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] )
[56] (byte*) bitmap_clear::bitmap#2 ← phi( bitmap_clear::@1/(byte*) bitmap_clear::bitmap#3 bitmap_clear::@2/(byte*) bitmap_clear::bitmap#1 ) [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::bitmap_clear:15 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] )
[57] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] ( main:2::bitmap_clear:15 [ bitmap_clear::y#4 bitmap_clear::bitmap#2 bitmap_clear::x#2 ] )
[58] (byte*) bitmap_clear::bitmap#1 ← ++ (byte*) bitmap_clear::bitmap#2 [ bitmap_clear::y#4 bitmap_clear::bitmap#1 bitmap_clear::x#2 ] ( main:2::bitmap_clear:15 [ bitmap_clear::y#4 bitmap_clear::bitmap#1 bitmap_clear::x#2 ] )
[59] (byte) bitmap_clear::x#1 ← ++ (byte) bitmap_clear::x#2 [ bitmap_clear::y#4 bitmap_clear::bitmap#1 bitmap_clear::x#1 ] ( main:2::bitmap_clear:15 [ bitmap_clear::y#4 bitmap_clear::bitmap#1 bitmap_clear::x#1 ] )
[60] if((byte) bitmap_clear::x#1!=(byte/word/signed word/dword/signed dword) 200) goto bitmap_clear::@2 [ bitmap_clear::y#4 bitmap_clear::bitmap#1 bitmap_clear::x#1 ] ( main:2::bitmap_clear:15 [ bitmap_clear::y#4 bitmap_clear::bitmap#1 bitmap_clear::x#1 ] )
to:bitmap_clear::@3
bitmap_clear::@3: scope:[bitmap_clear] from bitmap_clear::@2
[61] (byte) bitmap_clear::y#1 ← ++ (byte) bitmap_clear::y#4 [ bitmap_clear::bitmap#1 bitmap_clear::y#1 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#1 bitmap_clear::y#1 ] )
[62] if((byte) bitmap_clear::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto bitmap_clear::@1 [ bitmap_clear::bitmap#1 bitmap_clear::y#1 ] ( main:2::bitmap_clear:15 [ bitmap_clear::bitmap#1 bitmap_clear::y#1 ] )
to:bitmap_clear::@return
bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@3
[63] return [ ] ( main:2::bitmap_clear:15 [ ] )
to:@return
bitmap_init: scope:[bitmap_init] from main::@10
[64] phi() [ ] ( main:2::bitmap_init:13 [ ] )
to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2
[65] (byte) bitmap_init::x#2 ← phi( bitmap_init/(byte/signed byte/word/signed word/dword/signed dword) 0 bitmap_init::@2/(byte) bitmap_init::x#1 ) [ bitmap_init::bits#3 bitmap_init::x#2 ] ( main:2::bitmap_init:13 [ bitmap_init::bits#3 bitmap_init::x#2 ] )
[65] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte/word/signed word/dword/signed dword) 128 bitmap_init::@2/(byte) bitmap_init::bits#4 ) [ bitmap_init::bits#3 bitmap_init::x#2 ] ( main:2::bitmap_init:13 [ bitmap_init::bits#3 bitmap_init::x#2 ] )
[66] *((const byte[256]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 [ bitmap_init::bits#3 bitmap_init::x#2 ] ( main:2::bitmap_init:13 [ bitmap_init::bits#3 bitmap_init::x#2 ] )
[67] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte/signed byte/word/signed word/dword/signed dword) 1 [ bitmap_init::x#2 bitmap_init::bits#1 ] ( main:2::bitmap_init:13 [ bitmap_init::x#2 bitmap_init::bits#1 ] )
[68] if((byte) bitmap_init::bits#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@10 [ bitmap_init::x#2 bitmap_init::bits#1 ] ( main:2::bitmap_init:13 [ bitmap_init::x#2 bitmap_init::bits#1 ] )
to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@10
[69] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@10/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte/word/signed word/dword/signed dword) 128 ) [ bitmap_init::x#2 bitmap_init::bits#4 ] ( main:2::bitmap_init:13 [ bitmap_init::x#2 bitmap_init::bits#4 ] )
[70] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2 [ bitmap_init::bits#4 bitmap_init::x#1 ] ( main:2::bitmap_init:13 [ bitmap_init::bits#4 bitmap_init::x#1 ] )
[71] if((byte) bitmap_init::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@1 [ bitmap_init::bits#4 bitmap_init::x#1 ] ( main:2::bitmap_init:13 [ bitmap_init::bits#4 bitmap_init::x#1 ] )
to:bitmap_init::@3
bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4
[72] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@4/(byte*) bitmap_init::yoffs#4 bitmap_init::@2/(const byte*) BITMAP#0 ) [ bitmap_init::y#2 bitmap_init::yoffs#2 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 ] )
[72] (byte) bitmap_init::y#2 ← phi( bitmap_init::@4/(byte) bitmap_init::y#1 bitmap_init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 ) [ bitmap_init::y#2 bitmap_init::yoffs#2 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 ] )
[73] (byte~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$3 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$3 ] )
[74] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$3 bitmap_init::$4 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$3 bitmap_init::$4 ] )
[75] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$3 | (byte~) bitmap_init::$4 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$5 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$5 ] )
[76] *((const byte[256]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5 [ bitmap_init::y#2 bitmap_init::yoffs#2 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 ] )
[77] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$6 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$6 ] )
[78] *((const byte[256]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6 [ bitmap_init::y#2 bitmap_init::yoffs#2 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 ] )
[79] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 bitmap_init::$7 ] )
[80] if((byte~) bitmap_init::$7!=(byte/signed byte/word/signed word/dword/signed dword) 7) goto bitmap_init::@4 [ bitmap_init::y#2 bitmap_init::yoffs#2 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#2 ] )
to:bitmap_init::@7
bitmap_init::@7: scope:[bitmap_init] from bitmap_init::@3
[81] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (byte/signed byte/word/signed word/dword/signed dword) 40*(byte/signed byte/word/signed word/dword/signed dword) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] )
to:bitmap_init::@4
bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@3 bitmap_init::@7
[82] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@7/(byte*) bitmap_init::yoffs#1 ) [ bitmap_init::y#2 bitmap_init::yoffs#4 ] ( main:2::bitmap_init:13 [ bitmap_init::y#2 bitmap_init::yoffs#4 ] )
[83] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2 [ bitmap_init::y#1 bitmap_init::yoffs#4 ] ( main:2::bitmap_init:13 [ bitmap_init::y#1 bitmap_init::yoffs#4 ] )
[84] if((byte) bitmap_init::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@3 [ bitmap_init::y#1 bitmap_init::yoffs#4 ] ( main:2::bitmap_init:13 [ bitmap_init::y#1 bitmap_init::yoffs#4 ] )
to:bitmap_init::@return
bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4
[85] return [ ] ( main:2::bitmap_init:13 [ ] )
to:@return
bitmap_init::@10: scope:[bitmap_init] from bitmap_init::@1
[86] phi() [ bitmap_init::x#2 bitmap_init::bits#1 ] ( main:2::bitmap_init:13 [ bitmap_init::x#2 bitmap_init::bits#1 ] )
to:bitmap_init::@2

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,164 @@
(label) @2
(label) @9
(label) @begin
(label) @end
(void()) init((byte) init::point_idx)
(word~) init::$0 $0 zp ZP_WORD:2 4.0
(byte~) init::$1 reg byte a 4.0
(word~) init::$2 $2 zp ZP_WORD:2 4.0
(word~) init::$3 $3 zp ZP_WORD:2 4.0
(label) init::@return
(byte) init::point_idx
(byte) init::point_idx#0 reg byte x 3.166666666666667
(byte*) BITMAP
(const byte*) BITMAP#0 BITMAP = ((byte*))(word/dword/signed dword) 40960
(byte*) BORDERCOL
(const byte*) BORDERCOL#0 BORDERCOL = ((byte*))(word/dword/signed dword) 53280
(byte*) CIA2_PORT_A
(const byte*) CIA2_PORT_A#0 CIA2_PORT_A = ((byte*))(word/dword/signed dword) 56576
(byte*) CIA2_PORT_A_DDR
(const byte*) CIA2_PORT_A_DDR#0 CIA2_PORT_A_DDR = ((byte*))(word/dword/signed dword) 56578
(byte*) D011
(const byte*) D011#0 D011 = ((byte*))(word/dword/signed dword) 53265
(byte*) D018
(const byte*) D018#0 D018 = ((byte*))(word/dword/signed dword) 53272
(byte) DELAY
(const byte) DELAY#0 DELAY = (byte/signed byte/word/signed word/dword/signed dword) 8
(byte*) PROCPORT
(const byte*) PROCPORT#0 PROCPORT = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 1
(byte*) PROCPORT_DDR
(const byte*) PROCPORT_DDR#0 PROCPORT_DDR = ((byte*))(byte/signed byte/word/signed word/dword/signed dword) 0
(byte) PROCPORT_DDR_MEMORY_MASK
(const byte) PROCPORT_DDR_MEMORY_MASK#0 PROCPORT_DDR_MEMORY_MASK = (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) PROCPORT_RAM_IO
(const byte) PROCPORT_RAM_IO#0 PROCPORT_RAM_IO = (byte/signed byte/word/signed word/dword/signed dword) 53
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/dword/signed dword) 34816
(byte) VIC_BMM
(const byte) VIC_BMM#0 VIC_BMM = (byte/signed byte/word/signed word/dword/signed dword) 32
(byte) VIC_DEN
(const byte) VIC_DEN#0 VIC_DEN = (byte/signed byte/word/signed word/dword/signed dword) 16
(byte) VIC_RSEL
(const byte) VIC_RSEL#0 VIC_RSEL = (byte/signed byte/word/signed word/dword/signed dword) 8
(void()) bitmap_clear()
(word~) bitmap_clear::$3 $3 zp ZP_WORD:3 2.0
(label) bitmap_clear::@1
(label) bitmap_clear::@2
(label) bitmap_clear::@3
(label) bitmap_clear::@return
(byte*) bitmap_clear::bitmap
(byte*) bitmap_clear::bitmap#1 bitmap zp ZP_WORD:3 42.599999999999994
(byte*) bitmap_clear::bitmap#2 bitmap zp ZP_WORD:3 157.0
(byte*) bitmap_clear::bitmap#3 bitmap zp ZP_WORD:3 24.0
(byte*~) bitmap_clear::bitmap#5 bitmap zp ZP_WORD:3 4.0
(byte) bitmap_clear::x
(byte) bitmap_clear::x#1 reg byte x 151.5
(byte) bitmap_clear::x#2 reg byte x 67.33333333333333
(byte) bitmap_clear::y
(byte) bitmap_clear::y#1 y zp ZP_BYTE:2 16.5
(byte) bitmap_clear::y#4 y zp ZP_BYTE:2 3.6666666666666665
(void()) bitmap_init((byte*) bitmap_init::bitmap)
(byte~) bitmap_init::$3 $3 zp ZP_BYTE:2 11.0
(byte~) bitmap_init::$4 reg byte a 22.0
(byte~) bitmap_init::$5 reg byte a 22.0
(byte~) bitmap_init::$6 reg byte a 22.0
(byte~) bitmap_init::$7 reg byte a 22.0
(label) bitmap_init::@1
(label) bitmap_init::@10
(label) bitmap_init::@2
(label) bitmap_init::@3
(label) bitmap_init::@4
(label) bitmap_init::@7
(label) bitmap_init::@return
(byte*) bitmap_init::bitmap
(byte) bitmap_init::bits
(byte) bitmap_init::bits#1 reg byte a 11.0
(byte) bitmap_init::bits#3 reg byte a 16.5
(byte) bitmap_init::bits#4 reg byte a 7.333333333333333
(byte) bitmap_init::x
(byte) bitmap_init::x#1 reg byte x 16.5
(byte) bitmap_init::x#2 reg byte x 5.5
(byte) bitmap_init::y
(byte) bitmap_init::y#1 reg byte x 16.5
(byte) bitmap_init::y#2 reg byte x 6.0
(byte*) bitmap_init::yoffs
(byte*) bitmap_init::yoffs#1 yoffs zp ZP_WORD:3 22.0
(byte*) bitmap_init::yoffs#2 yoffs zp ZP_WORD:3 6.111111111111112
(byte*) bitmap_init::yoffs#4 yoffs zp ZP_WORD:3 11.0
(void()) bitmap_plot((word) bitmap_plot::x , (byte) bitmap_plot::y)
(word~) bitmap_plot::$1 $1 zp ZP_WORD:7 4.0
(byte~) bitmap_plot::$2 reg byte a 4.0
(word~) bitmap_plot::$3 $3 zp ZP_WORD:5 1.0
(label) bitmap_plot::@return
(byte*) bitmap_plot::plotter
(byte*) bitmap_plot::plotter#1 plotter zp ZP_WORD:5 3.0
(word) bitmap_plot::x
(word) bitmap_plot::x#0 x zp ZP_WORD:3 3.0
(byte) bitmap_plot::y
(byte) bitmap_plot::y#0 reg byte a 15.0
(byte[256]) bitmap_plot_bit
(const byte[256]) bitmap_plot_bit#0 bitmap_plot_bit = { fill( 256, 0) }
(byte[256]) bitmap_plot_yhi
(const byte[256]) bitmap_plot_yhi#0 bitmap_plot_yhi = { fill( 256, 0) }
(byte[256]) bitmap_plot_ylo
(const byte[256]) bitmap_plot_ylo#0 bitmap_plot_ylo = { fill( 256, 0) }
(byte[4]) delay
(const byte[4]) delay#0 delay = { fill( 4, 0) }
(void()) main()
(byte~) main::$9 reg byte y 11.0
(label) main::@1
(label) main::@10
(label) main::@11
(label) main::@12
(label) main::@14
(label) main::@15
(label) main::@3
(label) main::@return
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 11.0
(byte) main::i#2 reg byte x 7.857142857142857
(label) main::toD0181
(word~) main::toD0181_$0
(word~) main::toD0181_$1
(word~) main::toD0181_$2
(byte~) main::toD0181_$3
(word~) main::toD0181_$4
(byte~) main::toD0181_$5
(byte~) main::toD0181_$6
(byte~) main::toD0181_$7
(byte~) main::toD0181_$8
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) 16383<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) 15
(byte*) main::toD0181_screen
(label) main::vicSelectGfxBank1
(byte~) main::vicSelectGfxBank1_$0
(label) main::vicSelectGfxBank1_@1
(byte*) main::vicSelectGfxBank1_gfx
(label) main::vicSelectGfxBank1_toDd001
(word~) main::vicSelectGfxBank1_toDd001_$0
(byte~) main::vicSelectGfxBank1_toDd001_$1
(byte~) main::vicSelectGfxBank1_toDd001_$2
(byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3
(byte*) main::vicSelectGfxBank1_toDd001_gfx
(byte) main::vicSelectGfxBank1_toDd001_return
(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0>>(byte/signed byte/word/signed word/dword/signed dword) 6
(void()) point_init((byte) point_init::point_idx)
(word~) point_init::$0 $0 zp ZP_WORD:3 4.0
(byte~) point_init::$1 reg byte a 4.0
(word~) point_init::$2 $2 zp ZP_WORD:3 4.0
(word~) point_init::$3 $3 zp ZP_WORD:3 4.0
(byte~) point_init::$4 reg byte a 4.0
(label) point_init::@return
(byte) point_init::point_idx
(byte) point_init::point_idx#0 reg byte x 2.9999999999999996
(void()) screen_fill((byte*) screen_fill::screen , (byte) screen_fill::ch)
(label) screen_fill::@1
(label) screen_fill::@2
(label) screen_fill::@3
(label) screen_fill::@return
(byte) screen_fill::ch
(const byte) screen_fill::ch#0 ch = (byte/signed byte/word/signed word/dword/signed dword) 16
(byte*) screen_fill::screen
(byte*) screen_fill::screen#1 screen zp ZP_WORD:3 42.599999999999994
(byte*) screen_fill::screen#2 screen zp ZP_WORD:3 157.0
(byte*) screen_fill::screen#3 screen zp ZP_WORD:3 22.0
(byte) screen_fill::x
(byte) screen_fill::x#1 reg byte x 151.5
(byte) screen_fill::x#2 reg byte x 67.33333333333333
(byte) screen_fill::y
(byte) screen_fill::y#1 y zp ZP_BYTE:2 16.5
(byte) screen_fill::y#4 y zp ZP_BYTE:2 3.6666666666666665
(word[4]) x_cur
(const word[4]) x_cur#0 x_cur = { fill( 4, 0) }
(word[4]) x_start
@ -26,6 +169,22 @@
(const byte[4]) y_start#0 y_start = { (byte/signed byte/word/signed word/dword/signed dword) 10, (byte/signed byte/word/signed word/dword/signed dword) 10, (byte/signed byte/word/signed word/dword/signed dword) 10, (byte/signed byte/word/signed word/dword/signed dword) 20 }
reg byte x [ main::i#2 main::i#1 ]
reg byte x [ init::point_idx#0 ]
zp ZP_WORD:2 [ init::$0 init::$2 init::$3 ]
reg byte a [ init::$1 ]
zp ZP_BYTE:2 [ screen_fill::y#4 screen_fill::y#1 bitmap_clear::y#4 bitmap_clear::y#1 bitmap_init::$3 ]
zp ZP_WORD:3 [ screen_fill::screen#2 screen_fill::screen#3 screen_fill::screen#1 bitmap_clear::bitmap#2 bitmap_clear::bitmap#3 bitmap_clear::bitmap#5 bitmap_clear::bitmap#1 bitmap_clear::$3 bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 bitmap_plot::x#0 point_init::$0 point_init::$2 point_init::$3 ]
reg byte x [ screen_fill::x#2 screen_fill::x#1 ]
reg byte x [ bitmap_clear::x#2 bitmap_clear::x#1 ]
reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ]
reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ]
reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ]
reg byte x [ point_init::point_idx#0 ]
reg byte y [ main::$9 ]
reg byte a [ bitmap_plot::y#0 ]
zp ZP_WORD:5 [ bitmap_plot::$3 bitmap_plot::plotter#1 ]
zp ZP_WORD:7 [ bitmap_plot::$1 ]
reg byte a [ bitmap_plot::$2 ]
reg byte a [ point_init::$1 ]
reg byte a [ point_init::$4 ]
reg byte a [ bitmap_init::$4 ]
reg byte a [ bitmap_init::$5 ]
reg byte a [ bitmap_init::$6 ]
reg byte a [ bitmap_init::$7 ]

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
to:@5
@5: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
[3] phi() [ ] ( )
main: scope:[main] from @2
main: scope:[main] from @5
asm { sei }
to:main::@2
main::@2: scope:[main] from main main::@2 main::@5

View File

@ -166,10 +166,31 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Adding pre/post-modifier (byte) raster::i ← ++ (byte) raster::i
SYMBOLS
(label) @1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @begin
(label) @end
(byte*) BGCOL
@ -256,6 +277,34 @@ SYMBOLS
(byte) raster::col
(byte) raster::i
(byte[]) rastercols
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -361,6 +410,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
to:@4
main: scope:[main] from
asm { sei }
to:main::@1
@ -385,9 +479,9 @@ main::@6: scope:[main] from main::@5
main::@return: scope:[main] from main::@6
return
to:@return
@1: scope:[] from @begin
@4: scope:[] from @3
(byte[]) rastercols ← { (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/word/signed word/dword/signed dword) 255 }
to:@2
to:@5
raster: scope:[raster] from
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
(byte) raster::i ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -407,11 +501,15 @@ raster::@2: scope:[raster] from raster::@1
raster::@return: scope:[raster] from raster::@2
return
to:@return
@2: scope:[] from @1
@5: scope:[] from @4
call main
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Eliminating unused variable (byte*) PROCPORT_DDR and assignment [0] (byte*) PROCPORT_DDR ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0
Eliminating unused variable (byte) PROCPORT_DDR_MEMORY_MASK and assignment [1] (byte) PROCPORT_DDR_MEMORY_MASK ← (byte/signed byte/word/signed word/dword/signed dword) 7
Eliminating unused variable (byte*) PROCPORT and assignment [2] (byte*) PROCPORT ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1
@ -475,6 +573,9 @@ Eliminating unused variable (byte) LIGHT_GREEN and assignment [62] (byte) LIGHT_
Eliminating unused variable (byte) LIGHT_BLUE and assignment [63] (byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
Eliminating unused variable (byte) LIGHT_GREY and assignment [64] (byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
Eliminating unused variable - keeping the call (void~) main::$2
Removing empty block @1
Removing empty block @2
Removing empty block @3
Removing empty block main::@4
Removing empty block main::@6
Removing empty block raster::@2
@ -487,8 +588,8 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) RASTER#0 ← ((byte*)) (word/dword/signed dword) 53266
(byte*) BORDERCOL#0 ← ((byte*)) (word/dword/signed dword) 53280
(byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) 53281
to:@1
main: scope:[main] from @2
to:@4
main: scope:[main] from @5
asm { sei }
to:main::@2
main::@1: scope:[main] from main::@7
@ -510,9 +611,9 @@ main::@7: scope:[main] from main::@5
main::@return: scope:[main] from main::@7
return
to:@return
@1: scope:[] from @begin
@4: scope:[] from @begin
(byte[]) rastercols#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 15, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 12, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 11, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/word/signed word/dword/signed dword) 255 }
to:@2
to:@5
raster: scope:[raster] from main::@5
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
(byte) raster::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -532,17 +633,17 @@ raster::@1: scope:[raster] from raster raster::@1
raster::@return: scope:[raster] from raster::@1
return
to:@return
@2: scope:[] from @1
@5: scope:[] from @4
call main
to:@3
@3: scope:[] from @2
to:@6
@6: scope:[] from @5
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @6
(label) @begin
(label) @end
(byte*) BGCOL
@ -577,7 +678,7 @@ SYMBOL TABLE SSA
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) main::@1
Culled Empty Block (label) @3
Culled Empty Block (label) @6
Succesful SSA optimization Pass2CullEmptyBlocks
Simple Condition (bool~) main::$0 if(*((byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 10) goto main::@2
Simple Condition (bool~) main::$1 if(*((byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) 11) goto main::@3
@ -596,18 +697,18 @@ Succesful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) main::@7
Culled Empty Block (label) @1
Culled Empty Block (label) @4
Succesful SSA optimization Pass2CullEmptyBlocks
OPTIMIZING CONTROL FLOW GRAPH
Inlining constant with var siblings (const byte) raster::i#0
Inlining constant with var siblings (const byte) raster::i#0
Constant inlined raster::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@5 raster raster::@1 raster::@return
Block Sequence Planned @begin @5 @end main main::@2 main::@3 main::@5 raster raster::@1 raster::@return
Added new block during phi lifting raster::@3(between raster::@1 and raster::@1)
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@5 raster raster::@1 raster::@return raster::@3
Block Sequence Planned @begin @5 @end main main::@2 main::@3 main::@5 raster raster::@1 raster::@return raster::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@5
CALL GRAPH
@ -625,9 +726,9 @@ Coalesced [20] raster::col#4 ← raster::col#1
Coalesced [21] raster::i#3 ← raster::i#1
Coalesced down to 2 phi equivalence classes
Culled Empty Block (label) raster::@3
Block Sequence Planned @begin @2 @end main main::@2 main::@3 main::@5 raster raster::@1 raster::@return
Block Sequence Planned @begin @5 @end main main::@2 main::@3 main::@5 raster raster::@1 raster::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
Adding NOP phi() at start of @5
Adding NOP phi() at start of @end
Adding NOP phi() at start of main::@5
Propagating live ranges...
@ -638,14 +739,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@2
@2: scope:[] from @begin
to:@5
@5: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @2
@end: scope:[] from @5
[3] phi() [ ] ( )
main: scope:[main] from @2
main: scope:[main] from @5
asm { sei }
to:main::@2
main::@2: scope:[main] from main main::@2 main::@5
@ -678,15 +779,15 @@ raster::@return: scope:[raster] from raster::@1
DOMINATORS
@begin dominated by @begin
@2 dominated by @2 @begin
@end dominated by @2 @begin @end
main dominated by @2 @begin main
main::@2 dominated by @2 @begin main::@2 main
main::@3 dominated by @2 @begin main::@2 main main::@3
main::@5 dominated by @2 @begin main::@2 main main::@5 main::@3
raster dominated by @2 @begin raster main::@2 main main::@5 main::@3
raster::@1 dominated by @2 @begin raster main::@2 raster::@1 main main::@5 main::@3
raster::@return dominated by @2 @begin raster main::@2 raster::@1 raster::@return main main::@5 main::@3
@5 dominated by @begin @5
@end dominated by @begin @5 @end
main dominated by @begin @5 main
main::@2 dominated by @begin @5 main::@2 main
main::@3 dominated by @begin @5 main::@2 main main::@3
main::@5 dominated by @begin @5 main::@2 main main::@5 main::@3
raster dominated by @begin @5 raster main::@2 main main::@5 main::@3
raster::@1 dominated by @begin @5 raster main::@2 raster::@1 main main::@5 main::@3
raster::@return dominated by @begin @5 raster main::@2 raster::@1 raster::@return main main::@5 main::@3
NATURAL LOOPS
Found back edge: Loop head: main::@2 tails: main::@2 blocks: null
@ -751,15 +852,15 @@ INITIAL ASM
.label BGCOL = $d021
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG4 @2
b2:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
jmp b5
//SEG4 @5
b5:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
jmp bend
//SEG7 @end
bend:
@ -904,15 +1005,15 @@ ASSEMBLER BEFORE OPTIMIZATION
.label BGCOL = $d021
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
b2_from_bbegin:
jmp b2
//SEG4 @2
b2:
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
b5_from_bbegin:
jmp b5
//SEG4 @5
b5:
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
bend_from_b2:
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
bend_from_b5:
jmp bend
//SEG7 @end
bend:
@ -1023,7 +1124,7 @@ raster: {
rastercols: .byte $b, 0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, 1, $f, 1, 1, $f, 1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, 0, $b, 0, $ff
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b2
Removing instruction jmp b5
Removing instruction jmp bend
Removing instruction jmp b2
Removing instruction jmp b3
@ -1033,12 +1134,12 @@ Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b1 with b1
Removing instruction bbegin:
Removing instruction b2_from_bbegin:
Removing instruction bend_from_b2:
Removing instruction b5_from_bbegin:
Removing instruction bend_from_b5:
Removing instruction b5_from_b3:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b2:
Removing instruction b5:
Removing instruction bend:
Removing instruction b5:
Removing instruction b1_from_raster:
@ -1048,7 +1149,7 @@ Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
(label) @2
(label) @5
(label) @begin
(label) @end
(byte*) BGCOL
@ -1090,11 +1191,11 @@ Score: 8346
.label BORDERCOL = $d020
.label BGCOL = $d021
//SEG2 @begin
//SEG3 [1] phi from @begin to @2 [phi:@begin->@2]
//SEG4 @2
//SEG3 [1] phi from @begin to @5 [phi:@begin->@5]
//SEG4 @5
//SEG5 [2] call main [ ] ( )
jsr main
//SEG6 [3] phi from @2 to @end [phi:@2->@end]
//SEG6 [3] phi from @5 to @end [phi:@5->@end]
//SEG7 @end
//SEG8 main
main: {

View File

@ -1,4 +1,4 @@
(label) @2
(label) @5
(label) @begin
(label) @end
(byte*) BGCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@3
@3: scope:[] from @begin
to:@6
@6: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
[3] phi() [ ] ( )
main: scope:[main] from @3
main: scope:[main] from @6
[4] phi() [ ] ( main:2 [ ] )
[5] call init [ ] ( main:2 [ ] )
to:main::@2

View File

@ -168,6 +168,24 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Adding pre/post-modifier (byte*) init::sc ← ++ (byte*) init::sc
SYMBOLS
(byte*~) $0
@ -175,6 +193,9 @@ SYMBOLS
(label) @1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @6
(label) @begin
(label) @end
(byte*) BGCOL
@ -293,6 +314,34 @@ SYMBOLS
(label) main::@3
(label) main::@4
(label) main::@return
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
(signed word) xpos
(signed word) xvel
(signed word) ypos
@ -404,11 +453,56 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte*) SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024
(byte*~) $0 ← (byte*) SCREEN + (word/signed word/dword/signed dword) 1016
(byte*) SPRITES_PTR ← (byte*~) $0
(byte*) SPRITE ← ((byte*)) (word/signed word/dword/signed dword) 8192
to:@1
to:@4
main: scope:[main] from
(void~) main::$0 ← call init
to:main::@1
@ -427,8 +521,8 @@ main::@4: scope:[main] from main::@3
main::@return: scope:[main] from main::@4
return
to:@return
@1: scope:[] from @begin
to:@2
@4: scope:[] from @3
to:@5
init: scope:[init] from
*((byte*) SPRITES_ENABLE) ← (byte/signed byte/word/signed word/dword/signed dword) 1
*((byte*) SPRITES_EXPAND_X) ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -462,7 +556,7 @@ init::@4: scope:[init] from init::@2
init::@return: scope:[init] from init::@4
return
to:@return
@2: scope:[] from @1
@5: scope:[] from @4
(signed word) xpos ← (byte/signed byte/word/signed word/dword/signed dword) 0
(signed word) ypos ← (byte/signed byte/word/signed word/dword/signed dword) 0
(signed word) yvel_init ← (byte/signed byte/word/signed word/dword/signed dword) 100
@ -470,7 +564,7 @@ init::@return: scope:[init] from init::@4
(signed word) yvel ← (signed word) yvel_init
(signed byte/signed word/signed dword~) $1 ← - (byte/signed byte/word/signed word/dword/signed dword) 5
(signed word) g ← (signed byte/signed word/signed dword~) $1
to:@3
to:@6
anim: scope:[anim] from
(bool~) anim::$0 ← (signed word) ypos < (byte/signed byte/word/signed word/dword/signed dword) 0
(bool~) anim::$1 ← ! (bool~) anim::$0
@ -517,11 +611,15 @@ anim::@4: scope:[anim] from anim::@3
anim::@return: scope:[anim] from anim::@1
return
to:@return
@3: scope:[] from @2
@6: scope:[] from @5
call main
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Eliminating unused variable (byte*) PROCPORT_DDR and assignment [0] (byte*) PROCPORT_DDR ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 0
Eliminating unused variable (byte) PROCPORT_DDR_MEMORY_MASK and assignment [1] (byte) PROCPORT_DDR_MEMORY_MASK ← (byte/signed byte/word/signed word/dword/signed dword) 7
Eliminating unused variable (byte*) PROCPORT and assignment [2] (byte*) PROCPORT ← ((byte*)) (byte/signed byte/word/signed word/dword/signed dword) 1
@ -580,8 +678,10 @@ Eliminating unused variable (byte) LIGHT_BLUE and assignment [63] (byte) LIGHT_B
Eliminating unused variable (byte) LIGHT_GREY and assignment [64] (byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
Eliminating unused variable - keeping the call (void~) main::$0
Eliminating unused variable - keeping the call (void~) main::$2
Removing empty block main::@4
Removing empty block @1
Removing empty block @2
Removing empty block main::@4
Removing empty block @4
Removing empty block init::@4
PROCEDURE MODIFY VARIABLE ANALYSIS
main modifies yvel
@ -612,17 +712,19 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) SPRITES_EXPAND_X#0 ← ((byte*)) (word/dword/signed dword) 53277
(byte*) SPRITES_COLS#0 ← ((byte*)) (word/dword/signed dword) 53287
(byte) WHITE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1
to:@3
@3: scope:[] from @begin
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
(byte*~) $0 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) 1016
(byte*) SPRITES_PTR#0 ← (byte*~) $0
(byte*) SPRITE#0 ← ((byte*)) (word/signed word/dword/signed dword) 8192
to:@2
main: scope:[main] from @3
(signed word) yvel_init#20 ← phi( @3/(signed word) yvel_init#16 )
(signed word) xvel#20 ← phi( @3/(signed word) xvel#15 )
(signed word) ypos#20 ← phi( @3/(signed word) ypos#15 )
(signed word) xpos#20 ← phi( @3/(signed word) xpos#15 )
(signed word) yvel#18 ← phi( @3/(signed word) yvel#14 )
to:@5
main: scope:[main] from @6
(signed word) yvel_init#20 ← phi( @6/(signed word) yvel_init#16 )
(signed word) xvel#20 ← phi( @6/(signed word) xvel#15 )
(signed word) ypos#20 ← phi( @6/(signed word) ypos#15 )
(signed word) xpos#20 ← phi( @6/(signed word) xpos#15 )
(signed word) yvel#18 ← phi( @6/(signed word) yvel#14 )
call init
to:main::@5
main::@5: scope:[main] from main
@ -715,7 +817,7 @@ init::@2: scope:[init] from init::@2 init::@3
init::@return: scope:[init] from init::@2
return
to:@return
@2: scope:[] from @begin
@5: scope:[] from @3
(signed word) xpos#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(signed word) ypos#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(signed word) yvel_init#2 ← (byte/signed byte/word/signed word/dword/signed dword) 100
@ -723,7 +825,7 @@ init::@return: scope:[init] from init::@2
(signed word) yvel#2 ← (signed word) yvel_init#2
(signed byte/signed word/signed dword~) $1 ← - (byte/signed byte/word/signed word/dword/signed dword) 5
(signed word) g#0 ← (signed byte/signed word/signed dword~) $1
to:@3
to:@6
anim: scope:[anim] from main::@3
(signed word) yvel_init#14 ← phi( main::@3/(signed word) yvel_init#13 )
(signed word) xvel#13 ← phi( main::@3/(signed word) xvel#12 )
@ -799,34 +901,35 @@ anim::@return: scope:[anim] from anim::@1
(signed word) yvel_init#5 ← (signed word) yvel_init#11
return
to:@return
@3: scope:[] from @2
(signed word) yvel_init#16 ← phi( @2/(signed word) yvel_init#2 )
(signed word) xvel#15 ← phi( @2/(signed word) xvel#2 )
(signed word) ypos#15 ← phi( @2/(signed word) ypos#2 )
(signed word) xpos#15 ← phi( @2/(signed word) xpos#2 )
(signed word) yvel#14 ← phi( @2/(signed word) yvel#2 )
@6: scope:[] from @5
(signed word) yvel_init#16 ← phi( @5/(signed word) yvel_init#2 )
(signed word) xvel#15 ← phi( @5/(signed word) xvel#2 )
(signed word) ypos#15 ← phi( @5/(signed word) ypos#2 )
(signed word) xpos#15 ← phi( @5/(signed word) xpos#2 )
(signed word) yvel#14 ← phi( @5/(signed word) yvel#2 )
call main
to:@4
@4: scope:[] from @3
(signed word) yvel_init#12 ← phi( @3/(signed word) yvel_init#1 )
(signed word) xvel#11 ← phi( @3/(signed word) xvel#1 )
(signed word) ypos#12 ← phi( @3/(signed word) ypos#1 )
(signed word) xpos#11 ← phi( @3/(signed word) xpos#1 )
(signed word) yvel#11 ← phi( @3/(signed word) yvel#1 )
to:@7
@7: scope:[] from @6
(signed word) yvel_init#12 ← phi( @6/(signed word) yvel_init#1 )
(signed word) xvel#11 ← phi( @6/(signed word) xvel#1 )
(signed word) ypos#12 ← phi( @6/(signed word) ypos#1 )
(signed word) xpos#11 ← phi( @6/(signed word) xpos#1 )
(signed word) yvel#11 ← phi( @6/(signed word) yvel#1 )
(signed word) yvel#6 ← (signed word) yvel#11
(signed word) xpos#6 ← (signed word) xpos#11
(signed word) ypos#6 ← (signed word) ypos#12
(signed word) xvel#5 ← (signed word) xvel#11
(signed word) yvel_init#6 ← (signed word) yvel_init#12
to:@end
@end: scope:[] from @4
@end: scope:[] from @7
SYMBOL TABLE SSA
(byte*~) $0
(signed byte/signed word/signed dword~) $1
(label) @2
(label) @3
(label) @4
(label) @5
(label) @6
(label) @7
(label) @begin
(label) @end
(byte*) RASTER
@ -1202,13 +1305,14 @@ if() condition always true - replacing block destination if(true) goto main::@1
Succesful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) @3
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@1
Culled Empty Block (label) main::@6
Culled Empty Block (label) init::@3
Culled Empty Block (label) @2
Culled Empty Block (label) @5
Not culling empty block because it shares successor with its predecessor. (label) anim::@4
Culled Empty Block (label) @4
Culled Empty Block (label) @7
Succesful SSA optimization Pass2CullEmptyBlocks
Not culling empty block because it shares successor with its predecessor. (label) anim::@4
Not aliassing across scopes: yvel#12 yvel#10
@ -1273,14 +1377,14 @@ Constant inlined xpos#14 = (byte/signed byte/word/signed word/dword/signed dword
Constant inlined yvel_init#4 = (byte/word/signed word/dword/signed dword) 200
Constant inlined init::sc#0 = (const byte*) SCREEN#0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @3 @end main main::@2 main::@3 anim anim::@3 anim::@4 anim::@2 anim::@1 anim::@return init init::@1 init::@2 init::@return
Block Sequence Planned @begin @6 @end main main::@2 main::@3 anim anim::@3 anim::@4 anim::@2 anim::@1 anim::@return init init::@1 init::@2 init::@return
Added new block during phi lifting anim::@5(between anim::@3 and anim::@2)
Added new block during phi lifting anim::@6(between anim and anim::@1)
Added new block during phi lifting init::@5(between init::@1 and init::@1)
Added new block during phi lifting init::@6(between init::@2 and init::@2)
Block Sequence Planned @begin @3 @end main main::@2 main::@3 anim anim::@3 anim::@4 anim::@2 anim::@1 anim::@return anim::@5 anim::@6 init init::@1 init::@2 init::@return init::@6 init::@5
Block Sequence Planned @begin @6 @end main main::@2 main::@3 anim anim::@3 anim::@4 anim::@2 anim::@1 anim::@return anim::@5 anim::@6 init init::@1 init::@2 init::@return init::@6 init::@5
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @6
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
@ -1332,9 +1436,9 @@ Not culling empty block because it shares successor with its predecessor. (label
Culled Empty Block (label) anim::@6
Culled Empty Block (label) init::@6
Culled Empty Block (label) init::@5
Block Sequence Planned @begin @3 @end main main::@2 main::@3 anim anim::@3 anim::@2 anim::@1 anim::@return anim::@5 init init::@1 init::@2 init::@return
Block Sequence Planned @begin @6 @end main main::@2 main::@3 anim anim::@3 anim::@2 anim::@1 anim::@return anim::@5 init init::@1 init::@2 init::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @6
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
@ -1358,14 +1462,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@3
@3: scope:[] from @begin
to:@6
@6: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @3
@end: scope:[] from @6
[3] phi() [ ] ( )
main: scope:[main] from @3
main: scope:[main] from @6
[4] phi() [ ] ( main:2 [ ] )
[5] call init [ ] ( main:2 [ ] )
to:main::@2
@ -1446,21 +1550,21 @@ init::@return: scope:[init] from init::@2
DOMINATORS
@begin dominated by @begin
@3 dominated by @begin @3
@end dominated by @begin @end @3
main dominated by @begin main @3
main::@2 dominated by @begin main @3 main::@2
main::@3 dominated by @begin main @3 main::@2 main::@3
anim dominated by @begin main @3 main::@2 anim main::@3
anim::@3 dominated by @begin anim::@3 main @3 main::@2 anim main::@3
anim::@2 dominated by @begin anim::@3 anim::@2 main @3 main::@2 anim main::@3
anim::@1 dominated by @begin anim::@1 main @3 main::@2 anim main::@3
anim::@return dominated by @begin anim::@1 main anim::@return @3 main::@2 anim main::@3
anim::@5 dominated by anim::@5 @begin anim::@3 main @3 main::@2 anim main::@3
init dominated by init @begin main @3
init::@1 dominated by init @begin main init::@1 @3
init::@2 dominated by init @begin main init::@2 init::@1 @3
init::@return dominated by init @begin init::@return main init::@2 init::@1 @3
@6 dominated by @begin @6
@end dominated by @begin @end @6
main dominated by @begin main @6
main::@2 dominated by @begin main @6 main::@2
main::@3 dominated by @begin main @6 main::@2 main::@3
anim dominated by @begin main @6 main::@2 anim main::@3
anim::@3 dominated by @begin anim::@3 main @6 main::@2 anim main::@3
anim::@2 dominated by @begin anim::@3 anim::@2 main @6 main::@2 anim main::@3
anim::@1 dominated by @begin anim::@1 main @6 main::@2 anim main::@3
anim::@return dominated by @begin anim::@1 main anim::@return @6 main::@2 anim main::@3
anim::@5 dominated by anim::@5 @begin anim::@3 main @6 main::@2 anim main::@3
init dominated by init @begin main @6
init::@1 dominated by init @begin main init::@1 @6
init::@2 dominated by init @begin main init::@2 init::@1 @6
init::@return dominated by init @begin init::@return main init::@2 init::@1 @6
NATURAL LOOPS
Found back edge: Loop head: main::@2 tails: main::@2 blocks: null
@ -1621,17 +1725,17 @@ INITIAL ASM
.label yvel_22 = 6
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
b3_from_bbegin:
jmp b3
//SEG4 @3
b3:
//SEG3 [1] phi from @begin to @6 [phi:@begin->@6]
b6_from_bbegin:
jmp b6
//SEG4 @6
b6:
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
main_from_b3:
//SEG6 [4] phi from @6 to main [phi:@6->main]
main_from_b6:
jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
bend_from_b3:
//SEG7 [3] phi from @6 to @end [phi:@6->@end]
bend_from_b6:
jmp bend
//SEG8 @end
bend:
@ -2081,17 +2185,17 @@ ASSEMBLER BEFORE OPTIMIZATION
.label yvel_22 = 6
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
b3_from_bbegin:
jmp b3
//SEG4 @3
b3:
//SEG3 [1] phi from @begin to @6 [phi:@begin->@6]
b6_from_bbegin:
jmp b6
//SEG4 @6
b6:
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
main_from_b3:
//SEG6 [4] phi from @6 to main [phi:@6->main]
main_from_b6:
jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
bend_from_b3:
//SEG7 [3] phi from @6 to @end [phi:@6->@end]
bend_from_b6:
jmp bend
//SEG8 @end
bend:
@ -2414,7 +2518,7 @@ init: {
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b3
Removing instruction jmp b6
Removing instruction jmp bend
Removing instruction jmp b2
Removing instruction jmp b3
@ -2443,9 +2547,9 @@ Replacing label b1_from_b1 with b1
Replacing label b1_from_b1 with b1
Replacing label b2_from_b2 with b2
Removing instruction bbegin:
Removing instruction b3_from_bbegin:
Removing instruction main_from_b3:
Removing instruction bend_from_b3:
Removing instruction b6_from_bbegin:
Removing instruction main_from_b6:
Removing instruction bend_from_b6:
Removing instruction b2_from_b2:
Removing instruction b3_from_b2:
Removing instruction b1_from_anim:
@ -2454,7 +2558,7 @@ Removing instruction b2_from_b5:
Removing instruction b1_from_b1:
Removing instruction b2_from_b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b3:
Removing instruction b6:
Removing instruction bend:
Removing instruction b2_from_main:
Removing instruction b3:
@ -2480,7 +2584,7 @@ Removing unreachable instruction jmp b2
Succesful ASM optimization Pass5UnreachableCodeElimination
FINAL SYMBOL TABLE
(label) @3
(label) @6
(label) @begin
(label) @end
(byte*) RASTER
@ -2604,12 +2708,12 @@ Score: 6623
.label yvel_12 = 6
.label yvel_22 = 6
//SEG2 @begin
//SEG3 [1] phi from @begin to @3 [phi:@begin->@3]
//SEG4 @3
//SEG3 [1] phi from @begin to @6 [phi:@begin->@6]
//SEG4 @6
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @3 to main [phi:@3->main]
//SEG6 [4] phi from @6 to main [phi:@6->main]
jsr main
//SEG7 [3] phi from @3 to @end [phi:@3->@end]
//SEG7 [3] phi from @6 to @end [phi:@6->@end]
//SEG8 @end
//SEG9 main
main: {

View File

@ -1,4 +1,4 @@
(label) @3
(label) @6
(label) @begin
(label) @end
(byte*) RASTER

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@51
@51: scope:[] from @begin
to:@54
@54: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @51
@end: scope:[] from @54
[3] phi() [ ] ( )
main: scope:[main] from @51
main: scope:[main] from @54
[4] phi() [ ] ( main:2 [ ] )
[5] call init [ ] ( main:2 [ ] )
to:main::@2

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
(label) @51
(label) @54
(label) @begin
(label) @end
(byte*) BORDERCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@8
@8: scope:[] from @begin
to:@11
@11: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @8
@end: scope:[] from @11
[3] phi() [ ] ( )
main: scope:[main] from @8
main: scope:[main] from @11
[4] phi() [ ] ( main:2 [ ] )
[5] call keyboard_init [ ] ( main:2 [ ] )
to:main::@4

View File

@ -345,6 +345,24 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Adding pre/post-modifier (byte) keyboard_events_size ← ++ (byte) keyboard_events_size
Adding pre/post-modifier (byte) keyboard_events_size ← ++ (byte) keyboard_events_size
Adding pre/post-modifier (byte) keyboard_event_scan::keycode ← ++ (byte) keyboard_event_scan::keycode
@ -352,6 +370,8 @@ Adding pre/post-modifier (byte) keyboard_events_size ← -- (byte) keyboard_even
SYMBOLS
(byte~) $0
(label) @1
(label) @10
(label) @11
(label) @2
(label) @3
(label) @4
@ -359,6 +379,7 @@ SYMBOLS
(label) @6
(label) @7
(label) @8
(label) @9
(label) @begin
(label) @end
(byte*) BGCOL
@ -625,6 +646,34 @@ SYMBOLS
(label) main::@8
(label) main::@9
(label) main::@return
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -729,6 +778,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte) KEY_DEL ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) KEY_RETURN ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) KEY_CRSR_RIGHT ← (byte/signed byte/word/signed word/dword/signed dword) 2
@ -796,7 +890,7 @@ INITIAL CONTROL FLOW GRAPH
(byte[]) keyboard_char_keycodes ← { (byte) KEY_AT, (byte) KEY_A, (byte) KEY_B, (byte) KEY_C, (byte) KEY_D, (byte) KEY_E, (byte) KEY_F, (byte) KEY_G, (byte) KEY_H, (byte) KEY_I, (byte) KEY_J, (byte) KEY_K, (byte) KEY_L, (byte) KEY_M, (byte) KEY_N, (byte) KEY_O, (byte) KEY_P, (byte) KEY_Q, (byte) KEY_R, (byte) KEY_S, (byte) KEY_T, (byte) KEY_U, (byte) KEY_V, (byte) KEY_W, (byte) KEY_X, (byte) KEY_Y, (byte) KEY_Z, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP, (byte) KEY_ARROW_LEFT, (byte) KEY_SPACE, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK, (byte) KEY_PLUS, (byte) KEY_COMMA, (byte) KEY_MINUS, (byte) KEY_DOT, (byte) KEY_SLASH, (byte) KEY_0, (byte) KEY_1, (byte) KEY_2, (byte) KEY_3, (byte) KEY_4, (byte) KEY_5, (byte) KEY_6, (byte) KEY_7, (byte) KEY_8, (byte) KEY_9, (byte) KEY_COLON, (byte) KEY_SEMICOLON, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 }
(byte[8]) keyboard_matrix_row_bitmask ← { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte[8]) keyboard_matrix_col_bitmask ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
to:@1
to:@4
keyboard_init: scope:[keyboard_init] from
*((byte*) CIA1_PORT_A_DDR) ← (byte/word/signed word/dword/signed dword) 255
*((byte*) CIA1_PORT_B_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -804,8 +898,8 @@ keyboard_init: scope:[keyboard_init] from
keyboard_init::@return: scope:[keyboard_init] from keyboard_init
return
to:@return
@1: scope:[] from @begin
to:@2
@4: scope:[] from @3
to:@5
keyboard_matrix_read: scope:[keyboard_matrix_read] from
*((byte*) CIA1_PORT_A) ← *((byte[8]) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid)
(byte~) keyboard_matrix_read::$0 ← ~ *((byte*) CIA1_PORT_B)
@ -818,8 +912,8 @@ keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matri
to:@return
keyboard_matrix_read::@1: scope:[keyboard_matrix_read] from
to:keyboard_matrix_read::@return
@2: scope:[] from @1
to:@3
@5: scope:[] from @4
to:@6
keyboard_key_pressed: scope:[keyboard_key_pressed] from
(byte~) keyboard_key_pressed::$0 ← (byte) keyboard_key_pressed::key & (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) keyboard_key_pressed::colidx ← (byte~) keyboard_key_pressed::$0
@ -835,8 +929,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
to:@return
keyboard_key_pressed::@1: scope:[keyboard_key_pressed] from
to:keyboard_key_pressed::@return
@3: scope:[] from @2
to:@4
@6: scope:[] from @5
to:@7
keyboard_get_keycode: scope:[keyboard_get_keycode] from
(byte) keyboard_get_keycode::return ← *((byte[]) keyboard_char_keycodes + (byte) keyboard_get_keycode::ch)
to:keyboard_get_keycode::@return
@ -846,7 +940,7 @@ keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_k
to:@return
keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from
to:keyboard_get_keycode::@return
@4: scope:[] from @3
@7: scope:[] from @6
(byte[8]) keyboard_events ← { fill( 8, 0) }
(byte) keyboard_events_size ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) keyboard_modifiers ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -857,7 +951,7 @@ keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from
(byte~) $0 ← (byte) KEY_MODIFIER_LSHIFT | (byte) KEY_MODIFIER_RSHIFT
(byte) KEY_MODIFIER_SHIFT ← (byte~) $0
(byte[8]) keyboard_scan_values ← { fill( 8, 0) }
to:@5
to:@8
keyboard_event_scan: scope:[keyboard_event_scan] from
(byte) keyboard_event_scan::keycode ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) keyboard_event_scan::row ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -970,8 +1064,8 @@ keyboard_event_scan::@24: scope:[keyboard_event_scan] from keyboard_event_scan:
keyboard_event_scan::@return: scope:[keyboard_event_scan] from keyboard_event_scan::@12
return
to:@return
@5: scope:[] from @4
to:@6
@8: scope:[] from @7
to:@9
keyboard_event_pressed: scope:[keyboard_event_pressed] from
(byte~) keyboard_event_pressed::$0 ← (byte) keyboard_event_pressed::keycode >> (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) keyboard_event_pressed::row_bits ← *((byte[8]) keyboard_scan_values + (byte~) keyboard_event_pressed::$0)
@ -985,8 +1079,8 @@ keyboard_event_pressed::@return: scope:[keyboard_event_pressed] from keyboard_e
to:@return
keyboard_event_pressed::@1: scope:[keyboard_event_pressed] from
to:keyboard_event_pressed::@return
@6: scope:[] from @5
to:@7
@9: scope:[] from @8
to:@10
keyboard_event_get: scope:[keyboard_event_get] from
(bool~) keyboard_event_get::$0 ← (byte) keyboard_events_size == (byte/signed byte/word/signed word/dword/signed dword) 0
if((bool~) keyboard_event_get::$0) goto keyboard_event_get::@1
@ -1010,8 +1104,8 @@ keyboard_event_get::@5: scope:[keyboard_event_get] from
to:keyboard_event_get::@1
keyboard_event_get::@6: scope:[keyboard_event_get] from
to:keyboard_event_get::@2
@7: scope:[] from @6
to:@8
@10: scope:[] from @9
to:@11
main: scope:[main] from
(void~) main::$0 ← call keyboard_init
to:main::@1
@ -1050,11 +1144,15 @@ main::@12: scope:[main] from
main::@return: scope:[main] from main::@3
return
to:@return
@8: scope:[] from @7
@11: scope:[] from @10
call main
to:@end
@end: scope:[] from @8
@end: scope:[] from @11
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Removing unused procedure keyboard_get_keycode
Removing unused procedure keyboard_event_scan
Removing unused procedure keyboard_event_get
@ -1192,14 +1290,16 @@ Eliminating unused variable (byte~) $0 and assignment [80] (byte~) $0 ← (byte)
Eliminating unused variable (byte) KEY_MODIFIER_LSHIFT and assignment [29] (byte) KEY_MODIFIER_LSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 1
Eliminating unused variable (byte) KEY_MODIFIER_RSHIFT and assignment [30] (byte) KEY_MODIFIER_RSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 2
Removing empty block @1
Removing empty block keyboard_matrix_read::@1
Removing empty block @2
Removing empty block keyboard_key_pressed::@1
Removing empty block @3
Removing empty block @4
Removing empty block keyboard_matrix_read::@1
Removing empty block @5
Removing empty block keyboard_key_pressed::@1
Removing empty block @6
Removing empty block @7
Removing empty block @8
Removing empty block @9
Removing empty block @10
Removing empty block main::@7
Removing empty block main::@3
Removing empty block main::@8
@ -1220,10 +1320,12 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) CIA1_PORT_B_DDR#0 ← ((byte*)) (word/dword/signed dword) 56323
(byte) GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5
(byte) BLUE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 6
to:@3
@3: scope:[] from @begin
(byte) KEY_SPACE#0 ← (byte/signed byte/word/signed word/dword/signed dword) 60
(byte[8]) keyboard_matrix_row_bitmask#0 ← { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte[8]) keyboard_matrix_col_bitmask#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
to:@8
to:@11
keyboard_init: scope:[keyboard_init] from main
*((byte*) CIA1_PORT_A_DDR#0) ← (byte/word/signed word/dword/signed dword) 255
*((byte*) CIA1_PORT_B_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1265,7 +1367,7 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
(byte) keyboard_key_pressed::return#1 ← (byte) keyboard_key_pressed::return#3
return
to:@return
main: scope:[main] from @8
main: scope:[main] from @11
call keyboard_init
to:main::@13
main::@13: scope:[main] from main
@ -1299,16 +1401,17 @@ main::@10: scope:[main] from main::@14
main::@return: scope:[main] from main::@1
return
to:@return
@8: scope:[] from @begin
@11: scope:[] from @3
call main
to:@9
@9: scope:[] from @8
to:@12
@12: scope:[] from @11
to:@end
@end: scope:[] from @9
@end: scope:[] from @12
SYMBOL TABLE SSA
(label) @8
(label) @9
(label) @11
(label) @12
(label) @3
(label) @begin
(label) @end
(byte*) BGCOL
@ -1387,7 +1490,7 @@ SYMBOL TABLE SSA
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) main::@13
Culled Empty Block (label) main::@2
Culled Empty Block (label) @9
Culled Empty Block (label) @12
Succesful SSA optimization Pass2CullEmptyBlocks
Not aliassing across scopes: keyboard_matrix_read::rowid#1 keyboard_matrix_read::rowid#0
Not aliassing across scopes: keyboard_key_pressed::key#1 keyboard_key_pressed::key#0
@ -1444,6 +1547,7 @@ if() condition always true - replacing block destination if(true) goto main::@4
Succesful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) @3
Culled Empty Block (label) main::@1
Succesful SSA optimization Pass2CullEmptyBlocks
Not aliassing across scopes: keyboard_matrix_read::return#2 keyboard_matrix_read::return#0
@ -1458,10 +1562,10 @@ OPTIMIZING CONTROL FLOW GRAPH
Constant inlined keyboard_key_pressed::key#0 = (const byte) KEY_SPACE#0
Constant inlined keyboard_matrix_read::rowid#0 = (const byte) keyboard_key_pressed::rowidx#0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @8 @end main main::@4 main::@9 main::@14 main::@10 main::@5 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_init keyboard_init::@return
Block Sequence Planned @begin @8 @end main main::@4 main::@9 main::@14 main::@10 main::@5 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_init keyboard_init::@return
Block Sequence Planned @begin @11 @end main main::@4 main::@9 main::@14 main::@10 main::@5 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_init keyboard_init::@return
Block Sequence Planned @begin @11 @end main main::@4 main::@9 main::@14 main::@10 main::@5 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_init keyboard_init::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @8
Adding NOP phi() at start of @11
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@9
@ -1476,9 +1580,9 @@ Propagating live ranges...
Propagating live ranges...
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Block Sequence Planned @begin @8 @end main main::@4 main::@9 main::@14 main::@10 main::@5 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_init keyboard_init::@return
Block Sequence Planned @begin @11 @end main main::@4 main::@9 main::@14 main::@10 main::@5 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_init keyboard_init::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @8
Adding NOP phi() at start of @11
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@9
@ -1490,14 +1594,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@8
@8: scope:[] from @begin
to:@11
@11: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @8
@end: scope:[] from @11
[3] phi() [ ] ( )
main: scope:[main] from @8
main: scope:[main] from @11
[4] phi() [ ] ( main:2 [ ] )
[5] call keyboard_init [ ] ( main:2 [ ] )
to:main::@4
@ -1548,21 +1652,21 @@ keyboard_init::@return: scope:[keyboard_init] from keyboard_init
DOMINATORS
@begin dominated by @begin
@8 dominated by @begin @8
@end dominated by @begin @end @8
main dominated by @begin main @8
main::@4 dominated by @begin main @8 main::@4
main::@9 dominated by main::@9 @begin main @8 main::@4
main::@14 dominated by main::@9 @begin main main::@14 @8 main::@4
main::@10 dominated by main::@9 @begin main::@10 main main::@14 @8 main::@4
main::@5 dominated by main::@9 @begin main main::@14 @8 main::@5 main::@4
keyboard_key_pressed dominated by main::@9 @begin main keyboard_key_pressed @8 main::@4
keyboard_key_pressed::@2 dominated by main::@9 @begin main keyboard_key_pressed @8 keyboard_key_pressed::@2 main::@4
keyboard_key_pressed::@return dominated by main::@9 @begin main keyboard_key_pressed keyboard_key_pressed::@return @8 keyboard_key_pressed::@2 main::@4
keyboard_matrix_read dominated by main::@9 @begin keyboard_matrix_read main keyboard_key_pressed @8 main::@4
keyboard_matrix_read::@return dominated by main::@9 @begin keyboard_matrix_read main keyboard_matrix_read::@return keyboard_key_pressed @8 main::@4
keyboard_init dominated by @begin main keyboard_init @8
keyboard_init::@return dominated by @begin main keyboard_init @8 keyboard_init::@return
@11 dominated by @11 @begin
@end dominated by @11 @begin @end
main dominated by @11 @begin main
main::@4 dominated by @11 @begin main main::@4
main::@9 dominated by @11 main::@9 @begin main main::@4
main::@14 dominated by @11 main::@9 @begin main main::@14 main::@4
main::@10 dominated by @11 main::@9 @begin main::@10 main main::@14 main::@4
main::@5 dominated by @11 main::@9 @begin main main::@14 main::@5 main::@4
keyboard_key_pressed dominated by @11 main::@9 @begin main keyboard_key_pressed main::@4
keyboard_key_pressed::@2 dominated by @11 main::@9 @begin main keyboard_key_pressed keyboard_key_pressed::@2 main::@4
keyboard_key_pressed::@return dominated by @11 main::@9 @begin main keyboard_key_pressed keyboard_key_pressed::@return keyboard_key_pressed::@2 main::@4
keyboard_matrix_read dominated by @11 main::@9 @begin keyboard_matrix_read main keyboard_key_pressed main::@4
keyboard_matrix_read::@return dominated by @11 main::@9 @begin keyboard_matrix_read main keyboard_matrix_read::@return keyboard_key_pressed main::@4
keyboard_init dominated by @11 @begin main keyboard_init
keyboard_init::@return dominated by @11 @begin main keyboard_init keyboard_init::@return
NATURAL LOOPS
Found back edge: Loop head: main::@4 tails: main::@4 blocks: null
@ -1655,17 +1759,17 @@ INITIAL ASM
.const KEY_SPACE = $3c
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
b8_from_bbegin:
jmp b8
//SEG4 @8
b8:
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
b11_from_bbegin:
jmp b11
//SEG4 @11
b11:
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @8 to main [phi:@8->main]
main_from_b8:
//SEG6 [4] phi from @11 to main [phi:@11->main]
main_from_b11:
jsr main
//SEG7 [3] phi from @8 to @end [phi:@8->@end]
bend_from_b8:
//SEG7 [3] phi from @11 to @end [phi:@11->@end]
bend_from_b11:
jmp bend
//SEG8 @end
bend:
@ -1824,17 +1928,17 @@ ASSEMBLER BEFORE OPTIMIZATION
.const KEY_SPACE = $3c
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
b8_from_bbegin:
jmp b8
//SEG4 @8
b8:
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
b11_from_bbegin:
jmp b11
//SEG4 @11
b11:
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @8 to main [phi:@8->main]
main_from_b8:
//SEG6 [4] phi from @11 to main [phi:@11->main]
main_from_b11:
jsr main
//SEG7 [3] phi from @8 to @end [phi:@8->@end]
bend_from_b8:
//SEG7 [3] phi from @11 to @end [phi:@11->@end]
bend_from_b11:
jmp bend
//SEG8 @end
bend:
@ -1935,7 +2039,7 @@ keyboard_init: {
keyboard_matrix_col_bitmask: .byte 1, 2, 4, 8, $10, $20, $40, $80
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b8
Removing instruction jmp b11
Removing instruction jmp bend
Removing instruction jmp b4
Removing instruction jmp b9
@ -1947,13 +2051,13 @@ Removing instruction jmp breturn
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Removing instruction b8_from_bbegin:
Removing instruction main_from_b8:
Removing instruction bend_from_b8:
Removing instruction b11_from_bbegin:
Removing instruction main_from_b11:
Removing instruction bend_from_b11:
Removing instruction b9_from_b4:
Removing instruction keyboard_key_pressed_from_b9:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b8:
Removing instruction b11:
Removing instruction bend:
Removing instruction b9:
Removing instruction b14:
@ -1965,7 +2069,7 @@ Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @8
(label) @11
(label) @begin
(label) @end
(byte*) BGCOL
@ -2045,12 +2149,12 @@ Score: 1147
.const BLUE = 6
.const KEY_SPACE = $3c
//SEG2 @begin
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
//SEG4 @8
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
//SEG4 @11
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @8 to main [phi:@8->main]
//SEG6 [4] phi from @11 to main [phi:@11->main]
jsr main
//SEG7 [3] phi from @8 to @end [phi:@8->@end]
//SEG7 [3] phi from @11 to @end [phi:@11->@end]
//SEG8 @end
//SEG9 main
main: {

View File

@ -1,4 +1,4 @@
(label) @8
(label) @11
(label) @begin
(label) @end
(byte*) BGCOL

View File

@ -1,13 +1,13 @@
@begin: scope:[] from
[0] phi() [ ] ( )
to:@8
@8: scope:[] from @begin
to:@11
@11: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @8
@end: scope:[] from @11
[3] phi() [ ] ( )
main: scope:[main] from @8
main: scope:[main] from @11
[4] phi() [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main main::@1

View File

@ -376,6 +376,24 @@ const byte LIGHT_GREEN = $d;
const byte LIGHT_BLUE = $e;
const byte LIGHT_GREY = $f;
// Get the value to store into D018 to display a specific screen and charset/bitmap
// Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400));
inline byte toD018(byte* screen, byte* gfx) {
return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f);
}
// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
// Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000)
inline byte toDd00(byte* gfx) {
return %00000011 ^ (>((word)gfx))>>6;
}
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(byte* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
}
Adding pre/post-modifier (byte) keyboard_events_size ← ++ (byte) keyboard_events_size
Adding pre/post-modifier (byte) keyboard_events_size ← ++ (byte) keyboard_events_size
Adding pre/post-modifier (byte) keyboard_event_scan::keycode ← ++ (byte) keyboard_event_scan::keycode
@ -386,6 +404,8 @@ Adding pre/post-modifier (byte) main::i ← ++ (byte) main::i
SYMBOLS
(byte~) $0
(label) @1
(label) @10
(label) @11
(label) @2
(label) @3
(label) @4
@ -393,6 +413,7 @@ SYMBOLS
(label) @6
(label) @7
(label) @8
(label) @9
(label) @begin
(label) @end
(byte*) BGCOL
@ -697,6 +718,34 @@ SYMBOLS
(byte) main::row_pressed_bits
(byte*) main::sc
(byte*) main::screen
inline (byte()) toD018((byte*) toD018::screen , (byte*) toD018::gfx)
(word~) toD018::$0
(word~) toD018::$1
(word~) toD018::$2
(byte~) toD018::$3
(word~) toD018::$4
(byte~) toD018::$5
(byte~) toD018::$6
(byte~) toD018::$7
(byte~) toD018::$8
(label) toD018::@1
(label) toD018::@return
(byte*) toD018::gfx
(byte) toD018::return
(byte*) toD018::screen
inline (byte()) toDd00((byte*) toDd00::gfx)
(word~) toDd00::$0
(byte~) toDd00::$1
(byte~) toDd00::$2
(byte/word/dword~) toDd00::$3
(label) toDd00::@1
(label) toDd00::@return
(byte*) toDd00::gfx
(byte) toDd00::return
inline (void()) vicSelectGfxBank((byte*) vicSelectGfxBank::gfx)
(byte~) vicSelectGfxBank::$0
(label) vicSelectGfxBank::@return
(byte*) vicSelectGfxBank::gfx
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT_DDR ← ((byte*)) 0
Promoting byte/signed byte/word/signed word/dword/signed dword to byte* in PROCPORT ← ((byte*)) 1
@ -803,6 +852,51 @@ INITIAL CONTROL FLOW GRAPH
(byte) LIGHT_GREEN ← (byte/signed byte/word/signed word/dword/signed dword) 13
(byte) LIGHT_BLUE ← (byte/signed byte/word/signed word/dword/signed dword) 14
(byte) LIGHT_GREY ← (byte/signed byte/word/signed word/dword/signed dword) 15
to:@1
toD018: scope:[toD018] from
(word~) toD018::$0 ← ((word)) (byte*) toD018::screen
(word~) toD018::$1 ← (word~) toD018::$0 & (word/signed word/dword/signed dword) 16383
(word~) toD018::$2 ← (word~) toD018::$1 << (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$3 ← > (word~) toD018::$2
(word~) toD018::$4 ← ((word)) (byte*) toD018::gfx
(byte~) toD018::$5 ← > (word~) toD018::$4
(byte~) toD018::$6 ← (byte~) toD018::$5 >> (byte/signed byte/word/signed word/dword/signed dword) 2
(byte~) toD018::$7 ← (byte~) toD018::$6 & (byte/signed byte/word/signed word/dword/signed dword) 15
(byte~) toD018::$8 ← (byte~) toD018::$3 | (byte~) toD018::$7
(byte) toD018::return ← (byte~) toD018::$8
to:toD018::@return
toD018::@return: scope:[toD018] from toD018 toD018::@1
(byte) toD018::return ← (byte) toD018::return
return (byte) toD018::return
to:@return
toD018::@1: scope:[toD018] from
to:toD018::@return
@1: scope:[] from @begin
to:@2
toDd00: scope:[toDd00] from
(word~) toDd00::$0 ← ((word)) (byte*) toDd00::gfx
(byte~) toDd00::$1 ← > (word~) toDd00::$0
(byte~) toDd00::$2 ← (byte~) toDd00::$1 >> (byte/signed byte/word/signed word/dword/signed dword) 6
(byte/word/dword~) toDd00::$3 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte~) toDd00::$2
(byte) toDd00::return ← (byte/word/dword~) toDd00::$3
to:toDd00::@return
toDd00::@return: scope:[toDd00] from toDd00 toDd00::@1
(byte) toDd00::return ← (byte) toDd00::return
return (byte) toDd00::return
to:@return
toDd00::@1: scope:[toDd00] from
to:toDd00::@return
@2: scope:[] from @1
to:@3
vicSelectGfxBank: scope:[vicSelectGfxBank] from
*((byte*) CIA2_PORT_A_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 3
(byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
*((byte*) CIA2_PORT_A) ← (byte~) vicSelectGfxBank::$0
to:vicSelectGfxBank::@return
vicSelectGfxBank::@return: scope:[vicSelectGfxBank] from vicSelectGfxBank
return
to:@return
@3: scope:[] from @2
(byte) KEY_DEL ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) KEY_RETURN ← (byte/signed byte/word/signed word/dword/signed dword) 1
(byte) KEY_CRSR_RIGHT ← (byte/signed byte/word/signed word/dword/signed dword) 2
@ -870,7 +964,7 @@ INITIAL CONTROL FLOW GRAPH
(byte[]) keyboard_char_keycodes ← { (byte) KEY_AT, (byte) KEY_A, (byte) KEY_B, (byte) KEY_C, (byte) KEY_D, (byte) KEY_E, (byte) KEY_F, (byte) KEY_G, (byte) KEY_H, (byte) KEY_I, (byte) KEY_J, (byte) KEY_K, (byte) KEY_L, (byte) KEY_M, (byte) KEY_N, (byte) KEY_O, (byte) KEY_P, (byte) KEY_Q, (byte) KEY_R, (byte) KEY_S, (byte) KEY_T, (byte) KEY_U, (byte) KEY_V, (byte) KEY_W, (byte) KEY_X, (byte) KEY_Y, (byte) KEY_Z, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP, (byte) KEY_ARROW_LEFT, (byte) KEY_SPACE, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK, (byte) KEY_PLUS, (byte) KEY_COMMA, (byte) KEY_MINUS, (byte) KEY_DOT, (byte) KEY_SLASH, (byte) KEY_0, (byte) KEY_1, (byte) KEY_2, (byte) KEY_3, (byte) KEY_4, (byte) KEY_5, (byte) KEY_6, (byte) KEY_7, (byte) KEY_8, (byte) KEY_9, (byte) KEY_COLON, (byte) KEY_SEMICOLON, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 }
(byte[8]) keyboard_matrix_row_bitmask ← { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte[8]) keyboard_matrix_col_bitmask ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
to:@1
to:@4
keyboard_init: scope:[keyboard_init] from
*((byte*) CIA1_PORT_A_DDR) ← (byte/word/signed word/dword/signed dword) 255
*((byte*) CIA1_PORT_B_DDR) ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -878,8 +972,8 @@ keyboard_init: scope:[keyboard_init] from
keyboard_init::@return: scope:[keyboard_init] from keyboard_init
return
to:@return
@1: scope:[] from @begin
to:@2
@4: scope:[] from @3
to:@5
keyboard_matrix_read: scope:[keyboard_matrix_read] from
*((byte*) CIA1_PORT_A) ← *((byte[8]) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid)
(byte~) keyboard_matrix_read::$0 ← ~ *((byte*) CIA1_PORT_B)
@ -892,8 +986,8 @@ keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matri
to:@return
keyboard_matrix_read::@1: scope:[keyboard_matrix_read] from
to:keyboard_matrix_read::@return
@2: scope:[] from @1
to:@3
@5: scope:[] from @4
to:@6
keyboard_key_pressed: scope:[keyboard_key_pressed] from
(byte~) keyboard_key_pressed::$0 ← (byte) keyboard_key_pressed::key & (byte/signed byte/word/signed word/dword/signed dword) 7
(byte) keyboard_key_pressed::colidx ← (byte~) keyboard_key_pressed::$0
@ -909,8 +1003,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
to:@return
keyboard_key_pressed::@1: scope:[keyboard_key_pressed] from
to:keyboard_key_pressed::@return
@3: scope:[] from @2
to:@4
@6: scope:[] from @5
to:@7
keyboard_get_keycode: scope:[keyboard_get_keycode] from
(byte) keyboard_get_keycode::return ← *((byte[]) keyboard_char_keycodes + (byte) keyboard_get_keycode::ch)
to:keyboard_get_keycode::@return
@ -920,7 +1014,7 @@ keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_k
to:@return
keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from
to:keyboard_get_keycode::@return
@4: scope:[] from @3
@7: scope:[] from @6
(byte[8]) keyboard_events ← { fill( 8, 0) }
(byte) keyboard_events_size ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) keyboard_modifiers ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -931,7 +1025,7 @@ keyboard_get_keycode::@1: scope:[keyboard_get_keycode] from
(byte~) $0 ← (byte) KEY_MODIFIER_LSHIFT | (byte) KEY_MODIFIER_RSHIFT
(byte) KEY_MODIFIER_SHIFT ← (byte~) $0
(byte[8]) keyboard_scan_values ← { fill( 8, 0) }
to:@5
to:@8
keyboard_event_scan: scope:[keyboard_event_scan] from
(byte) keyboard_event_scan::keycode ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) keyboard_event_scan::row ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1044,8 +1138,8 @@ keyboard_event_scan::@24: scope:[keyboard_event_scan] from keyboard_event_scan:
keyboard_event_scan::@return: scope:[keyboard_event_scan] from keyboard_event_scan::@12
return
to:@return
@5: scope:[] from @4
to:@6
@8: scope:[] from @7
to:@9
keyboard_event_pressed: scope:[keyboard_event_pressed] from
(byte~) keyboard_event_pressed::$0 ← (byte) keyboard_event_pressed::keycode >> (byte/signed byte/word/signed word/dword/signed dword) 3
(byte) keyboard_event_pressed::row_bits ← *((byte[8]) keyboard_scan_values + (byte~) keyboard_event_pressed::$0)
@ -1059,8 +1153,8 @@ keyboard_event_pressed::@return: scope:[keyboard_event_pressed] from keyboard_e
to:@return
keyboard_event_pressed::@1: scope:[keyboard_event_pressed] from
to:keyboard_event_pressed::@return
@6: scope:[] from @5
to:@7
@9: scope:[] from @8
to:@10
keyboard_event_get: scope:[keyboard_event_get] from
(bool~) keyboard_event_get::$0 ← (byte) keyboard_events_size == (byte/signed byte/word/signed word/dword/signed dword) 0
if((bool~) keyboard_event_get::$0) goto keyboard_event_get::@1
@ -1084,8 +1178,8 @@ keyboard_event_get::@5: scope:[keyboard_event_get] from
to:keyboard_event_get::@1
keyboard_event_get::@6: scope:[keyboard_event_get] from
to:keyboard_event_get::@2
@7: scope:[] from @6
to:@8
@10: scope:[] from @9
to:@11
main: scope:[main] from
(byte*) main::sc ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:main::@1
@ -1195,11 +1289,15 @@ main::@26: scope:[main] from
main::@return: scope:[main] from main::@4
return
to:@return
@8: scope:[] from @7
@11: scope:[] from @10
call main
to:@end
@end: scope:[] from @8
@end: scope:[] from @11
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Removing unused procedure toD018
Removing unused procedure toDd00
Removing unused procedure vicSelectGfxBank
Removing unused procedure keyboard_event_scan
Removing unused procedure keyboard_event_get
Removing unused procedure keyboard_event_pressed
@ -1289,15 +1387,17 @@ Eliminating unused variable (byte~) $0 and assignment [81] (byte~) $0 ← (byte)
Eliminating unused variable (byte) KEY_MODIFIER_LSHIFT and assignment [79] (byte) KEY_MODIFIER_LSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 1
Eliminating unused variable (byte) KEY_MODIFIER_RSHIFT and assignment [80] (byte) KEY_MODIFIER_RSHIFT ← (byte/signed byte/word/signed word/dword/signed dword) 2
Removing empty block @1
Removing empty block keyboard_matrix_read::@1
Removing empty block @2
Removing empty block keyboard_key_pressed::@1
Removing empty block @3
Removing empty block keyboard_get_keycode::@1
Removing empty block @4
Removing empty block keyboard_matrix_read::@1
Removing empty block @5
Removing empty block keyboard_key_pressed::@1
Removing empty block @6
Removing empty block keyboard_get_keycode::@1
Removing empty block @7
Removing empty block @8
Removing empty block @9
Removing empty block @10
Removing empty block main::@15
Removing empty block main::@4
Removing empty block main::@16
@ -1320,6 +1420,8 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte*) CIA1_PORT_B#0 ← ((byte*)) (word/dword/signed dword) 56321
(byte*) CIA1_PORT_A_DDR#0 ← ((byte*)) (word/dword/signed dword) 56322
(byte*) CIA1_PORT_B_DDR#0 ← ((byte*)) (word/dword/signed dword) 56323
to:@3
@3: scope:[] from @begin
(byte) KEY_3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8
(byte) KEY_W#0 ← (byte/signed byte/word/signed word/dword/signed dword) 9
(byte) KEY_A#0 ← (byte/signed byte/word/signed word/dword/signed dword) 10
@ -1373,7 +1475,7 @@ CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN
(byte[]) keyboard_char_keycodes#0 ← { (byte) KEY_AT#0, (byte) KEY_A#0, (byte) KEY_B#0, (byte) KEY_C#0, (byte) KEY_D#0, (byte) KEY_E#0, (byte) KEY_F#0, (byte) KEY_G#0, (byte) KEY_H#0, (byte) KEY_I#0, (byte) KEY_J#0, (byte) KEY_K#0, (byte) KEY_L#0, (byte) KEY_M#0, (byte) KEY_N#0, (byte) KEY_O#0, (byte) KEY_P#0, (byte) KEY_Q#0, (byte) KEY_R#0, (byte) KEY_S#0, (byte) KEY_T#0, (byte) KEY_U#0, (byte) KEY_V#0, (byte) KEY_W#0, (byte) KEY_X#0, (byte) KEY_Y#0, (byte) KEY_Z#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_POUND#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ARROW_UP#0, (byte) KEY_ARROW_LEFT#0, (byte) KEY_SPACE#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_ASTERISK#0, (byte) KEY_PLUS#0, (byte) KEY_COMMA#0, (byte) KEY_MINUS#0, (byte) KEY_DOT#0, (byte) KEY_SLASH#0, (byte) KEY_0#0, (byte) KEY_1#0, (byte) KEY_2#0, (byte) KEY_3#0, (byte) KEY_4#0, (byte) KEY_5#0, (byte) KEY_6#0, (byte) KEY_7#0, (byte) KEY_8#0, (byte) KEY_9#0, (byte) KEY_COLON#0, (byte) KEY_SEMICOLON#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte) KEY_EQUALS#0, (byte/signed byte/word/signed word/dword/signed dword) 63, (byte/signed byte/word/signed word/dword/signed dword) 63 }
(byte[8]) keyboard_matrix_row_bitmask#0 ← { (byte/word/signed word/dword/signed dword) 254, (byte/word/signed word/dword/signed dword) 253, (byte/word/signed word/dword/signed dword) 251, (byte/word/signed word/dword/signed dword) 247, (byte/word/signed word/dword/signed dword) 239, (byte/word/signed word/dword/signed dword) 223, (byte/word/signed word/dword/signed dword) 191, (byte/signed byte/word/signed word/dword/signed dword) 127 }
(byte[8]) keyboard_matrix_col_bitmask#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 8, (byte/signed byte/word/signed word/dword/signed dword) 16, (byte/signed byte/word/signed word/dword/signed dword) 32, (byte/signed byte/word/signed word/dword/signed dword) 64, (byte/word/signed word/dword/signed dword) 128 }
to:@8
to:@11
keyboard_init: scope:[keyboard_init] from main::@14
*((byte*) CIA1_PORT_A_DDR#0) ← (byte/word/signed word/dword/signed dword) 255
*((byte*) CIA1_PORT_B_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0
@ -1424,7 +1526,7 @@ keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_k
(byte) keyboard_get_keycode::return#1 ← (byte) keyboard_get_keycode::return#3
return
to:@return
main: scope:[main] from @8
main: scope:[main] from @11
(byte*) main::sc#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:main::@1
main::@1: scope:[main] from main main::@1
@ -1587,16 +1689,17 @@ main::@13: scope:[main] from main::@11 main::@13
main::@return: scope:[main] from main::@2
return
to:@return
@8: scope:[] from @begin
@11: scope:[] from @3
call main
to:@9
@9: scope:[] from @8
to:@12
@12: scope:[] from @11
to:@end
@end: scope:[] from @9
@end: scope:[] from @12
SYMBOL TABLE SSA
(label) @8
(label) @9
(label) @11
(label) @12
(label) @3
(label) @begin
(label) @end
(byte*) CIA1_PORT_A
@ -1887,7 +1990,7 @@ SYMBOL TABLE SSA
OPTIMIZING CONTROL FLOW GRAPH
Culled Empty Block (label) main::@27
Culled Empty Block (label) main::@3
Culled Empty Block (label) @9
Culled Empty Block (label) @12
Succesful SSA optimization Pass2CullEmptyBlocks
Inversing boolean not (bool~) main::$14 ← (byte) main::key#0 == (byte/signed byte/word/signed word/dword/signed dword) 63 from (bool~) main::$13 ← (byte) main::key#0 != (byte/signed byte/word/signed word/dword/signed dword) 63
Inversing boolean not (bool~) main::$17 ← (byte~) main::$15 == (byte/signed byte/word/signed word/dword/signed dword) 0 from (bool~) main::$16 ← (byte~) main::$15 != (byte/signed byte/word/signed word/dword/signed dword) 0
@ -2064,6 +2167,7 @@ if() condition always true - replacing block destination if(true) goto main::@5
Succesful SSA optimization Pass2ConstantIfs
Removing unused block main::@return
Succesful SSA optimization Pass2EliminateUnusedBlocks
Culled Empty Block (label) @3
Culled Empty Block (label) main::@2
Culled Empty Block (label) main::@17
Culled Empty Block (label) main::@12
@ -2119,7 +2223,7 @@ Constant inlined main::sc#0 = ((byte*))(word/signed word/dword/signed dword) 102
Constant inlined main::row#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::ch#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Succesful SSA optimization Pass2ConstantInlining
Block Sequence Planned @begin @8 @end main main::@1 main::@14 main::@5 main::@6 main::@28 main::@7 main::@18 main::@9 main::@20 main::@21 main::@10 main::@29 main::@22 main::@30 main::@23 main::@11 main::@13 main::@8 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return keyboard_init keyboard_init::@return
Block Sequence Planned @begin @11 @end main main::@1 main::@14 main::@5 main::@6 main::@28 main::@7 main::@18 main::@9 main::@20 main::@21 main::@10 main::@29 main::@22 main::@30 main::@23 main::@11 main::@13 main::@8 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return keyboard_init keyboard_init::@return
Added new block during phi lifting main::@31(between main::@1 and main::@1)
Added new block during phi lifting main::@32(between main::@20 and main::@6)
Added new block during phi lifting main::@33(between main::@9 and main::@7)
@ -2128,9 +2232,9 @@ Added new block during phi lifting main::@35(between main::@30 and main::@11)
Added new block during phi lifting main::@36(between main::@29 and main::@11)
Added new block during phi lifting main::@37(between main::@11 and main::@13)
Added new block during phi lifting main::@38(between main::@13 and main::@13)
Block Sequence Planned @begin @8 @end main main::@1 main::@14 main::@5 main::@6 main::@28 main::@7 main::@18 main::@9 main::@20 main::@21 main::@10 main::@29 main::@22 main::@30 main::@23 main::@11 main::@37 main::@13 main::@38 main::@34 main::@35 main::@36 main::@32 main::@33 main::@8 main::@31 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return keyboard_init keyboard_init::@return
Block Sequence Planned @begin @11 @end main main::@1 main::@14 main::@5 main::@6 main::@28 main::@7 main::@18 main::@9 main::@20 main::@21 main::@10 main::@29 main::@22 main::@30 main::@23 main::@11 main::@37 main::@13 main::@38 main::@34 main::@35 main::@36 main::@32 main::@33 main::@8 main::@31 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return keyboard_init keyboard_init::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @8
Adding NOP phi() at start of @11
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@14
@ -2178,9 +2282,9 @@ Culled Empty Block (label) main::@36
Culled Empty Block (label) main::@32
Culled Empty Block (label) main::@33
Culled Empty Block (label) main::@31
Block Sequence Planned @begin @8 @end main main::@1 main::@14 main::@5 main::@6 main::@28 main::@7 main::@18 main::@9 main::@20 main::@21 main::@10 main::@29 main::@22 main::@30 main::@23 main::@11 main::@13 main::@8 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return keyboard_init keyboard_init::@return
Block Sequence Planned @begin @11 @end main main::@1 main::@14 main::@5 main::@6 main::@28 main::@7 main::@18 main::@9 main::@20 main::@21 main::@10 main::@29 main::@22 main::@30 main::@23 main::@11 main::@13 main::@8 keyboard_key_pressed keyboard_key_pressed::@2 keyboard_key_pressed::@return keyboard_matrix_read keyboard_matrix_read::@return keyboard_get_keycode keyboard_get_keycode::@return keyboard_init keyboard_init::@return
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @8
Adding NOP phi() at start of @11
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@14
@ -2200,14 +2304,14 @@ Propagating live ranges...
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi() [ ] ( )
to:@8
@8: scope:[] from @begin
to:@11
@11: scope:[] from @begin
[1] phi() [ ] ( )
[2] call main [ ] ( )
to:@end
@end: scope:[] from @8
@end: scope:[] from @11
[3] phi() [ ] ( )
main: scope:[main] from @8
main: scope:[main] from @11
[4] phi() [ ] ( main:2 [ ] )
to:main::@1
main::@1: scope:[main] from main main::@1
@ -2331,36 +2435,36 @@ keyboard_init::@return: scope:[keyboard_init] from keyboard_init
DOMINATORS
@begin dominated by @begin
@8 dominated by @begin @8
@end dominated by @end @begin @8
main dominated by main @begin @8
main::@1 dominated by main main::@1 @begin @8
main::@14 dominated by main main::@1 @begin main::@14 @8
main::@5 dominated by main main::@1 main::@5 @begin main::@14 @8
main::@6 dominated by main main::@1 main::@5 main::@6 @begin main::@14 @8
main::@28 dominated by main::@28 main main::@1 main::@5 main::@6 @begin main::@14 @8
main::@7 dominated by main::@7 main::@28 main main::@1 main::@5 main::@6 @begin main::@14 @8
main::@18 dominated by main::@7 main::@28 main main::@1 main::@5 main::@6 @begin main::@18 main::@14 @8
main::@9 dominated by main::@9 main::@7 main::@28 main main::@1 main::@5 main::@6 @begin main::@14 @8
main::@20 dominated by main::@9 main::@20 main::@7 main::@28 main main::@1 main::@5 main::@6 @begin main::@14 @8
main::@21 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@1 main::@5 main::@6 @begin main::@14 @8
main::@10 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@1 main::@5 main::@6 @begin main::@10 main::@14 @8
main::@29 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @begin main::@10 main::@14 @8
main::@22 dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @begin main::@10 main::@14 @8
main::@30 dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 main::@30 @begin main::@10 main::@14 @8
main::@23 dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@23 main::@1 main::@5 main::@6 main::@30 @begin main::@10 main::@14 @8
main::@11 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 main::@11 @begin main::@10 main::@14 @8
main::@13 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 main::@11 @begin main::@10 main::@13 main::@14 @8
main::@8 dominated by main::@7 main::@8 main::@28 main main::@1 main::@5 main::@6 @begin main::@14 @8
keyboard_key_pressed dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @begin main::@10 main::@14 keyboard_key_pressed @8
keyboard_key_pressed::@2 dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@1 keyboard_key_pressed::@2 main::@5 main::@6 @begin main::@10 main::@14 keyboard_key_pressed @8
keyboard_key_pressed::@return dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 keyboard_key_pressed::@return main::@1 keyboard_key_pressed::@2 main::@5 main::@6 @begin main::@10 main::@14 keyboard_key_pressed @8
keyboard_matrix_read dominated by keyboard_matrix_read main main::@1 main::@5 main::@6 @begin main::@14 @8
keyboard_matrix_read::@return dominated by keyboard_matrix_read main main::@1 main::@5 main::@6 @begin keyboard_matrix_read::@return main::@14 @8
keyboard_get_keycode dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@1 main::@5 main::@6 keyboard_get_keycode @begin main::@10 main::@14 @8
keyboard_get_keycode::@return dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@1 main::@5 main::@6 keyboard_get_keycode @begin main::@10 main::@14 @8 keyboard_get_keycode::@return
keyboard_init dominated by main keyboard_init main::@1 @begin main::@14 @8
keyboard_init::@return dominated by main keyboard_init main::@1 keyboard_init::@return @begin main::@14 @8
@11 dominated by @11 @begin
@end dominated by @end @11 @begin
main dominated by main @11 @begin
main::@1 dominated by main main::@1 @11 @begin
main::@14 dominated by main main::@1 @11 @begin main::@14
main::@5 dominated by main main::@1 main::@5 @11 @begin main::@14
main::@6 dominated by main main::@1 main::@5 main::@6 @11 @begin main::@14
main::@28 dominated by main::@28 main main::@1 main::@5 main::@6 @11 @begin main::@14
main::@7 dominated by main::@7 main::@28 main main::@1 main::@5 main::@6 @11 @begin main::@14
main::@18 dominated by main::@7 main::@28 main main::@1 main::@5 main::@6 @11 @begin main::@18 main::@14
main::@9 dominated by main::@9 main::@7 main::@28 main main::@1 main::@5 main::@6 @11 @begin main::@14
main::@20 dominated by main::@9 main::@20 main::@7 main::@28 main main::@1 main::@5 main::@6 @11 @begin main::@14
main::@21 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@1 main::@5 main::@6 @11 @begin main::@14
main::@10 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@1 main::@5 main::@6 @11 @begin main::@10 main::@14
main::@29 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @11 @begin main::@10 main::@14
main::@22 dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @11 @begin main::@10 main::@14
main::@30 dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @11 main::@30 @begin main::@10 main::@14
main::@23 dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@23 main::@1 main::@5 main::@6 @11 main::@30 @begin main::@10 main::@14
main::@11 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @11 main::@11 @begin main::@10 main::@14
main::@13 dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @11 main::@11 @begin main::@10 main::@13 main::@14
main::@8 dominated by main::@7 main::@8 main::@28 main main::@1 main::@5 main::@6 @11 @begin main::@14
keyboard_key_pressed dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@1 main::@5 main::@6 @11 @begin main::@10 main::@14 keyboard_key_pressed
keyboard_key_pressed::@2 dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 main::@1 keyboard_key_pressed::@2 main::@5 main::@6 @11 @begin main::@10 main::@14 keyboard_key_pressed
keyboard_key_pressed::@return dominated by main::@9 main::@20 main::@7 main::@22 main::@21 main::@28 main main::@29 keyboard_key_pressed::@return main::@1 keyboard_key_pressed::@2 main::@5 main::@6 @11 @begin main::@10 main::@14 keyboard_key_pressed
keyboard_matrix_read dominated by keyboard_matrix_read main main::@1 main::@5 main::@6 @11 @begin main::@14
keyboard_matrix_read::@return dominated by keyboard_matrix_read main main::@1 main::@5 main::@6 @11 @begin keyboard_matrix_read::@return main::@14
keyboard_get_keycode dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@1 main::@5 main::@6 keyboard_get_keycode @11 @begin main::@10 main::@14
keyboard_get_keycode::@return dominated by main::@9 main::@20 main::@7 main::@21 main::@28 main main::@1 main::@5 main::@6 keyboard_get_keycode @11 @begin main::@10 main::@14 keyboard_get_keycode::@return
keyboard_init dominated by main keyboard_init main::@1 @11 @begin main::@14
keyboard_init::@return dominated by main keyboard_init main::@1 keyboard_init::@return @11 @begin main::@14
NATURAL LOOPS
Found back edge: Loop head: main::@1 tails: main::@1 blocks: null
@ -2665,17 +2769,17 @@ INITIAL ASM
.const KEY_Q = $3e
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
b8_from_bbegin:
jmp b8
//SEG4 @8
b8:
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
b11_from_bbegin:
jmp b11
//SEG4 @11
b11:
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @8 to main [phi:@8->main]
main_from_b8:
//SEG6 [4] phi from @11 to main [phi:@11->main]
main_from_b11:
jsr main
//SEG7 [3] phi from @8 to @end [phi:@8->@end]
bend_from_b8:
//SEG7 [3] phi from @11 to @end [phi:@11->@end]
bend_from_b11:
jmp bend
//SEG8 @end
bend:
@ -3205,17 +3309,17 @@ ASSEMBLER BEFORE OPTIMIZATION
.const KEY_Q = $3e
//SEG2 @begin
bbegin:
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
b8_from_bbegin:
jmp b8
//SEG4 @8
b8:
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
b11_from_bbegin:
jmp b11
//SEG4 @11
b11:
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @8 to main [phi:@8->main]
main_from_b8:
//SEG6 [4] phi from @11 to main [phi:@11->main]
main_from_b11:
jsr main
//SEG7 [3] phi from @8 to @end [phi:@8->@end]
bend_from_b8:
//SEG7 [3] phi from @11 to @end [phi:@11->@end]
bend_from_b11:
jmp bend
//SEG8 @end
bend:
@ -3541,7 +3645,7 @@ keyboard_init: {
keyboard_char_keycodes: .byte KEY_AT, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, $3f, KEY_POUND, $3f, KEY_ARROW_UP, KEY_ARROW_LEFT, KEY_SPACE, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f, KEY_ASTERISK, KEY_PLUS, KEY_COMMA, KEY_MINUS, KEY_DOT, KEY_SLASH, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON, $3f, KEY_EQUALS, $3f, $3f
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b8
Removing instruction jmp b11
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b14
@ -3576,9 +3680,9 @@ Replacing label b11_from_b30 with b11
Replacing label b10_from_b11 with b10
Replacing label b13_from_b13 with b13
Removing instruction bbegin:
Removing instruction b8_from_bbegin:
Removing instruction main_from_b8:
Removing instruction bend_from_b8:
Removing instruction b11_from_bbegin:
Removing instruction main_from_b11:
Removing instruction bend_from_b11:
Removing instruction b1_from_b1:
Removing instruction b14_from_b1:
Removing instruction b6_from_b20:
@ -3590,7 +3694,7 @@ Removing instruction b11_from_b30:
Removing instruction b13_from_b11:
Removing instruction b13_from_b13:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction b8:
Removing instruction b11:
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b14:
@ -3620,7 +3724,7 @@ Removing instruction jmp b10
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
(label) @8
(label) @11
(label) @begin
(label) @end
(byte*) CIA1_PORT_A
@ -3909,12 +4013,12 @@ Score: 56827
.const KEY_SPACE = $3c
.const KEY_Q = $3e
//SEG2 @begin
//SEG3 [1] phi from @begin to @8 [phi:@begin->@8]
//SEG4 @8
//SEG3 [1] phi from @begin to @11 [phi:@begin->@11]
//SEG4 @11
//SEG5 [2] call main [ ] ( )
//SEG6 [4] phi from @8 to main [phi:@8->main]
//SEG6 [4] phi from @11 to main [phi:@11->main]
jsr main
//SEG7 [3] phi from @8 to @end [phi:@8->@end]
//SEG7 [3] phi from @11 to @end [phi:@11->@end]
//SEG8 @end
//SEG9 main
main: {

View File

@ -1,4 +1,4 @@
(label) @8
(label) @11
(label) @begin
(label) @end
(byte*) CIA1_PORT_A