1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-06-09 18:29:36 +00:00

Tests now working with proper word/dword-array indexing! Closes #139

This commit is contained in:
jespergravgaard 2019-04-19 13:36:08 +02:00
parent 5a54b45ed9
commit dda11749e2
37 changed files with 10611 additions and 9712 deletions

View File

@ -0,0 +1,7 @@
sec
lda {c1},x
sbc {c2},y
sta {z1}
lda {c1}+1,x
sbc {c2}+1,y
sta {z1}+1

View File

@ -0,0 +1,7 @@
sec
lda {c1},y
sbc {c2},x
sta {z1}
lda {c1}+1,y
sbc {c2}+1,x
sta {z1}+1

View File

@ -94,7 +94,7 @@ void plexShowSprite() {
SPRITES_YPOS[plex_sprite_idx2] = ypos;
plexFreeAdd(ypos);
PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]];
byte xpos_idx = PLEX_SORTED_IDX[plex_show_idx]<<1;
byte xpos_idx = PLEX_SORTED_IDX[plex_show_idx];
SPRITES_XPOS[plex_sprite_idx2] = <PLEX_XPOS[xpos_idx];
if(>PLEX_XPOS[xpos_idx]!=0) {
*SPRITES_XMSB |= plex_sprite_msb;

View File

@ -289,7 +289,7 @@ public class TestPrograms {
@Test
public void testComparisonRewritingPointer() throws IOException, URISyntaxException {
compileAndCompare("comparison-rewriting-pointer", log());
compileAndCompare("comparison-rewriting-pointer");
}
@Test

View File

@ -36,11 +36,11 @@ byte current_piece_char;
byte current_xpos;
byte current_ypos;
// The screen currently being rendered to. $00 for screen 1 / $40 for screen 2.
byte render_screen_render = $40;
// The screen currently to show next to the user. $00 for screen 1 / $40 for screen 2.
// The screen currently being rendered to. $00 for screen 1 / $20 for screen 2.
byte render_screen_render = $20;
// The screen currently to show next to the user. $00 for screen 1 / $20 for screen 2.
byte render_screen_show = 0;
// The screen currently being showed to the user. $00 for screen 1 / $40 for screen 2.
// The screen currently being showed to the user. $00 for screen 1 / $20 for screen 2.
volatile byte render_screen_showing = 0;
// Current score in BCD-format

View File

@ -48,7 +48,7 @@ void play_init() {
byte idx = 0;
byte* pli = playfield;
for(byte j:0..PLAYFIELD_LINES-1) {
playfield_lines[j*2] = pli;
playfield_lines[j] = pli;
playfield_lines_idx[j] = idx;
pli += PLAYFIELD_COLS;
idx += PLAYFIELD_COLS;
@ -59,8 +59,7 @@ void play_init() {
current_movedown_slow = MOVEDOWN_SLOW_SPEEDS[level];
// Set the initial score add values
for(byte b: 0..4) {
byte b4 = b*4;
score_add_bcd[b4] = SCORE_BASE_BCD[b4];
score_add_bcd[b] = SCORE_BASE_BCD[b];
}
}
@ -174,32 +173,32 @@ const byte COLLISION_RIGHT = 8;
byte play_collision(byte xpos, byte ypos, byte orientation) {
byte* piece_gfx = current_piece + orientation;
byte i = 0;
byte ypos2 = ypos*2;
byte yp = ypos;
for(byte l:0..3) {
byte* playfield_line = playfield_lines[ypos2];
byte col = xpos;
byte* playfield_line = playfield_lines[yp];
byte xp = xpos;
for(byte c:0..3) {
if(piece_gfx[i++]!=0) {
if(ypos2>=2*PLAYFIELD_LINES) {
if(yp>=PLAYFIELD_LINES) {
// Below the playfield bottom
return COLLISION_BOTTOM;
}
if((col&$80)!=0) {
if((xp&$80)!=0) {
// Beyond left side of the playfield
return COLLISION_LEFT;
}
if(col>=PLAYFIELD_COLS) {
if(xp>=PLAYFIELD_COLS) {
// Beyond left side of the playfield
return COLLISION_RIGHT;
}
if(playfield_line[col]!=0) {
if(playfield_line[xp]!=0) {
// Collision with a playfield cell
return COLLISION_PLAYFIELD;
}
}
col++;
xp++;
}
ypos2 += 2;
yp++;
}
return COLLISION_NONE;
}
@ -207,17 +206,17 @@ byte play_collision(byte xpos, byte ypos, byte orientation) {
// Lock the current piece onto the playfield
void play_lock_current() {
byte i = 0;
byte ypos2 = current_ypos*2;
byte yp = current_ypos;
for(byte l:0..3) {
byte* playfield_line = playfield_lines[ypos2];
byte col = current_xpos;
byte* playfield_line = playfield_lines[yp];
byte xp = current_xpos;
for(byte c:0..3) {
if(current_piece_gfx[i++]!=0) {
playfield_line[col] = current_piece_char;
playfield_line[xp] = current_piece_char;
}
col++;
xp++;
}
ypos2 += 2;
yp++;
}
}
@ -226,7 +225,7 @@ void play_lock_current() {
void play_spawn_current() {
// Move next piece into current
byte current_piece_idx = next_piece_idx;
current_piece = PIECES[current_piece_idx*2];
current_piece = PIECES[current_piece_idx];
current_piece_char = PIECES_CHARS[current_piece_idx];
current_orientation = 0;
current_piece_gfx = current_piece + current_orientation;
@ -285,7 +284,7 @@ byte play_remove_lines() {
void play_update_score(byte removed) {
if(removed!=0){
byte lines_before = <lines_bcd&$f0;
dword add_bcd = score_add_bcd[removed*4];
dword add_bcd = score_add_bcd[removed];
asm { sed }
lines_bcd += removed;
@ -319,8 +318,7 @@ void play_increase_level() {
// Increase the score values gained
asm { sed }
for(byte b: 0..4) {
byte b4 = b*4;
score_add_bcd[b4] += SCORE_BASE_BCD[b4];
score_add_bcd[b] += SCORE_BASE_BCD[b];
}
asm { cld }
}

View File

@ -63,15 +63,15 @@ void render_init() {
byte* li_1 = PLAYFIELD_SCREEN_1 + 2*40 + 16;
byte* li_2 = PLAYFIELD_SCREEN_2 + 2*40 + 16;
for(byte i:0..PLAYFIELD_LINES-1) {
screen_lines_1[i*2] = li_1;
screen_lines_2[i*2] = li_2;
screen_lines_1[i] = li_1;
screen_lines_2[i] = li_2;
li_1 += 40;
li_2 += 40;
}
// Show showing screen 1 and rendering to screen 2
render_screen_show = 0;
render_screen_render = $40;
render_screen_render = $20;
}
// Update $D018 to show the current screen (used for double buffering)
@ -90,8 +90,8 @@ void render_show() {
// Swap rendering to the other screen (used for double buffering)
void render_screen_swap() {
render_screen_render ^= $40;
render_screen_show ^= $40;
render_screen_render ^= $20;
render_screen_show ^= $20;
}
// Show the current score
@ -161,7 +161,7 @@ void render_playfield() {
// Do not render the top 2 lines.
byte i = PLAYFIELD_COLS*2;
for(byte l:2..PLAYFIELD_LINES-1) {
byte* screen_line = screen_lines_1[render_screen_render+l*2];
byte* screen_line = screen_lines_1[render_screen_render+l];
for(byte c:0..PLAYFIELD_COLS-1) {
*(screen_line++) = playfield[i++];
}
@ -172,10 +172,10 @@ void render_playfield() {
// Ignores cases where parts of the tetromino is outside the playfield (sides/bottom) since the movement collision routine prevents this.
void render_moving() {
byte i = 0;
byte ypos2 = current_ypos*2;
byte ypos = current_ypos;
for(byte l:0..3) {
if(ypos2>2) {
byte* screen_line = screen_lines_1[render_screen_render+ypos2];
if(ypos>1) {
byte* screen_line = screen_lines_1[render_screen_render+ypos];
byte xpos = current_xpos;
for(byte c:0..3) {
byte current_cell = current_piece_gfx[i++];
@ -187,7 +187,7 @@ void render_moving() {
} else {
i += 4;
}
ypos2 += 2;
ypos++;
}
}
@ -204,7 +204,7 @@ void render_next() {
}
// Render the next piece
byte* next_piece_gfx = PIECES[next_piece_idx*2];
byte* next_piece_gfx = PIECES[next_piece_idx];
byte next_piece_char = PIECES_NEXT_CHARS[next_piece_idx];
for(byte l:0..3) {
for(byte c:0..3) {

View File

@ -37,7 +37,7 @@ void init() {
word xp = 32;
for(byte sx: 0..PLEX_COUNT-1) {
PLEX_PTR[sx] = (byte)(SPRITE/$40);
PLEX_XPOS[sx*2] = xp;
PLEX_XPOS[sx] = xp;
xp += 9;
}
// Enable & initialize sprites

View File

@ -40,9 +40,9 @@ void main() {
bitmap_init(BITMAP);
bitmap_clear();
screen_fill(SCREEN, $10);
for( byte i=0; i!=8; i+=2) {
for( byte i=0; i!=4; i++) {
point_init(i);
bitmap_plot(x_start[i], y_start[i/2]);
bitmap_plot(x_start[i], y_start[i]);
}
while(true) {
while(*RASTER!=$ff) {}
@ -52,9 +52,8 @@ void main() {
// Initialize the points to be animated
void point_init(byte point_idx) {
byte point_idx1 = point_idx/2;
signed word x_diff = ((signed word)x_end[point_idx])-((signed word)x_start[point_idx]);
signed word y_diff = ((signed word)y_end[point_idx1])-((signed word)y_start[point_idx1]);
signed word y_diff = ((signed word)y_end[point_idx])-((signed word)y_start[point_idx]);
if(abs16s(x_diff)>abs16s(y_diff)) {
// X is driver - abs(y/x) is < 1
@ -66,13 +65,13 @@ void point_init(byte point_idx) {
x_add[point_idx] = $10;
}
signed word x_stepf = divr16s(0, x_diff, y_diff);
y_add[point_idx1] = (signed byte)((>x_stepf)/$10);
y_add[point_idx] = (signed byte)((>x_stepf)/$10);
} else {
// X is driver - abs(x/y) is < 1
}
x_cur[point_idx] = x_start[point_idx]*$10;
y_cur[point_idx] = ((word)y_start[point_idx1])*$10;
delay[point_idx1] = DELAY;
y_cur[point_idx] = ((word)y_start[point_idx])*$10;
delay[point_idx] = DELAY;
}
// Return the absolute (unsigned) value of a word

View File

@ -94,7 +94,7 @@ void plexShowSprite() {
SPRITES_YPOS[plex_sprite_idx2] = ypos;
plexFreeAdd(ypos);
PLEX_SCREEN_PTR[plex_sprite_idx] = PLEX_PTR[PLEX_SORTED_IDX[plex_show_idx]];
byte xpos_idx = PLEX_SORTED_IDX[plex_show_idx]*2;
byte xpos_idx = PLEX_SORTED_IDX[plex_show_idx];
SPRITES_XPOS[plex_sprite_idx2] = <PLEX_XPOS[xpos_idx];
if(>PLEX_XPOS[xpos_idx]!=0) {
*SPRITES_XMSB |= plex_sprite_msb;

View File

@ -36,7 +36,7 @@ void init() {
word xp = 32;
for(byte sx: 0..PLEX_COUNT-1) {
PLEX_PTR[sx] = (byte)(SPRITE/$40);
PLEX_XPOS[sx*2] = xp;
PLEX_XPOS[sx] = xp;
xp += 9;
}
// Enable & initialize sprites

View File

@ -65,7 +65,7 @@
.label irq_cnt = 9
.label sin_idx = 2
bbegin:
// The screen currently being showed to the user. $00 for screen 1 / $40 for screen 2.
// The screen currently being showed to the user. $00 for screen 1 / $20 for screen 2.
lda #0
sta render_screen_showing
// The raster line of the next IRQ

View File

@ -1826,7 +1826,7 @@ bbegin:
//SEG4 @1
b1:
//SEG5 [1] (byte) render_screen_showing#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
// The screen currently being showed to the user. $00 for screen 1 / $40 for screen 2.
// The screen currently being showed to the user. $00 for screen 1 / $20 for screen 2.
lda #0
sta render_screen_showing
//SEG6 kickasm(location (const byte*) PLAYFIELD_SPRITES#0) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory .for(var sy=0;sy<10;sy++) { .var sprite_gfx_y = sy*20 .for(var sx=0;sx<3;sx++) { .for (var y=0;y<21; y++) { .var gfx_y = sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) .for (var c=0; c<3; c++) { .byte sprites.getSinglecolorByte(sx*3+c,gfx_y) } } .byte 0 } } }}
@ -2702,7 +2702,7 @@ bbegin:
//SEG4 @1
b1:
//SEG5 [1] (byte) render_screen_showing#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
// The screen currently being showed to the user. $00 for screen 1 / $40 for screen 2.
// The screen currently being showed to the user. $00 for screen 1 / $20 for screen 2.
lda #0
sta render_screen_showing
//SEG6 kickasm(location (const byte*) PLAYFIELD_SPRITES#0) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory .for(var sy=0;sy<10;sy++) { .var sprite_gfx_y = sy*20 .for(var sx=0;sx<3;sx++) { .for (var y=0;y<21; y++) { .var gfx_y = sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) .for (var c=0; c<3; c++) { .byte sprites.getSinglecolorByte(sx*3+c,gfx_y) } } .byte 0 } } }}
@ -3673,7 +3673,7 @@ Score: 7310
bbegin:
//SEG4 @1
//SEG5 [1] (byte) render_screen_showing#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1
// The screen currently being showed to the user. $00 for screen 1 / $40 for screen 2.
// The screen currently being showed to the user. $00 for screen 1 / $20 for screen 2.
lda #0
sta render_screen_showing
//SEG6 kickasm(location (const byte*) PLAYFIELD_SPRITES#0) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory .for(var sy=0;sy<10;sy++) { .var sprite_gfx_y = sy*20 .for(var sx=0;sx<3;sx++) { .for (var y=0;y<21; y++) { .var gfx_y = sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) .for (var c=0; c<3; c++) { .byte sprites.getSinglecolorByte(sx*3+c,gfx_y) } } .byte 0 } } }}

View File

@ -158,7 +158,7 @@
.label current_piece_103 = 5
.label current_piece_104 = 5
bbegin:
// The screen currently being showed to the user. $00 for screen 1 / $40 for screen 2.
// The screen currently being showed to the user. $00 for screen 1 / $20 for screen 2.
lda #0
sta render_screen_showing
// Original Color Data
@ -188,7 +188,7 @@ main: {
sta next_piece_idx
jsr play_spawn_current
jsr play_spawn_current
ldx #$40
ldx #$20
jsr render_playfield
ldx current_ypos
lda current_xpos
@ -199,13 +199,13 @@ main: {
sta current_piece_gfx_120+1
lda current_piece_char
sta current_piece_char_108
lda #$40
lda #$20
sta render_screen_render_33
jsr render_moving
ldx play_spawn_current.piece_idx
lda #$40
lda #$20
jsr render_next
ldy play_spawn_current._0
ldy play_spawn_current._7
lda PIECES,y
sta current_piece
lda PIECES+1,y
@ -222,7 +222,7 @@ main: {
sta current_movedown_counter
sta keyboard_events_size
sta current_orientation
lda #$40
lda #$20
sta render_screen_render
lda #0
sta render_screen_show
@ -270,10 +270,10 @@ main: {
}
// Swap rendering to the other screen (used for double buffering)
render_screen_swap: {
lda #$40
lda #$20
eor render_screen_render
sta render_screen_render
lda #$40
lda #$20
eor render_screen_show
sta render_screen_show
rts
@ -461,29 +461,24 @@ render_next: {
// Render the current moving piece at position (current_xpos, current_ypos)
// Ignores cases where parts of the tetromino is outside the playfield (sides/bottom) since the movement collision routine prevents this.
render_moving: {
.label ypos2 = $c
.label ypos = $c
.label screen_line = 7
.label xpos = $f
.label i = $e
.label l = $d
txa
asl
sta ypos2
stx ypos
lda #0
sta l
sta i
b1:
lda ypos2
cmp #2+1
lda ypos
cmp #1+1
bcs b2
lax i
axs #-[4]
stx i
b3:
lda ypos2
clc
adc #2
sta ypos2
inc ypos
inc l
lda #4
cmp l
@ -492,7 +487,8 @@ render_moving: {
b2:
lda render_screen_render_33
clc
adc ypos2
adc ypos
asl
tay
lda screen_lines_1,y
sta screen_line
@ -528,11 +524,10 @@ render_playfield: {
lda #2
sta l
b1:
lda l
asl
stx $ff
txa
clc
adc $ff
adc l
asl
tay
lda screen_lines_1,y
sta screen_line
@ -638,15 +633,15 @@ play_move_rotate: {
}
// Test if there is a collision between the current piece moved to (x, y) and anything on the playfield or the playfield boundaries
// Returns information about the type of the collision detected
// play_collision(byte zeropage($c) xpos, byte zeropage($b) ypos, byte register(X) orientation)
// play_collision(byte zeropage($b) xpos, byte zeropage($c) ypos, byte register(X) orientation)
play_collision: {
.label xpos = $c
.label ypos = $b
.label xpos = $b
.label ypos = $c
.label piece_gfx = 5
.label ypos2 = $b
.label yp = $c
.label playfield_line = 7
.label i = $2b
.label col = $f
.label xp = $f
.label l = $d
.label i_2 = $e
.label i_3 = $e
@ -659,18 +654,19 @@ play_collision: {
bcc !+
inc piece_gfx+1
!:
asl ypos2
lda #0
sta l
sta i_3
b1:
ldy ypos2
lda yp
asl
tay
lda playfield_lines,y
sta playfield_line
lda playfield_lines+1,y
sta playfield_line+1
lda xpos
sta col
sta xp
ldx #0
b2:
ldy i_2
@ -680,40 +676,37 @@ play_collision: {
lda (piece_gfx),y
cmp #0
beq b3
lda ypos2
cmp #2*PLAYFIELD_LINES
lda yp
cmp #PLAYFIELD_LINES
bcc b4
lda #COLLISION_BOTTOM
rts
b4:
lda #$80
and col
and xp
cmp #0
beq b5
lda #COLLISION_LEFT
rts
b5:
lda col
lda xp
cmp #PLAYFIELD_COLS
bcc b6
lda #COLLISION_RIGHT
rts
b6:
ldy col
ldy xp
lda (playfield_line),y
cmp #0
beq b3
lda #COLLISION_PLAYFIELD
rts
b3:
inc col
inc xp
inx
cpx #4
bne b10
lda ypos2
clc
adc #2
sta ypos2
inc yp
inc l
lda #4
cmp l
@ -823,7 +816,7 @@ play_move_down: {
tax
jsr play_update_score
jsr play_spawn_current
ldy play_spawn_current._0
ldy play_spawn_current._7
lda PIECES,y
sta current_piece
lda PIECES+1,y
@ -845,16 +838,16 @@ play_move_down: {
// Spawn a new piece
// Moves the next piece into the current and spawns a new next piece
play_spawn_current: {
.label _0 = 4
.label _7 = 4
.label piece_idx = $21
// Move next piece into current
ldx next_piece_idx
txa
asl
sta _0
sta _7
lda PIECES_CHARS,x
sta current_piece_char
ldy _0
ldy _7
lda PIECES,y
sta current_piece_gfx
lda PIECES+1,y
@ -1056,27 +1049,28 @@ play_remove_lines: {
}
// Lock the current piece onto the playfield
play_lock_current: {
.label ypos2 = $10
.label yp = $10
.label playfield_line = 5
.label col = $a
.label xp = $a
.label i = $b
.label l = 4
.label i_2 = 9
.label i_3 = 9
.label i_7 = 9
.label i_9 = 9
asl ypos2
lda #0
sta l
sta i_3
b1:
ldy ypos2
lda yp
asl
tay
lda playfield_lines,y
sta playfield_line
lda playfield_lines+1,y
sta playfield_line+1
lda current_xpos
sta col
sta xp
ldx #0
b2:
ldy i_2
@ -1087,17 +1081,14 @@ play_lock_current: {
cmp #0
beq b3
lda current_piece_char
ldy col
ldy xp
sta (playfield_line),y
b3:
inc col
inc xp
inx
cpx #4
bne b7
lda ypos2
clc
adc #2
sta ypos2
inc yp
inc l
lda #4
cmp l

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -229,34 +229,34 @@
(byte*) current_piece#28 current_piece zp ZP_WORD:26 6.0
(byte*~) current_piece#98 current_piece zp ZP_WORD:26 4.0
(byte) current_piece_char
(byte) current_piece_char#10 current_piece_char zp ZP_BYTE:28 187.38888888888889
(byte) current_piece_char#10 current_piece_char zp ZP_BYTE:28 183.9818181818182
(byte~) current_piece_char#108 current_piece_char#108 zp ZP_BYTE:11 4.0
(byte~) current_piece_char#109 current_piece_char#109 zp ZP_BYTE:11 22.0
(byte) current_piece_char#16 current_piece_char zp ZP_BYTE:28 3.4324324324324325
(byte) current_piece_char#29 current_piece_char zp ZP_BYTE:28 6.0
(byte) current_piece_char#5 current_piece_char zp ZP_BYTE:28 0.25806451612903225
(byte) current_piece_char#68 current_piece_char#68 zp ZP_BYTE:11 50.699999999999996
(byte) current_piece_char#68 current_piece_char#68 zp ZP_BYTE:11 48.285714285714285
(byte*) current_piece_gfx
(byte*) current_piece_gfx#114 current_piece_gfx zp ZP_WORD:30 187.38888888888889
(byte*) current_piece_gfx#114 current_piece_gfx zp ZP_WORD:30 183.9818181818182
(byte*~) current_piece_gfx#120 current_piece_gfx#120 zp ZP_WORD:5 2.0
(byte*~) current_piece_gfx#121 current_piece_gfx#121 zp ZP_WORD:5 11.0
(byte*) current_piece_gfx#18 current_piece_gfx zp ZP_WORD:30 6.047619047619047
(byte*) current_piece_gfx#20 current_piece_gfx zp ZP_WORD:30 0.37037037037037035
(byte*) current_piece_gfx#21 current_piece_gfx zp ZP_WORD:30 1.3333333333333333
(byte*) current_piece_gfx#35 current_piece_gfx zp ZP_WORD:30 6.0
(byte*) current_piece_gfx#64 current_piece_gfx#64 zp ZP_WORD:5 50.699999999999996
(byte*) current_piece_gfx#64 current_piece_gfx#64 zp ZP_WORD:5 48.285714285714285
(byte*) current_piece_gfx#7 current_piece_gfx zp ZP_WORD:30 4.0
(byte*) current_piece_gfx#74 current_piece_gfx zp ZP_WORD:30 0.26666666666666666
(byte) current_xpos
(byte) current_xpos#103 current_xpos zp ZP_BYTE:32 0.3448275862068966
(byte) current_xpos#124 current_xpos zp ZP_BYTE:32 20.75925925925926
(byte) current_xpos#124 current_xpos zp ZP_BYTE:32 20.38181818181818
(byte~) current_xpos#130 current_xpos#130 zp ZP_BYTE:10 1.3333333333333333
(byte~) current_xpos#131 current_xpos#131 zp ZP_BYTE:10 7.333333333333333
(byte) current_xpos#19 current_xpos zp ZP_BYTE:32 6.047619047619047
(byte) current_xpos#22 current_xpos zp ZP_BYTE:32 0.7999999999999999
(byte) current_xpos#26 current_xpos zp ZP_BYTE:32 0.4666666666666666
(byte) current_xpos#43 current_xpos zp ZP_BYTE:32 6.0
(byte) current_xpos#59 current_xpos#59 zp ZP_BYTE:10 5.7
(byte) current_xpos#59 current_xpos#59 zp ZP_BYTE:10 5.428571428571429
(byte) current_xpos#6 current_xpos zp ZP_BYTE:32 4.0
(byte) current_xpos#8 current_xpos zp ZP_BYTE:32 4.0
(byte) current_ypos
@ -449,7 +449,8 @@
(byte~) next_piece_idx#84 reg byte x 4.0
(byte~) next_piece_idx#85 reg byte x 22.0
(byte()) play_collision((byte) play_collision::xpos , (byte) play_collision::ypos , (byte) play_collision::orientation)
(byte~) play_collision::$7 reg byte a 20002.0
(byte) play_collision::$14 reg byte a 2002.0
(byte~) play_collision::$5 reg byte a 20002.0
(label) play_collision::@1
(label) play_collision::@10
(label) play_collision::@2
@ -464,19 +465,15 @@
(byte) play_collision::c
(byte) play_collision::c#1 reg byte x 10001.0
(byte) play_collision::c#2 reg byte x 2222.4444444444443
(byte) play_collision::col
(byte) play_collision::col#1 col zp ZP_BYTE:15 5000.5
(byte) play_collision::col#2 col zp ZP_BYTE:15 6375.75
(byte~) play_collision::col#9 col zp ZP_BYTE:15 2002.0
(byte) play_collision::i
(byte) play_collision::i#1 i zp ZP_BYTE:43 1615.6153846153845
(byte~) play_collision::i#11 i#11 zp ZP_BYTE:14 2002.0
(byte~) play_collision::i#13 i#13 zp ZP_BYTE:14 20002.0
(byte) play_collision::i#2 i#2 zp ZP_BYTE:14 15502.0
(byte) play_collision::i#3 i#3 zp ZP_BYTE:14 667.3333333333334
(byte) play_collision::i#3 i#3 zp ZP_BYTE:14 500.5
(byte) play_collision::l
(byte) play_collision::l#1 l zp ZP_BYTE:13 1001.0
(byte) play_collision::l#6 l zp ZP_BYTE:13 125.125
(byte) play_collision::l#6 l zp ZP_BYTE:13 117.76470588235294
(byte) play_collision::orientation
(byte) play_collision::orientation#0 reg byte x 2.0
(byte) play_collision::orientation#1 reg byte x 2.0
@ -494,26 +491,30 @@
(byte) play_collision::return#13 reg byte a 4.0
(byte) play_collision::return#14 reg byte a 4.0
(byte) play_collision::return#15 reg byte a 1.4285714285714284
(byte) play_collision::xp
(byte) play_collision::xp#1 xp zp ZP_BYTE:15 5000.5
(byte) play_collision::xp#2 xp zp ZP_BYTE:15 6375.75
(byte~) play_collision::xp#9 xp zp ZP_BYTE:15 2002.0
(byte) play_collision::xpos
(byte) play_collision::xpos#0 xpos zp ZP_BYTE:12 1.3333333333333333
(byte) play_collision::xpos#1 xpos zp ZP_BYTE:12 1.0
(byte) play_collision::xpos#2 xpos zp ZP_BYTE:12 1.0
(byte) play_collision::xpos#3 xpos zp ZP_BYTE:12 1.0
(byte) play_collision::xpos#4 xpos zp ZP_BYTE:12 1.3333333333333333
(byte) play_collision::xpos#6 xpos zp ZP_BYTE:12 45.95454545454545
(byte) play_collision::xpos#0 xpos zp ZP_BYTE:11 1.3333333333333333
(byte) play_collision::xpos#1 xpos zp ZP_BYTE:11 1.0
(byte) play_collision::xpos#2 xpos zp ZP_BYTE:11 1.0
(byte) play_collision::xpos#3 xpos zp ZP_BYTE:11 1.0
(byte) play_collision::xpos#4 xpos zp ZP_BYTE:11 1.3333333333333333
(byte) play_collision::xpos#6 xpos zp ZP_BYTE:11 45.95454545454545
(byte) play_collision::yp
(byte) play_collision::yp#0 yp zp ZP_BYTE:12 6.0
(byte) play_collision::yp#1 yp zp ZP_BYTE:12 500.5
(byte) play_collision::yp#2 yp zp ZP_BYTE:12 812.875
(byte) play_collision::ypos
(byte) play_collision::ypos#0 ypos zp ZP_BYTE:11 1.0
(byte) play_collision::ypos#1 ypos zp ZP_BYTE:11 1.3333333333333333
(byte) play_collision::ypos#2 ypos zp ZP_BYTE:11 1.3333333333333333
(byte) play_collision::ypos#3 ypos zp ZP_BYTE:11 1.3333333333333333
(byte) play_collision::ypos#4 ypos zp ZP_BYTE:11 2.0
(byte) play_collision::ypos#5 ypos zp ZP_BYTE:11 6.0
(byte) play_collision::ypos2
(byte) play_collision::ypos2#0 ypos2 zp ZP_BYTE:11 4.0
(byte) play_collision::ypos2#1 ypos2 zp ZP_BYTE:11 500.5
(byte) play_collision::ypos2#2 ypos2 zp ZP_BYTE:11 867.0666666666667
(byte) play_collision::ypos#0 ypos zp ZP_BYTE:12 1.0
(byte) play_collision::ypos#1 ypos zp ZP_BYTE:12 1.3333333333333333
(byte) play_collision::ypos#2 ypos zp ZP_BYTE:12 1.3333333333333333
(byte) play_collision::ypos#3 ypos zp ZP_BYTE:12 1.3333333333333333
(byte) play_collision::ypos#4 ypos zp ZP_BYTE:12 2.0
(void()) play_increase_level()
(byte~) play_increase_level::$1 reg byte a 4.0
(byte) play_increase_level::$5 reg byte a 4004.0
(label) play_increase_level::@1
(label) play_increase_level::@2
(label) play_increase_level::@3
@ -524,10 +525,9 @@
(byte) play_increase_level::b
(byte) play_increase_level::b#1 reg byte x 1501.5
(byte) play_increase_level::b#2 reg byte x 1001.0
(byte) play_increase_level::b4
(byte) play_increase_level::b4#0 reg byte a 4004.0
(void()) play_init()
(byte~) play_init::$2 reg byte x 22.0
(byte) play_init::$4 reg byte x 22.0
(byte) play_init::$5 reg byte a 33.0
(label) play_init::@1
(label) play_init::@2
(label) play_init::@3
@ -535,8 +535,6 @@
(byte) play_init::b
(byte) play_init::b#1 reg byte x 16.5
(byte) play_init::b#2 reg byte x 11.0
(byte) play_init::b4
(byte) play_init::b4#0 reg byte a 33.0
(byte) play_init::idx
(byte) play_init::idx#1 idx zp ZP_BYTE:2 7.333333333333333
(byte) play_init::idx#2 idx zp ZP_BYTE:2 6.6000000000000005
@ -547,6 +545,7 @@
(byte*) play_init::pli#1 pli zp ZP_WORD:5 5.5
(byte*) play_init::pli#2 pli zp ZP_WORD:5 8.25
(void()) play_lock_current()
(byte) play_lock_current::$4 reg byte a 2002.0
(label) play_lock_current::@1
(label) play_lock_current::@2
(label) play_lock_current::@3
@ -558,25 +557,25 @@
(byte) play_lock_current::c
(byte) play_lock_current::c#1 reg byte x 10001.0
(byte) play_lock_current::c#2 reg byte x 4000.4
(byte) play_lock_current::col
(byte) play_lock_current::col#0 col zp ZP_BYTE:10 2002.0
(byte) play_lock_current::col#1 col zp ZP_BYTE:10 5000.5
(byte) play_lock_current::col#2 col zp ZP_BYTE:10 7751.0
(byte) play_lock_current::i
(byte) play_lock_current::i#1 i zp ZP_BYTE:11 2333.6666666666665
(byte) play_lock_current::i#2 i#2 zp ZP_BYTE:9 15502.0
(byte) play_lock_current::i#3 i#3 zp ZP_BYTE:9 667.3333333333334
(byte) play_lock_current::i#3 i#3 zp ZP_BYTE:9 500.5
(byte~) play_lock_current::i#7 i#7 zp ZP_BYTE:9 2002.0
(byte~) play_lock_current::i#9 i#9 zp ZP_BYTE:9 20002.0
(byte) play_lock_current::l
(byte) play_lock_current::l#1 l zp ZP_BYTE:4 1001.0
(byte) play_lock_current::l#6 l zp ZP_BYTE:4 166.83333333333334
(byte) play_lock_current::l#6 l zp ZP_BYTE:4 154.0
(byte*) play_lock_current::playfield_line
(byte*) play_lock_current::playfield_line#0 playfield_line zp ZP_WORD:5 1100.2
(byte) play_lock_current::ypos2
(byte) play_lock_current::ypos2#0 ypos2 zp ZP_BYTE:16 4.0
(byte) play_lock_current::ypos2#1 ypos2 zp ZP_BYTE:16 500.5
(byte) play_lock_current::ypos2#2 ypos2 zp ZP_BYTE:16 273.1818181818182
(byte) play_lock_current::xp
(byte) play_lock_current::xp#0 xp zp ZP_BYTE:10 2002.0
(byte) play_lock_current::xp#1 xp zp ZP_BYTE:10 5000.5
(byte) play_lock_current::xp#2 xp zp ZP_BYTE:10 7751.0
(byte) play_lock_current::yp
(byte) play_lock_current::yp#0 yp zp ZP_BYTE:16 4.0
(byte) play_lock_current::yp#1 yp zp ZP_BYTE:16 500.5
(byte) play_lock_current::yp#2 yp zp ZP_BYTE:16 250.41666666666669
(byte()) play_move_down((byte) play_move_down::key_event)
(byte~) play_move_down::$12 reg byte a 4.0
(byte~) play_move_down::$2 reg byte a 4.0
@ -704,8 +703,8 @@
(byte) play_remove_lines::y#1 y zp ZP_BYTE:4 1501.5
(byte) play_remove_lines::y#8 y zp ZP_BYTE:4 133.46666666666667
(void()) play_spawn_current()
(byte~) play_spawn_current::$0 $0 zp ZP_BYTE:4 0.06666666666666667
(byte~) play_spawn_current::$2 reg byte a 4.0
(byte~) play_spawn_current::$1 reg byte a 4.0
(byte) play_spawn_current::$7 $7 zp ZP_BYTE:4 0.06666666666666667
(label) play_spawn_current::@1
(label) play_spawn_current::@2
(label) play_spawn_current::@3
@ -723,7 +722,7 @@
(void()) play_update_score((byte) play_update_score::removed)
(byte~) play_update_score::$2 reg byte a 4.0
(byte~) play_update_score::$4 reg byte a 4.0
(byte~) play_update_score::$5 reg byte a 4.0
(byte) play_update_score::$9 reg byte a 4.0
(label) play_update_score::@1
(label) play_update_score::@2
(label) play_update_score::@return
@ -776,8 +775,8 @@
(byte*) render_bcd::screen_pos#2 screen_pos zp ZP_WORD:7 4.0
(byte*) render_bcd::screen_pos#3 screen_pos zp ZP_WORD:7 2.0
(void()) render_init()
(byte~) render_init::$13 reg byte a 22.0
(byte~) render_init::$14 reg byte a 22.0
(byte) render_init::$14 reg byte a 22.0
(byte) render_init::$15 reg byte a 22.0
(label) render_init::@1
(label) render_init::@2
(label) render_init::@3
@ -804,7 +803,8 @@
(byte) render_init::vicSelectGfxBank1_toDd001_return
(const byte) render_init::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) $40
(void()) render_moving()
(byte~) render_moving::$2 reg byte a 202.0
(byte~) render_moving::$1 reg byte a 202.0
(byte) render_moving::$6 reg byte a 202.0
(label) render_moving::@1
(label) render_moving::@2
(label) render_moving::@3
@ -821,24 +821,24 @@
(byte) render_moving::i
(byte) render_moving::i#1 i zp ZP_BYTE:14 202.0
(byte) render_moving::i#2 i zp ZP_BYTE:14 500.5
(byte) render_moving::i#3 i zp ZP_BYTE:14 60.599999999999994
(byte) render_moving::i#3 i zp ZP_BYTE:14 50.5
(byte) render_moving::i#4 i zp ZP_BYTE:14 1552.0
(byte) render_moving::i#8 i zp ZP_BYTE:14 300.75
(byte) render_moving::l
(byte) render_moving::l#1 l zp ZP_BYTE:13 151.5
(byte) render_moving::l#4 l zp ZP_BYTE:13 12.625
(byte) render_moving::l#4 l zp ZP_BYTE:13 11.882352941176471
(byte*) render_moving::screen_line
(byte*) render_moving::screen_line#0 screen_line zp ZP_WORD:7 110.19999999999999
(byte) render_moving::xpos
(byte) render_moving::xpos#0 xpos zp ZP_BYTE:15 202.0
(byte) render_moving::xpos#1 xpos zp ZP_BYTE:15 667.3333333333334
(byte) render_moving::xpos#2 xpos zp ZP_BYTE:15 620.8
(byte) render_moving::ypos2
(byte) render_moving::ypos2#0 ypos2 zp ZP_BYTE:12 4.0
(byte) render_moving::ypos2#1 ypos2 zp ZP_BYTE:12 67.33333333333333
(byte) render_moving::ypos2#2 ypos2 zp ZP_BYTE:12 27.06666666666667
(byte) render_moving::ypos
(byte) render_moving::ypos#0 ypos zp ZP_BYTE:12 4.0
(byte) render_moving::ypos#1 ypos zp ZP_BYTE:12 67.33333333333333
(byte) render_moving::ypos#2 ypos zp ZP_BYTE:12 25.375
(void()) render_next()
(byte~) render_next::$4 reg byte y 1.0
(byte) render_next::$9 reg byte y 1.0
(label) render_next::@1
(label) render_next::@2
(label) render_next::@3
@ -873,7 +873,7 @@
(byte*) render_next::screen_next_area#5 screen_next_area zp ZP_WORD:7 684.1666666666667
(void()) render_playfield()
(byte~) render_playfield::$2 reg byte a 202.0
(byte~) render_playfield::$3 reg byte a 202.0
(byte) render_playfield::$6 reg byte a 202.0
(label) render_playfield::@1
(label) render_playfield::@2
(label) render_playfield::@3
@ -960,7 +960,7 @@
(byte) render_screen_render#15 reg byte a 13.0
(byte) render_screen_render#18 render_screen_render zp ZP_BYTE:3 0.923076923076923
(byte) render_screen_render#22 reg byte x 8.615384615384615
(byte) render_screen_render#33 render_screen_render#33 zp ZP_BYTE:9 5.6
(byte) render_screen_render#33 render_screen_render#33 zp ZP_BYTE:9 5.333333333333333
(byte~) render_screen_render#68 reg byte a 11.0
(byte~) render_screen_render#69 render_screen_render#69 zp ZP_BYTE:9 5.5
(byte~) render_screen_render#70 reg byte x 22.0
@ -1073,7 +1073,7 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq()
zp ZP_BYTE:2 [ render_screen_show#16 render_screen_show#13 play_init::idx#2 play_init::idx#1 sprites_init::xpos#2 sprites_init::xpos#1 render_screen_original::y#6 render_screen_original::y#1 ]
zp ZP_BYTE:3 [ render_screen_render#18 render_screen_render#11 ]
zp ZP_BYTE:4 [ current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 play_remove_lines::y#8 play_remove_lines::y#1 play_lock_current::l#6 play_lock_current::l#1 play_spawn_current::$0 play_update_score::lines_before#0 ]
zp ZP_BYTE:4 [ current_movedown_counter#16 current_movedown_counter#14 current_movedown_counter#12 play_remove_lines::y#8 play_remove_lines::y#1 play_lock_current::l#6 play_lock_current::l#1 play_spawn_current::$7 play_update_score::lines_before#0 ]
zp ZP_WORD:5 [ render_score::screen#3 render_bcd::screen#6 render_bcd::screen#0 render_bcd::screen#1 render_bcd::screen#2 render_bcd::screen#3 render_bcd::screen#4 render_bcd::screen#5 render_next::next_piece_gfx#2 render_next::next_piece_gfx#3 render_next::next_piece_gfx#1 render_next::next_piece_gfx#9 current_piece_gfx#64 current_piece_gfx#120 current_piece_gfx#121 render_playfield::screen_line#2 render_playfield::screen_line#0 render_playfield::screen_line#1 current_piece#17 current_piece#100 current_piece#101 current_piece#102 current_piece#103 current_piece#104 play_collision::piece_gfx#0 play_init::pli#2 play_init::pli#1 render_init::li_1#2 render_init::li_1#1 render_screen_original::oscr#2 render_screen_original::oscr#4 render_screen_original::oscr#1 play_lock_current::playfield_line#0 ]
zp ZP_WORD:7 [ render_bcd::offset#6 render_bcd::screen_pos#3 render_bcd::screen_pos#0 render_bcd::screen_pos#2 render_next::screen_next_area#5 render_next::screen_next_area#10 render_next::screen_next_area#4 render_next::screen_next_area#11 render_next::screen_next_area#3 render_init::li_2#2 render_init::li_2#1 render_screen_original::ocols#2 render_screen_original::ocols#4 render_screen_original::ocols#1 render_moving::screen_line#0 play_collision::playfield_line#0 ]
reg byte y [ render_bcd::only_low#6 ]
@ -1083,12 +1083,12 @@ reg byte x [ next_piece_idx#12 next_piece_idx#84 next_piece_idx#85 ]
zp ZP_BYTE:9 [ render_next::l#7 render_next::l#1 render_screen_render#33 render_screen_render#69 render_playfield::l#2 render_playfield::l#1 play_movement::return#2 play_movement::render#1 play_movement::return#0 play_movement::render#2 play_remove_lines::removed#11 play_remove_lines::removed#8 play_remove_lines::removed#1 play_lock_current::i#2 play_lock_current::i#3 play_lock_current::i#7 play_lock_current::i#9 keyboard_event_pressed::keycode#5 keyboard_event_scan::row#2 keyboard_event_scan::row#1 ]
reg byte x [ render_next::c#2 render_next::c#1 ]
reg byte x [ current_ypos#13 current_ypos#106 current_ypos#107 ]
zp ZP_BYTE:10 [ current_xpos#59 current_xpos#130 current_xpos#131 render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 play_move_rotate::orientation#3 play_move_rotate::orientation#1 play_move_rotate::orientation#2 play_remove_lines::x#2 play_remove_lines::x#1 play_lock_current::col#2 play_lock_current::col#0 play_lock_current::col#1 keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#15 keyboard_event_scan::keycode#1 render_next::next_piece_char#0 keyboard_event_pressed::row_bits#0 ]
zp ZP_BYTE:11 [ current_piece_char#68 current_piece_char#108 current_piece_char#109 render_playfield::c#2 render_playfield::c#1 play_collision::ypos#5 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::ypos2#2 play_collision::ypos2#0 play_collision::ypos2#1 play_remove_lines::full#4 play_remove_lines::full#2 play_lock_current::i#1 keyboard_event_scan::row_scan#0 ]
zp ZP_BYTE:12 [ render_moving::ypos2#2 render_moving::ypos2#0 render_moving::ypos2#1 play_collision::xpos#6 play_collision::xpos#0 play_collision::xpos#1 play_collision::xpos#2 play_collision::xpos#3 play_collision::xpos#4 play_remove_lines::c#0 ]
zp ZP_BYTE:10 [ current_xpos#59 current_xpos#130 current_xpos#131 render_playfield::i#2 render_playfield::i#3 render_playfield::i#1 play_move_rotate::orientation#3 play_move_rotate::orientation#1 play_move_rotate::orientation#2 play_remove_lines::x#2 play_remove_lines::x#1 play_lock_current::xp#2 play_lock_current::xp#0 play_lock_current::xp#1 keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#15 keyboard_event_scan::keycode#1 render_next::next_piece_char#0 keyboard_event_pressed::row_bits#0 ]
zp ZP_BYTE:11 [ current_piece_char#68 current_piece_char#108 current_piece_char#109 render_playfield::c#2 render_playfield::c#1 play_collision::xpos#6 play_collision::xpos#0 play_collision::xpos#1 play_collision::xpos#2 play_collision::xpos#3 play_collision::xpos#4 play_remove_lines::full#4 play_remove_lines::full#2 play_lock_current::i#1 keyboard_event_scan::row_scan#0 ]
zp ZP_BYTE:12 [ render_moving::ypos#2 render_moving::ypos#0 render_moving::ypos#1 play_collision::yp#2 play_collision::yp#0 play_collision::ypos#0 play_collision::ypos#1 play_collision::ypos#2 play_collision::ypos#3 play_collision::ypos#4 play_collision::yp#1 play_remove_lines::c#0 ]
zp ZP_BYTE:13 [ render_moving::l#4 render_moving::l#1 play_collision::l#6 play_collision::l#1 ]
zp ZP_BYTE:14 [ render_moving::i#4 render_moving::i#3 render_moving::i#8 render_moving::i#2 render_moving::i#1 play_collision::i#2 play_collision::i#3 play_collision::i#11 play_collision::i#13 ]
zp ZP_BYTE:15 [ render_moving::xpos#2 render_moving::xpos#0 render_moving::xpos#1 play_collision::col#2 play_collision::col#9 play_collision::col#1 ]
zp ZP_BYTE:15 [ render_moving::xpos#2 render_moving::xpos#0 render_moving::xpos#1 play_collision::xp#2 play_collision::xp#9 play_collision::xp#1 ]
reg byte x [ render_moving::c#2 render_moving::c#1 ]
reg byte x [ render_screen_render#22 render_screen_render#70 ]
reg byte a [ play_move_rotate::return#2 ]
@ -1097,7 +1097,7 @@ reg byte x [ play_collision::c#2 play_collision::c#1 ]
reg byte a [ play_collision::return#15 ]
reg byte a [ play_move_leftright::return#2 ]
reg byte x [ play_move_down::movedown#6 play_move_down::movedown#7 play_move_down::movedown#10 play_move_down::movedown#2 play_move_down::movedown#3 ]
zp ZP_BYTE:16 [ current_ypos#38 current_ypos#3 current_ypos#100 current_ypos#19 current_ypos#6 play_lock_current::ypos2#2 play_lock_current::ypos2#0 play_lock_current::ypos2#1 ]
zp ZP_BYTE:16 [ current_ypos#38 current_ypos#3 current_ypos#100 current_ypos#19 current_ypos#6 play_lock_current::yp#2 play_lock_current::yp#0 play_lock_current::yp#1 ]
zp ZP_WORD:17 [ lines_bcd#26 lines_bcd#19 lines_bcd#15 lines_bcd#17 lines_bcd#30 render_screen_original::screen#7 render_screen_original::screen#6 render_screen_original::screen#5 render_screen_original::screen#8 render_screen_original::screen#9 render_screen_original::screen#10 render_screen_original::screen#2 render_screen_original::screen#3 ]
zp ZP_DWORD:19 [ score_bcd#26 score_bcd#18 score_bcd#14 score_bcd#16 score_bcd#30 ]
zp ZP_BYTE:23 [ level#33 level#10 level#17 level#19 level#21 ]
@ -1139,12 +1139,13 @@ reg byte a [ render_bcd::$5 ]
reg byte a [ render_bcd::$6 ]
reg byte a [ render_bcd::$3 ]
reg byte a [ render_bcd::$4 ]
reg byte y [ render_next::$4 ]
reg byte y [ render_next::$9 ]
reg byte a [ render_next::cell#0 ]
reg byte a [ render_moving::$2 ]
reg byte a [ render_moving::$1 ]
reg byte a [ render_moving::$6 ]
reg byte a [ render_moving::current_cell#0 ]
reg byte a [ render_playfield::$2 ]
reg byte a [ render_playfield::$3 ]
reg byte a [ render_playfield::$6 ]
reg byte a [ play_move_down::key_event#0 ]
reg byte a [ play_move_down::return#0 ]
reg byte a [ play_move_leftright::key_event#0 ]
@ -1157,8 +1158,9 @@ reg byte x [ play_move_rotate::$5 ]
reg byte a [ play_collision::return#14 ]
reg byte a [ play_move_rotate::$2 ]
reg byte x [ play_move_rotate::$7 ]
reg byte a [ play_collision::$14 ]
zp ZP_BYTE:43 [ play_collision::i#1 ]
reg byte a [ play_collision::$7 ]
reg byte a [ play_collision::$5 ]
reg byte a [ play_collision::return#13 ]
reg byte a [ play_move_leftright::$4 ]
reg byte a [ play_collision::return#1 ]
@ -1172,15 +1174,16 @@ reg byte a [ play_move_down::removed#0 ]
reg byte x [ play_update_score::removed#0 ]
reg byte x [ play_spawn_current::current_piece_idx#0 ]
reg byte a [ play_collision::return#10 ]
reg byte a [ play_spawn_current::$2 ]
reg byte a [ play_spawn_current::$1 ]
reg byte a [ play_spawn_current::sid_rnd1_return#0 ]
reg byte a [ play_update_score::$2 ]
reg byte a [ play_update_score::$4 ]
reg byte a [ play_update_score::$9 ]
zp ZP_DWORD:44 [ play_update_score::add_bcd#0 ]
reg byte a [ play_update_score::$5 ]
reg byte a [ play_update_score::$4 ]
reg byte a [ play_update_score::lines_after#0 ]
reg byte a [ play_increase_level::$1 ]
reg byte a [ play_increase_level::b4#0 ]
reg byte a [ play_increase_level::$5 ]
reg byte a [ play_lock_current::$4 ]
reg byte a [ keyboard_event_pressed::$0 ]
reg byte a [ keyboard_event_pressed::$1 ]
reg byte a [ keyboard_event_pressed::return#11 ]
@ -1199,11 +1202,11 @@ reg byte a [ keyboard_event_scan::$16 ]
reg byte a [ keyboard_event_scan::event_type#0 ]
reg byte a [ keyboard_event_scan::$23 ]
reg byte a [ keyboard_matrix_read::return#0 ]
reg byte x [ play_init::$2 ]
reg byte a [ play_init::b4#0 ]
reg byte x [ play_init::$4 ]
reg byte a [ play_init::$5 ]
reg byte x [ sprites_init::s2#0 ]
reg byte a [ render_init::$13 ]
reg byte a [ render_init::$14 ]
reg byte a [ render_init::$15 ]
reg byte a [ sprites_irq::ypos#0 ]
reg byte x [ sprites_irq::$0 ]
reg byte x [ sprites_irq::ptr#0 ]

View File

@ -119,14 +119,18 @@ plexShowSprite: {
lda PLEX_PTR,y
ldx plex_sprite_idx
sta PLEX_SCREEN_PTR,x
ldx plex_show_idx
lda PLEX_SORTED_IDX,x
ldy plex_show_idx
ldx PLEX_SORTED_IDX,y
txa
asl
tax
lda PLEX_XPOS,x
tay
lda PLEX_XPOS,y
ldy plex_sprite_idx2
sta SPRITES_XPOS,y
lda PLEX_XPOS+1,x
txa
asl
tay
lda PLEX_XPOS+1,y
cmp #0
bne b1
lda #$ff

View File

@ -102,112 +102,114 @@ plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite
to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1
[43] *((const byte*) PLEX_SCREEN_PTR#1 + (byte) plex_sprite_idx#44) ← *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#44))
[44] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#44) << (byte/signed byte/word/signed word/dword/signed dword) 1
[45] (byte~) plexShowSprite::$3 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0)
[46] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$3
[47] (byte~) plexShowSprite::$4 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0)
[48] if((byte~) plexShowSprite::$4!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1
[44] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#44)
[45] (byte) plexShowSprite::$10 ← (byte) plexShowSprite::xpos_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[46] (byte~) plexShowSprite::$2 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::$10)
[47] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2
[48] (byte) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[49] (byte~) plexShowSprite::$3 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::$11)
[50] if((byte~) plexShowSprite::$3!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1
to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@4
[49] (byte/word/dword~) plexShowSprite::$10 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#44
[50] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$10
[51] (byte/word/dword~) plexShowSprite::$9 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#44
[52] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$9
to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3
[51] (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 ← (byte) plex_sprite_idx#44 + (byte/signed byte/word/signed word/dword/signed dword) 1
[52] (byte) plex_sprite_idx#15 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 & (byte/signed byte/word/signed word/dword/signed dword) 7
[53] (byte) plex_show_idx#15 ← ++ (byte) plex_show_idx#44
[54] (byte) plex_sprite_msb#25 ← (byte) plex_sprite_msb#44 << (byte/signed byte/word/signed word/dword/signed dword) 1
[55] if((byte) plex_sprite_msb#25!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@5
[53] (byte/signed word/word/dword/signed dword~) plexShowSprite::$5 ← (byte) plex_sprite_idx#44 + (byte/signed byte/word/signed word/dword/signed dword) 1
[54] (byte) plex_sprite_idx#15 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$5 & (byte/signed byte/word/signed word/dword/signed dword) 7
[55] (byte) plex_show_idx#15 ← ++ (byte) plex_show_idx#44
[56] (byte) plex_sprite_msb#25 ← (byte) plex_sprite_msb#44 << (byte/signed byte/word/signed word/dword/signed dword) 1
[57] if((byte) plex_sprite_msb#25!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@5
to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@5
[56] (byte) plex_sprite_msb#16 ← phi( plexShowSprite::@5/(byte) plex_sprite_msb#25 plexShowSprite::@2/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[57] return
[58] (byte) plex_sprite_msb#16 ← phi( plexShowSprite::@5/(byte) plex_sprite_msb#25 plexShowSprite::@2/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[59] return
to:@return
plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::@2
[58] phi()
[60] phi()
to:plexShowSprite::@return
plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@4
[59] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#44
[61] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#44
to:plexShowSprite::@2
plexSort: scope:[plexSort] from loop::@5
[60] phi()
[62] phi()
to:plexSort::@1
plexSort::@1: scope:[plexSort] from plexSort plexSort::@2
[61] (byte) plexSort::m#2 ← phi( plexSort/(byte/signed byte/word/signed word/dword/signed dword) 0 plexSort::@2/(byte) plexSort::m#1 )
[62] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::m#2)
[63] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) plexSort::nxt_idx#0)
[64] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::m#2))) goto plexSort::@2
[63] (byte) plexSort::m#2 ← phi( plexSort/(byte/signed byte/word/signed word/dword/signed dword) 0 plexSort::@2/(byte) plexSort::m#1 )
[64] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::m#2)
[65] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) plexSort::nxt_idx#0)
[66] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::m#2))) goto plexSort::@2
to:plexSort::@6
plexSort::@6: scope:[plexSort] from plexSort::@1
[65] (byte~) plexSort::s#6 ← (byte) plexSort::m#2
[67] (byte~) plexSort::s#6 ← (byte) plexSort::m#2
to:plexSort::@3
plexSort::@3: scope:[plexSort] from plexSort::@5 plexSort::@6
[66] (byte) plexSort::s#3 ← phi( plexSort::@5/(byte) plexSort::s#1 plexSort::@6/(byte~) plexSort::s#6 )
[67] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#3)
[68] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3
[69] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@5
[68] (byte) plexSort::s#3 ← phi( plexSort::@5/(byte) plexSort::s#1 plexSort::@6/(byte~) plexSort::s#6 )
[69] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#3)
[70] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3
[71] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@5
to:plexSort::@4
plexSort::@4: scope:[plexSort] from plexSort::@3 plexSort::@5
[70] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1
[71] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0
[72] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1
[73] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0
to:plexSort::@2
plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4
[72] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2
[73] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexSort::@1
[74] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2
[75] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexSort::@1
to:plexSort::plexFreePrepare1
plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@2
[74] phi()
[76] phi()
to:plexSort::plexFreePrepare1_@1
plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1
[75] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte/signed byte/word/signed word/dword/signed dword) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 )
[76] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[77] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2
[78] if((byte) plexSort::plexFreePrepare1_s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto plexSort::plexFreePrepare1_@1
[77] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte/signed byte/word/signed word/dword/signed dword) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 )
[78] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[79] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2
[80] if((byte) plexSort::plexFreePrepare1_s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto plexSort::plexFreePrepare1_@1
to:plexSort::@return
plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@1
[79] return
[81] return
to:@return
plexSort::@5: scope:[plexSort] from plexSort::@3
[80] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3
[82] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3
to:plexSort::@4
init: scope:[init] from main
[81] *((const byte*) D011#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[82] call plexInit
[83] *((const byte*) D011#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3
[84] call plexInit
to:init::@1
init::@1: scope:[init] from init init::@1
[83] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte/signed byte/word/signed word/dword/signed dword) $20 )
[83] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[84] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40
[85] (byte~) init::$6 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[86] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte~) init::$6) ← (word) init::xp#2
[87] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9
[88] (byte) init::sx#1 ← ++ (byte) init::sx#2
[89] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1
[85] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte/signed byte/word/signed word/dword/signed dword) $20 )
[85] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[86] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40
[87] (byte) init::$8 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[88] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) init::$8) ← (word) init::xp#2
[89] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9
[90] (byte) init::sx#1 ← ++ (byte) init::sx#2
[91] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1
to:init::@2
init::@2: scope:[init] from init::@1
[90] *((const byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff
[92] *((const byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff
to:init::@3
init::@3: scope:[init] from init::@2 init::@3
[91] (byte) init::ss#2 ← phi( init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 init::@3/(byte) init::ss#1 )
[92] *((const byte*) SPRITES_COLS#0 + (byte) init::ss#2) ← (const byte) GREEN#0
[93] (byte) init::ss#1 ← ++ (byte) init::ss#2
[94] if((byte) init::ss#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto init::@3
[93] (byte) init::ss#2 ← phi( init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 init::@3/(byte) init::ss#1 )
[94] *((const byte*) SPRITES_COLS#0 + (byte) init::ss#2) ← (const byte) GREEN#0
[95] (byte) init::ss#1 ← ++ (byte) init::ss#2
[96] if((byte) init::ss#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto init::@3
to:init::@return
init::@return: scope:[init] from init::@3
[95] return
[97] return
to:@return
plexInit: scope:[plexInit] from init
[96] phi()
[98] phi()
to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit] from plexInit
[97] phi()
[99] phi()
to:plexInit::@1
plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::plexSetScreen1
[98] (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::plexSetScreen1/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[99] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexInit::i#2) ← (byte) plexInit::i#2
[100] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2
[101] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexInit::@1
[100] (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::plexSetScreen1/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[101] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexInit::i#2) ← (byte) plexInit::i#2
[102] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2
[103] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexInit::@1
to:plexInit::@return
plexInit::@return: scope:[plexInit] from plexInit::@1
[102] return
[104] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -49,7 +49,7 @@
(byte*) YSIN
(const byte*) YSIN#0 YSIN = ((byte*))(word/signed word/dword/signed dword) $2100
(void()) init()
(byte~) init::$6 reg byte a 22.0
(byte) init::$8 reg byte a 22.0
(label) init::@1
(label) init::@2
(label) init::@3
@ -108,10 +108,12 @@
(byte*) plexInit::plexSetScreen1_screen
(byte*) plexInit::screen
(void()) plexShowSprite()
(byte/word/dword~) plexShowSprite::$10 reg byte a 4.0
(byte) plexShowSprite::$10 reg byte a 4.0
(byte) plexShowSprite::$11 reg byte a 4.0
(byte~) plexShowSprite::$2 reg byte a 4.0
(byte~) plexShowSprite::$3 reg byte a 4.0
(byte~) plexShowSprite::$4 reg byte a 4.0
(byte/signed word/word/dword/signed dword~) plexShowSprite::$6 reg byte x 4.0
(byte/signed word/word/dword/signed dword~) plexShowSprite::$5 reg byte x 4.0
(byte/word/dword~) plexShowSprite::$9 reg byte a 4.0
(label) plexShowSprite::@1
(label) plexShowSprite::@2
(label) plexShowSprite::@3
@ -127,9 +129,9 @@
(byte) plexShowSprite::plexFreeAdd1_ypos
(byte) plexShowSprite::plexFreeAdd1_ypos#0 reg byte a 3.0
(byte) plexShowSprite::plex_sprite_idx2
(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp ZP_BYTE:10 0.6000000000000001
(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp ZP_BYTE:10 0.5454545454545454
(byte) plexShowSprite::xpos_idx
(byte) plexShowSprite::xpos_idx#0 reg byte x 2.0
(byte) plexShowSprite::xpos_idx#0 reg byte x 1.5
(byte) plexShowSprite::ypos
(void()) plexSort()
(label) plexSort::@1
@ -158,18 +160,18 @@
(byte) plexSort::s#3 reg byte x 2052.5
(byte~) plexSort::s#6 reg byte x 202.0
(byte) plex_free_next
(byte) plex_free_next#13 plex_free_next zp ZP_BYTE:3 4.904761904761904
(byte) plex_free_next#13 plex_free_next zp ZP_BYTE:3 4.478260869565218
(byte) plex_free_next#17 plex_free_next zp ZP_BYTE:3 20.599999999999998
(byte) plex_show_idx
(byte) plex_show_idx#15 plex_show_idx zp ZP_BYTE:5 11.444444444444443
(byte) plex_show_idx#44 plex_show_idx zp ZP_BYTE:5 4.73913043478261
(byte) plex_show_idx#44 plex_show_idx zp ZP_BYTE:5 4.36
(byte) plex_sprite_idx
(byte) plex_sprite_idx#15 plex_sprite_idx zp ZP_BYTE:4 10.299999999999999
(byte) plex_sprite_idx#44 plex_sprite_idx zp ZP_BYTE:4 5.095238095238094
(byte) plex_sprite_idx#44 plex_sprite_idx zp ZP_BYTE:4 4.652173913043479
(byte) plex_sprite_msb
(byte) plex_sprite_msb#16 plex_sprite_msb zp ZP_BYTE:6 20.599999999999998
(byte) plex_sprite_msb#25 plex_sprite_msb zp ZP_BYTE:6 2.0
(byte) plex_sprite_msb#44 plex_sprite_msb zp ZP_BYTE:6 4.458333333333332
(byte) plex_sprite_msb#44 plex_sprite_msb zp ZP_BYTE:6 4.115384615384615
zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ]
reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ]
@ -191,9 +193,11 @@ reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ]
reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ]
reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ]
reg byte x [ plexShowSprite::xpos_idx#0 ]
reg byte a [ plexShowSprite::$3 ]
reg byte a [ plexShowSprite::$4 ]
reg byte a [ plexShowSprite::$10 ]
reg byte x [ plexShowSprite::$6 ]
reg byte a [ plexShowSprite::$2 ]
reg byte a [ plexShowSprite::$11 ]
reg byte a [ plexShowSprite::$3 ]
reg byte a [ plexShowSprite::$9 ]
reg byte x [ plexShowSprite::$5 ]
reg byte x [ plexSort::s#2 ]
reg byte a [ init::$6 ]
reg byte a [ init::$8 ]

View File

@ -52,20 +52,17 @@ main: {
b1:
jsr point_init
lda i
lsr
tax
ldy i
asl
tay
lda x_start,y
sta bitmap_plot.x
lda x_start+1,y
sta bitmap_plot.x+1
ldy y_start,x
ldy i
ldx y_start,y
jsr bitmap_plot
lda i
clc
adc #2
sta i
lda #8
inc i
lda #4
cmp i
bne b1
b2:
@ -76,15 +73,15 @@ main: {
jmp b2
}
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage(3) x, byte register(Y) y)
// bitmap_plot(word zeropage(3) x, byte register(X) y)
bitmap_plot: {
.label _1 = 7
.label x = 3
.label plotter = 5
.label _3 = 5
lda bitmap_plot_yhi,y
lda bitmap_plot_yhi,x
sta _3+1
lda bitmap_plot_ylo,y
lda bitmap_plot_ylo,x
sta _3
lda x
and #<$fff8
@ -110,13 +107,12 @@ bitmap_plot: {
// Initialize the points to be animated
// point_init(byte zeropage(2) point_idx)
point_init: {
.label _4 = 7
.label _5 = 3
.label _3 = 7
.label _4 = 3
.label _9 = 3
.label _10 = 3
.label _11 = 3
.label _12 = 3
.label point_idx = 2
.label point_idx1 = $b
.label y_diff = 7
.label abs16s1__2 = 3
.label abs16s1_return = 3
@ -125,31 +121,33 @@ point_init: {
.label x_stepf = 5
.label x_diff = 9
lda point_idx
lsr
sta point_idx1
ldy point_idx
asl
tax
lda point_idx
asl
tay
sec
lda x_end,y
lda x_end,x
sbc x_start,y
sta x_diff
lda x_end+1,y
lda x_end+1,x
sbc x_start+1,y
sta x_diff+1
ldy point_idx1
ldy point_idx
lda y_end,y
sta _3
lda #0
sta _3+1
lda y_start,y
sta _4
lda #0
sta _4+1
lda y_start,y
sta _5
lda #0
sta _5+1
lda y_diff
sec
sbc _5
sbc _4
sta y_diff
lda y_diff+1
sbc _5+1
sbc _4+1
sta y_diff+1
lda x_diff+1
bpl !abs16s1_b1+
@ -178,43 +176,50 @@ point_init: {
bcc b1
!:
b2:
ldy point_idx
lda point_idx
asl
tay
lda x_start,y
sta _10
sta _9
lda x_start+1,y
sta _10+1
asl _10
rol _10+1
asl _10
rol _10+1
asl _10
rol _10+1
asl _10
rol _10+1
lda _10
sta _9+1
asl _9
rol _9+1
asl _9
rol _9+1
asl _9
rol _9+1
asl _9
rol _9+1
lda point_idx
asl
tay
lda _9
sta x_cur,y
lda _10+1
lda _9+1
sta x_cur+1,y
ldy point_idx1
lda y_start,y
sta _11
lda #0
sta _11+1
asl _12
rol _12+1
asl _12
rol _12+1
asl _12
rol _12+1
asl _12
rol _12+1
ldy point_idx
lda _12
lda y_start,y
sta _10
lda #0
sta _10+1
asl _11
rol _11+1
asl _11
rol _11+1
asl _11
rol _11+1
asl _11
rol _11+1
tya
asl
tay
lda _11
sta y_cur,y
lda _12+1
lda _11+1
sta y_cur+1,y
lda #DELAY
ldy point_idx1
ldy point_idx
sta delay,y
rts
b1:
@ -232,7 +237,7 @@ point_init: {
lsr
lsr
lsr
ldy point_idx1
ldy point_idx
sta y_add,y
jmp b2
b4:

View File

@ -43,14 +43,14 @@ main::@1: scope:[main] from main::@6 main::@8
[20] call point_init
to:main::@7
main::@7: scope:[main] from main::@1
[21] (byte~) main::$9 ← (byte) main::i#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[22] (word) bitmap_plot::x#0 ← *((const word[4]) x_start#0 + (byte) main::i#2)
[23] (byte) bitmap_plot::y#0 ← *((const byte[4]) y_start#0 + (byte~) main::$9)
[21] (byte) main::$12 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[22] (word) bitmap_plot::x#0 ← *((const word[4]) x_start#0 + (byte) main::$12)
[23] (byte) bitmap_plot::y#0 ← *((const byte[4]) y_start#0 + (byte) main::i#2)
[24] call bitmap_plot
to:main::@8
main::@8: scope:[main] from main::@7
[25] (byte) main::i#1 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 2
[26] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@1
[25] (byte) main::i#1 ← ++ (byte) main::i#2
[26] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@2 main::@3 main::@8
[27] if(*((const byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@2
@ -69,241 +69,245 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot
[34] return
to:@return
point_init: scope:[point_init] from main::@1
[35] (byte) point_init::point_idx1#0 ← (byte) point_init::point_idx#0 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[36] (signed word) point_init::x_diff#1 ← (signed word)*((const word[4]) x_end#0 + (byte) point_init::point_idx#0) - (signed word)*((const word[4]) x_start#0 + (byte) point_init::point_idx#0)
[37] (signed word~) point_init::$4 ← ((signed word)) *((const byte[4]) y_end#0 + (byte) point_init::point_idx1#0)
[38] (signed word~) point_init::$5 ← ((signed word)) *((const byte[4]) y_start#0 + (byte) point_init::point_idx1#0)
[39] (signed word) point_init::y_diff#0 ← (signed word~) point_init::$4 - (signed word~) point_init::$5
[35] (byte) point_init::$18 ← (byte) point_init::point_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[36] (byte) point_init::$19 ← (byte) point_init::point_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[37] (signed word) point_init::x_diff#1 ← (signed word)*((const word[4]) x_end#0 + (byte) point_init::$18) - (signed word)*((const word[4]) x_start#0 + (byte) point_init::$19)
[38] (signed word~) point_init::$3 ← ((signed word)) *((const byte[4]) y_end#0 + (byte) point_init::point_idx#0)
[39] (signed word~) point_init::$4 ← ((signed word)) *((const byte[4]) y_start#0 + (byte) point_init::point_idx#0)
[40] (signed word) point_init::y_diff#0 ← (signed word~) point_init::$3 - (signed word~) point_init::$4
to:point_init::abs16s1
point_init::abs16s1: scope:[point_init] from point_init
[40] if((signed word) point_init::x_diff#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto point_init::abs16s1_@1
[41] if((signed word) point_init::x_diff#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto point_init::abs16s1_@1
to:point_init::@8
point_init::@8: scope:[point_init] from point_init::abs16s1
[41] (word~) point_init::abs16s1_return#6 ← (word)(signed word) point_init::x_diff#1
[42] (word~) point_init::abs16s1_return#6 ← (word)(signed word) point_init::x_diff#1
to:point_init::abs16s1_@return
point_init::abs16s1_@return: scope:[point_init] from point_init::@8 point_init::abs16s1_@1
[42] (word) point_init::abs16s1_return#2 ← phi( point_init::abs16s1_@1/(word~) point_init::abs16s1_return#5 point_init::@8/(word~) point_init::abs16s1_return#6 )
[43] (word) point_init::abs16s1_return#2 ← phi( point_init::abs16s1_@1/(word~) point_init::abs16s1_return#5 point_init::@8/(word~) point_init::abs16s1_return#6 )
to:point_init::abs16s2
point_init::abs16s2: scope:[point_init] from point_init::abs16s1_@return
[43] if((signed word) point_init::y_diff#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto point_init::abs16s2_@1
[44] if((signed word) point_init::y_diff#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto point_init::abs16s2_@1
to:point_init::@9
point_init::@9: scope:[point_init] from point_init::abs16s2
[44] (word~) point_init::abs16s2_return#6 ← (word)(signed word) point_init::y_diff#0
[45] (word~) point_init::abs16s2_return#6 ← (word)(signed word) point_init::y_diff#0
to:point_init::abs16s2_@return
point_init::abs16s2_@return: scope:[point_init] from point_init::@9 point_init::abs16s2_@1
[45] (word) point_init::abs16s2_return#2 ← phi( point_init::abs16s2_@1/(word~) point_init::abs16s2_return#5 point_init::@9/(word~) point_init::abs16s2_return#6 )
[46] (word) point_init::abs16s2_return#2 ← phi( point_init::abs16s2_@1/(word~) point_init::abs16s2_return#5 point_init::@9/(word~) point_init::abs16s2_return#6 )
to:point_init::@6
point_init::@6: scope:[point_init] from point_init::abs16s2_@return
[46] if((word) point_init::abs16s1_return#2>(word) point_init::abs16s2_return#2) goto point_init::@1
[47] if((word) point_init::abs16s1_return#2>(word) point_init::abs16s2_return#2) goto point_init::@1
to:point_init::@2
point_init::@2: scope:[point_init] from point_init::@6 point_init::@7
[47] (word~) point_init::$10 ← *((const word[4]) x_start#0 + (byte) point_init::point_idx#0) << (byte/signed byte/word/signed word/dword/signed dword) 4
[48] *((const word[4]) x_cur#0 + (byte) point_init::point_idx#0) ← (word~) point_init::$10
[49] (word~) point_init::$11 ← ((word)) *((const byte[4]) y_start#0 + (byte) point_init::point_idx1#0)
[50] (word~) point_init::$12 ← (word~) point_init::$11 << (byte/signed byte/word/signed word/dword/signed dword) 4
[51] *((const word[4]) y_cur#0 + (byte) point_init::point_idx#0) ← (word~) point_init::$12
[52] *((const byte[4]) delay#0 + (byte) point_init::point_idx1#0) ← (const byte) DELAY#0
[48] (byte) point_init::$20 ← (byte) point_init::point_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[49] (word~) point_init::$9 ← *((const word[4]) x_start#0 + (byte) point_init::$20) << (byte/signed byte/word/signed word/dword/signed dword) 4
[50] (byte) point_init::$21 ← (byte) point_init::point_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[51] *((const word[4]) x_cur#0 + (byte) point_init::$21) ← (word~) point_init::$9
[52] (word~) point_init::$10 ← ((word)) *((const byte[4]) y_start#0 + (byte) point_init::point_idx#0)
[53] (word~) point_init::$11 ← (word~) point_init::$10 << (byte/signed byte/word/signed word/dword/signed dword) 4
[54] (byte) point_init::$22 ← (byte) point_init::point_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[55] *((const word[4]) y_cur#0 + (byte) point_init::$22) ← (word~) point_init::$11
[56] *((const byte[4]) delay#0 + (byte) point_init::point_idx#0) ← (const byte) DELAY#0
to:point_init::@return
point_init::@return: scope:[point_init] from point_init::@2
[53] return
[57] return
to:@return
point_init::@1: scope:[point_init] from point_init::@6
[54] if((signed word) point_init::x_diff#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto point_init::@4
[58] if((signed word) point_init::x_diff#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto point_init::@4
to:point_init::@3
point_init::@3: scope:[point_init] from point_init::@1
[55] *((const signed byte[4]) x_add#0 + (byte) point_init::point_idx#0) ← (byte/signed byte/word/signed word/dword/signed dword) $10
[59] *((const signed byte[4]) x_add#0 + (byte) point_init::point_idx#0) ← (byte/signed byte/word/signed word/dword/signed dword) $10
to:point_init::@5
point_init::@5: scope:[point_init] from point_init::@3 point_init::@4
[56] (signed word) divr16s::divisor#0 ← (signed word) point_init::x_diff#1
[57] (signed word) divr16s::rem#0 ← (signed word) point_init::y_diff#0
[58] call divr16s
[59] (signed word) divr16s::return#3 ← (signed word) divr16s::return#2
[60] (signed word) divr16s::divisor#0 ← (signed word) point_init::x_diff#1
[61] (signed word) divr16s::rem#0 ← (signed word) point_init::y_diff#0
[62] call divr16s
[63] (signed word) divr16s::return#3 ← (signed word) divr16s::return#2
to:point_init::@7
point_init::@7: scope:[point_init] from point_init::@5
[60] (signed word) point_init::x_stepf#0 ← (signed word) divr16s::return#3
[61] (byte~) point_init::$16 ← > (signed word) point_init::x_stepf#0
[62] (byte~) point_init::$17 ← (byte~) point_init::$16 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[63] *((const signed byte[4]) y_add#0 + (byte) point_init::point_idx1#0) ← (signed byte)(byte~) point_init::$17
[64] (signed word) point_init::x_stepf#0 ← (signed word) divr16s::return#3
[65] (byte~) point_init::$15 ← > (signed word) point_init::x_stepf#0
[66] (byte~) point_init::$16 ← (byte~) point_init::$15 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[67] *((const signed byte[4]) y_add#0 + (byte) point_init::point_idx#0) ← (signed byte)(byte~) point_init::$16
to:point_init::@2
point_init::@4: scope:[point_init] from point_init::@1
[64] *((const signed byte[4]) x_add#0 + (byte) point_init::point_idx#0) ← -(byte/signed byte/word/signed word/dword/signed dword) $10
[68] *((const signed byte[4]) x_add#0 + (byte) point_init::point_idx#0) ← -(byte/signed byte/word/signed word/dword/signed dword) $10
to:point_init::@5
point_init::abs16s2_@1: scope:[point_init] from point_init::abs16s2
[65] (signed word) point_init::abs16s2_$2#0 ← - (signed word) point_init::y_diff#0
[66] (word~) point_init::abs16s2_return#5 ← (word)(signed word) point_init::abs16s2_$2#0
[69] (signed word) point_init::abs16s2_$2#0 ← - (signed word) point_init::y_diff#0
[70] (word~) point_init::abs16s2_return#5 ← (word)(signed word) point_init::abs16s2_$2#0
to:point_init::abs16s2_@return
point_init::abs16s1_@1: scope:[point_init] from point_init::abs16s1
[67] (signed word) point_init::abs16s1_$2#0 ← - (signed word) point_init::x_diff#1
[68] (word~) point_init::abs16s1_return#5 ← (word)(signed word) point_init::abs16s1_$2#0
[71] (signed word) point_init::abs16s1_$2#0 ← - (signed word) point_init::x_diff#1
[72] (word~) point_init::abs16s1_return#5 ← (word)(signed word) point_init::abs16s1_$2#0
to:point_init::abs16s1_@return
divr16s: scope:[divr16s] from point_init::@5
[69] phi()
[73] phi()
to:divr16s::@7
divr16s::@7: scope:[divr16s] from divr16s
[70] if((signed word) divr16s::rem#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16s::@1
[74] if((signed word) divr16s::rem#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16s::@1
to:divr16s::@8
divr16s::@8: scope:[divr16s] from divr16s::@7
[71] (word~) divr16s::remu#8 ← (word)(signed word) divr16s::rem#0
[75] (word~) divr16s::remu#8 ← (word)(signed word) divr16s::rem#0
to:divr16s::@2
divr16s::@2: scope:[divr16s] from divr16s::@1 divr16s::@8
[72] (word) divr16s::remu#3 ← phi( divr16s::@1/(word~) divr16s::remu#7 divr16s::@8/(word~) divr16s::remu#8 )
[72] (word) divr16s::dividendu#3 ← phi( divr16s::@1/((word))-(const signed word) divr16s::dividend#0 divr16s::@8/((word))(const signed word) divr16s::dividend#0 )
[72] (byte) divr16s::neg#3 ← phi( divr16s::@1/(byte/signed byte/word/signed word/dword/signed dword) 1 divr16s::@8/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[73] if((signed word) divr16s::divisor#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16s::@3
[76] (word) divr16s::remu#3 ← phi( divr16s::@1/(word~) divr16s::remu#7 divr16s::@8/(word~) divr16s::remu#8 )
[76] (word) divr16s::dividendu#3 ← phi( divr16s::@1/((word))-(const signed word) divr16s::dividend#0 divr16s::@8/((word))(const signed word) divr16s::dividend#0 )
[76] (byte) divr16s::neg#3 ← phi( divr16s::@1/(byte/signed byte/word/signed word/dword/signed dword) 1 divr16s::@8/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[77] if((signed word) divr16s::divisor#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16s::@3
to:divr16s::@9
divr16s::@9: scope:[divr16s] from divr16s::@2
[74] (word~) divr16s::divisoru#5 ← (word)(signed word) divr16s::divisor#0
[78] (word~) divr16s::divisoru#5 ← (word)(signed word) divr16s::divisor#0
to:divr16s::@4
divr16s::@4: scope:[divr16s] from divr16s::@3 divr16s::@9
[75] (byte) divr16s::neg#4 ← phi( divr16s::@3/(byte) divr16s::neg#2 divr16s::@9/(byte) divr16s::neg#3 )
[75] (word) divr16s::divisoru#3 ← phi( divr16s::@3/(word~) divr16s::divisoru#4 divr16s::@9/(word~) divr16s::divisoru#5 )
[76] (word) divr16u::dividend#1 ← (word) divr16s::dividendu#3
[77] (word) divr16u::divisor#0 ← (word) divr16s::divisoru#3
[78] (word) divr16u::rem#3 ← (word) divr16s::remu#3
[79] call divr16u
[80] (word) divr16u::return#2 ← (word) divr16u::return#0
[79] (byte) divr16s::neg#4 ← phi( divr16s::@3/(byte) divr16s::neg#2 divr16s::@9/(byte) divr16s::neg#3 )
[79] (word) divr16s::divisoru#3 ← phi( divr16s::@3/(word~) divr16s::divisoru#4 divr16s::@9/(word~) divr16s::divisoru#5 )
[80] (word) divr16u::dividend#1 ← (word) divr16s::dividendu#3
[81] (word) divr16u::divisor#0 ← (word) divr16s::divisoru#3
[82] (word) divr16u::rem#3 ← (word) divr16s::remu#3
[83] call divr16u
[84] (word) divr16u::return#2 ← (word) divr16u::return#0
to:divr16s::@6
divr16s::@6: scope:[divr16s] from divr16s::@4
[81] (word) divr16s::resultu#0 ← (word) divr16u::return#2
[82] if((byte) divr16s::neg#4==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16s::@10
[85] (word) divr16s::resultu#0 ← (word) divr16u::return#2
[86] if((byte) divr16s::neg#4==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16s::@10
to:divr16s::@5
divr16s::@5: scope:[divr16s] from divr16s::@6
[83] (signed word) divr16s::return#1 ← - (signed word)(word) divr16s::resultu#0
[87] (signed word) divr16s::return#1 ← - (signed word)(word) divr16s::resultu#0
to:divr16s::@return
divr16s::@return: scope:[divr16s] from divr16s::@10 divr16s::@5
[84] (signed word) divr16s::return#2 ← phi( divr16s::@5/(signed word) divr16s::return#1 divr16s::@10/(signed word~) divr16s::return#7 )
[85] return
[88] (signed word) divr16s::return#2 ← phi( divr16s::@5/(signed word) divr16s::return#1 divr16s::@10/(signed word~) divr16s::return#7 )
[89] return
to:@return
divr16s::@10: scope:[divr16s] from divr16s::@6
[86] (signed word~) divr16s::return#7 ← (signed word)(word) divr16s::resultu#0
[90] (signed word~) divr16s::return#7 ← (signed word)(word) divr16s::resultu#0
to:divr16s::@return
divr16s::@3: scope:[divr16s] from divr16s::@2
[87] (signed word~) divr16s::$13 ← - (signed word) divr16s::divisor#0
[88] (byte) divr16s::neg#2 ← (byte) divr16s::neg#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1
[89] (word~) divr16s::divisoru#4 ← (word)(signed word~) divr16s::$13
[91] (signed word~) divr16s::$13 ← - (signed word) divr16s::divisor#0
[92] (byte) divr16s::neg#2 ← (byte) divr16s::neg#3 ^ (byte/signed byte/word/signed word/dword/signed dword) 1
[93] (word~) divr16s::divisoru#4 ← (word)(signed word~) divr16s::$13
to:divr16s::@4
divr16s::@1: scope:[divr16s] from divr16s::@7
[90] (signed word~) divr16s::$10 ← - (signed word) divr16s::rem#0
[91] (word~) divr16s::remu#7 ← (word)(signed word~) divr16s::$10
[94] (signed word~) divr16s::$10 ← - (signed word) divr16s::rem#0
[95] (word~) divr16s::remu#7 ← (word)(signed word~) divr16s::$10
to:divr16s::@2
divr16u: scope:[divr16u] from divr16s::@4
[92] phi()
[96] phi()
to:divr16u::@1
divr16u::@1: scope:[divr16u] from divr16u divr16u::@3
[93] (byte) divr16u::i#2 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(byte) divr16u::i#1 )
[93] (word) divr16u::quotient#3 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(word) divr16u::return#0 )
[93] (word) divr16u::dividend#2 ← phi( divr16u/(word) divr16u::dividend#1 divr16u::@3/(word) divr16u::dividend#0 )
[93] (word) divr16u::rem#4 ← phi( divr16u/(word) divr16u::rem#3 divr16u::@3/(word) divr16u::rem#9 )
[94] (word) divr16u::rem#0 ← (word) divr16u::rem#4 << (byte/signed byte/word/signed word/dword/signed dword) 1
[95] (byte~) divr16u::$1 ← > (word) divr16u::dividend#2
[96] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte/word/signed word/dword/signed dword) $80
[97] if((byte~) divr16u::$2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16u::@2
[97] (byte) divr16u::i#2 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(byte) divr16u::i#1 )
[97] (word) divr16u::quotient#3 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(word) divr16u::return#0 )
[97] (word) divr16u::dividend#2 ← phi( divr16u/(word) divr16u::dividend#1 divr16u::@3/(word) divr16u::dividend#0 )
[97] (word) divr16u::rem#4 ← phi( divr16u/(word) divr16u::rem#3 divr16u::@3/(word) divr16u::rem#9 )
[98] (word) divr16u::rem#0 ← (word) divr16u::rem#4 << (byte/signed byte/word/signed word/dword/signed dword) 1
[99] (byte~) divr16u::$1 ← > (word) divr16u::dividend#2
[100] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte/word/signed word/dword/signed dword) $80
[101] if((byte~) divr16u::$2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16u::@2
to:divr16u::@4
divr16u::@4: scope:[divr16u] from divr16u::@1
[98] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte/signed byte/word/signed word/dword/signed dword) 1
[102] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte/signed byte/word/signed word/dword/signed dword) 1
to:divr16u::@2
divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4
[99] (word) divr16u::rem#5 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[100] (word) divr16u::dividend#0 ← (word) divr16u::dividend#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[101] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[102] if((word) divr16u::rem#5<(word) divr16u::divisor#0) goto divr16u::@3
[103] (word) divr16u::rem#5 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[104] (word) divr16u::dividend#0 ← (word) divr16u::dividend#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[105] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[106] if((word) divr16u::rem#5<(word) divr16u::divisor#0) goto divr16u::@3
to:divr16u::@5
divr16u::@5: scope:[divr16u] from divr16u::@2
[103] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[104] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (word) divr16u::divisor#0
[107] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[108] (word) divr16u::rem#2 ← (word) divr16u::rem#5 - (word) divr16u::divisor#0
to:divr16u::@3
divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5
[105] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[105] (word) divr16u::rem#9 ← phi( divr16u::@2/(word) divr16u::rem#5 divr16u::@5/(word) divr16u::rem#2 )
[106] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[107] if((byte) divr16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto divr16u::@1
[109] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[109] (word) divr16u::rem#9 ← phi( divr16u::@2/(word) divr16u::rem#5 divr16u::@5/(word) divr16u::rem#2 )
[110] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[111] if((byte) divr16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto divr16u::@1
to:divr16u::@return
divr16u::@return: scope:[divr16u] from divr16u::@3
[108] return
[112] return
to:@return
screen_fill: scope:[screen_fill] from main::@6
[109] phi()
[113] phi()
to:screen_fill::@1
screen_fill::@1: scope:[screen_fill] from screen_fill screen_fill::@3
[110] (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 )
[110] (byte*) screen_fill::screen#3 ← phi( screen_fill/(const byte*) SCREEN#0 screen_fill::@3/(byte*) screen_fill::screen#1 )
[114] (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 )
[114] (byte*) screen_fill::screen#3 ← phi( screen_fill/(const byte*) SCREEN#0 screen_fill::@3/(byte*) screen_fill::screen#1 )
to:screen_fill::@2
screen_fill::@2: scope:[screen_fill] from screen_fill::@1 screen_fill::@2
[111] (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 )
[111] (byte*) screen_fill::screen#2 ← phi( screen_fill::@1/(byte*) screen_fill::screen#3 screen_fill::@2/(byte*) screen_fill::screen#1 )
[112] *((byte*) screen_fill::screen#2) ← (const byte) screen_fill::ch#0
[113] (byte*) screen_fill::screen#1 ← ++ (byte*) screen_fill::screen#2
[114] (byte) screen_fill::x#1 ← ++ (byte) screen_fill::x#2
[115] if((byte) screen_fill::x#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto screen_fill::@2
[115] (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 )
[115] (byte*) screen_fill::screen#2 ← phi( screen_fill::@1/(byte*) screen_fill::screen#3 screen_fill::@2/(byte*) screen_fill::screen#1 )
[116] *((byte*) screen_fill::screen#2) ← (const byte) screen_fill::ch#0
[117] (byte*) screen_fill::screen#1 ← ++ (byte*) screen_fill::screen#2
[118] (byte) screen_fill::x#1 ← ++ (byte) screen_fill::x#2
[119] if((byte) screen_fill::x#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto screen_fill::@2
to:screen_fill::@3
screen_fill::@3: scope:[screen_fill] from screen_fill::@2
[116] (byte) screen_fill::y#1 ← ++ (byte) screen_fill::y#4
[117] if((byte) screen_fill::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $19) goto screen_fill::@1
[120] (byte) screen_fill::y#1 ← ++ (byte) screen_fill::y#4
[121] if((byte) screen_fill::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $19) goto screen_fill::@1
to:screen_fill::@return
screen_fill::@return: scope:[screen_fill] from screen_fill::@3
[118] return
[122] return
to:@return
bitmap_clear: scope:[bitmap_clear] from main::@5
[119] (word~) bitmap_clear::$3 ← *((const byte[$100]) bitmap_plot_yhi#0) w= *((const byte[$100]) bitmap_plot_ylo#0)
[120] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3
[123] (word~) bitmap_clear::$3 ← *((const byte[$100]) bitmap_plot_yhi#0) w= *((const byte[$100]) bitmap_plot_ylo#0)
[124] (byte*~) bitmap_clear::bitmap#5 ← (byte*)(word~) bitmap_clear::$3
to:bitmap_clear::@1
bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear bitmap_clear::@3
[121] (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 )
[121] (byte*) bitmap_clear::bitmap#3 ← phi( bitmap_clear/(byte*~) bitmap_clear::bitmap#5 bitmap_clear::@3/(byte*) bitmap_clear::bitmap#1 )
[125] (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 )
[125] (byte*) bitmap_clear::bitmap#3 ← phi( bitmap_clear/(byte*~) bitmap_clear::bitmap#5 bitmap_clear::@3/(byte*) bitmap_clear::bitmap#1 )
to:bitmap_clear::@2
bitmap_clear::@2: scope:[bitmap_clear] from bitmap_clear::@1 bitmap_clear::@2
[122] (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 )
[122] (byte*) bitmap_clear::bitmap#2 ← phi( bitmap_clear::@1/(byte*) bitmap_clear::bitmap#3 bitmap_clear::@2/(byte*) bitmap_clear::bitmap#1 )
[123] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[124] (byte*) bitmap_clear::bitmap#1 ← ++ (byte*) bitmap_clear::bitmap#2
[125] (byte) bitmap_clear::x#1 ← ++ (byte) bitmap_clear::x#2
[126] if((byte) bitmap_clear::x#1!=(byte/word/signed word/dword/signed dword) $c8) goto bitmap_clear::@2
[126] (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 )
[126] (byte*) bitmap_clear::bitmap#2 ← phi( bitmap_clear::@1/(byte*) bitmap_clear::bitmap#3 bitmap_clear::@2/(byte*) bitmap_clear::bitmap#1 )
[127] *((byte*) bitmap_clear::bitmap#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0
[128] (byte*) bitmap_clear::bitmap#1 ← ++ (byte*) bitmap_clear::bitmap#2
[129] (byte) bitmap_clear::x#1 ← ++ (byte) bitmap_clear::x#2
[130] if((byte) bitmap_clear::x#1!=(byte/word/signed word/dword/signed dword) $c8) goto bitmap_clear::@2
to:bitmap_clear::@3
bitmap_clear::@3: scope:[bitmap_clear] from bitmap_clear::@2
[127] (byte) bitmap_clear::y#1 ← ++ (byte) bitmap_clear::y#4
[128] if((byte) bitmap_clear::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto bitmap_clear::@1
[131] (byte) bitmap_clear::y#1 ← ++ (byte) bitmap_clear::y#4
[132] if((byte) bitmap_clear::y#1!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto bitmap_clear::@1
to:bitmap_clear::@return
bitmap_clear::@return: scope:[bitmap_clear] from bitmap_clear::@3
[129] return
[133] return
to:@return
bitmap_init: scope:[bitmap_init] from main::@4
[130] phi()
[134] phi()
to:bitmap_init::@1
bitmap_init::@1: scope:[bitmap_init] from bitmap_init bitmap_init::@2
[131] (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 )
[131] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte/word/signed word/dword/signed dword) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[132] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[133] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[134] if((byte) bitmap_init::bits#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@6
[135] (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 )
[135] (byte) bitmap_init::bits#3 ← phi( bitmap_init/(byte/word/signed word/dword/signed dword) $80 bitmap_init::@2/(byte) bitmap_init::bits#4 )
[136] *((const byte[$100]) bitmap_plot_bit#0 + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3
[137] (byte) bitmap_init::bits#1 ← (byte) bitmap_init::bits#3 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[138] if((byte) bitmap_init::bits#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@6
to:bitmap_init::@2
bitmap_init::@2: scope:[bitmap_init] from bitmap_init::@1 bitmap_init::@6
[135] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte/word/signed word/dword/signed dword) $80 )
[136] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[137] if((byte) bitmap_init::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@1
[139] (byte) bitmap_init::bits#4 ← phi( bitmap_init::@6/(byte) bitmap_init::bits#1 bitmap_init::@1/(byte/word/signed word/dword/signed dword) $80 )
[140] (byte) bitmap_init::x#1 ← ++ (byte) bitmap_init::x#2
[141] if((byte) bitmap_init::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@1
to:bitmap_init::@3
bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@2 bitmap_init::@4
[138] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[138] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[139] (byte~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
[140] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[141] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$3 | (byte~) bitmap_init::$4
[142] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[143] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[144] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[145] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
[146] if((byte~) bitmap_init::$7!=(byte/signed byte/word/signed word/dword/signed dword) 7) goto bitmap_init::@4
[142] (byte*) bitmap_init::yoffs#2 ← phi( bitmap_init::@2/(const byte*) BITMAP#0 bitmap_init::@4/(byte*) bitmap_init::yoffs#4 )
[142] (byte) bitmap_init::y#2 ← phi( bitmap_init::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 bitmap_init::@4/(byte) bitmap_init::y#1 )
[143] (byte~) bitmap_init::$3 ← (byte) bitmap_init::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
[144] (byte~) bitmap_init::$4 ← < (byte*) bitmap_init::yoffs#2
[145] (byte~) bitmap_init::$5 ← (byte~) bitmap_init::$3 | (byte~) bitmap_init::$4
[146] *((const byte[$100]) bitmap_plot_ylo#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$5
[147] (byte~) bitmap_init::$6 ← > (byte*) bitmap_init::yoffs#2
[148] *((const byte[$100]) bitmap_plot_yhi#0 + (byte) bitmap_init::y#2) ← (byte~) bitmap_init::$6
[149] (byte~) bitmap_init::$7 ← (byte) bitmap_init::y#2 & (byte/signed byte/word/signed word/dword/signed dword) 7
[150] if((byte~) bitmap_init::$7!=(byte/signed byte/word/signed word/dword/signed dword) 7) goto bitmap_init::@4
to:bitmap_init::@5
bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@3
[147] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 8
[151] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 8
to:bitmap_init::@4
bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@3 bitmap_init::@5
[148] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[149] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[150] if((byte) bitmap_init::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@3
[152] (byte*) bitmap_init::yoffs#4 ← phi( bitmap_init::@3/(byte*) bitmap_init::yoffs#2 bitmap_init::@5/(byte*) bitmap_init::yoffs#1 )
[153] (byte) bitmap_init::y#1 ← ++ (byte) bitmap_init::y#2
[154] if((byte) bitmap_init::y#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@3
to:bitmap_init::@return
bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4
[151] return
[155] return
to:@return
bitmap_init::@6: scope:[bitmap_init] from bitmap_init::@1
[152] phi()
[156] phi()
to:bitmap_init::@2

File diff suppressed because it is too large Load Diff

View File

@ -88,7 +88,7 @@
(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 y 15.0
(byte) bitmap_plot::y#0 reg byte x 15.0
(byte[$100]) bitmap_plot_bit
(const byte[$100]) bitmap_plot_bit#0 bitmap_plot_bit = { fill( $100, 0) }
(byte[$100]) bitmap_plot_yhi
@ -172,7 +172,7 @@
(word) divr16u::return#0 return zp ZP_WORD:5 61.0
(word) divr16u::return#2 return zp ZP_WORD:5 4.0
(void()) main()
(byte~) main::$9 reg byte x 11.0
(byte) main::$12 reg byte a 22.0
(label) main::@1
(label) main::@2
(label) main::@3
@ -212,12 +212,17 @@
(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) $40
(void()) point_init((byte) point_init::point_idx)
(word~) point_init::$10 $10 zp ZP_WORD:3 4.0
(word~) point_init::$11 $11 zp ZP_WORD:3 4.0
(word~) point_init::$12 $12 zp ZP_WORD:3 4.0
(byte~) point_init::$16 reg byte a 4.0
(byte~) point_init::$17 reg byte a 2.0
(signed word~) point_init::$4 $4 zp ZP_WORD:7 2.0
(signed word~) point_init::$5 $5 zp ZP_WORD:3 4.0
(word~) point_init::$11 $11 zp ZP_WORD:3 2.0
(byte~) point_init::$15 reg byte a 4.0
(byte~) point_init::$16 reg byte a 2.0
(byte) point_init::$18 reg byte x 1.0
(byte) point_init::$19 reg byte a 2.0
(byte) point_init::$20 reg byte a 4.0
(byte) point_init::$21 reg byte a 4.0
(byte) point_init::$22 reg byte a 4.0
(signed word~) point_init::$3 $3 zp ZP_WORD:7 2.0
(signed word~) point_init::$4 $4 zp ZP_WORD:3 4.0
(word~) point_init::$9 $9 zp ZP_WORD:3 2.0
(label) point_init::@1
(label) point_init::@2
(label) point_init::@3
@ -255,9 +260,7 @@
(word~) point_init::abs16s2_return#6 abs16s2_return zp ZP_WORD:5 4.0
(signed word) point_init::abs16s2_w
(byte) point_init::point_idx
(byte) point_init::point_idx#0 point_idx zp ZP_BYTE:2 0.71875
(byte) point_init::point_idx1
(byte) point_init::point_idx1#0 point_idx1 zp ZP_BYTE:11 0.375
(byte) point_init::point_idx#0 point_idx zp ZP_BYTE:2 0.945945945945946
(signed word) point_init::x_diff
(signed word) point_init::x_diff#1 x_diff zp ZP_WORD:9 0.5555555555555556
(signed word) point_init::x_stepf
@ -299,9 +302,9 @@
(const byte[4]) y_start#0 y_start = { (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $14 }
zp ZP_BYTE:2 [ main::i#2 main::i#1 point_init::point_idx#0 screen_fill::y#4 screen_fill::y#1 bitmap_clear::y#4 bitmap_clear::y#1 bitmap_init::$3 ]
zp ZP_WORD:3 [ point_init::abs16s1_return#2 point_init::abs16s1_return#5 point_init::abs16s1_return#6 point_init::abs16s1_$2#0 divr16s::dividendu#3 divr16u::dividend#2 divr16u::dividend#1 divr16u::dividend#0 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::$5 point_init::$10 point_init::$11 point_init::$12 ]
zp ZP_WORD:3 [ point_init::abs16s1_return#2 point_init::abs16s1_return#5 point_init::abs16s1_return#6 point_init::abs16s1_$2#0 divr16s::dividendu#3 divr16u::dividend#2 divr16u::dividend#1 divr16u::dividend#0 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::$4 point_init::$9 point_init::$10 point_init::$11 ]
zp ZP_WORD:5 [ point_init::abs16s2_return#2 point_init::abs16s2_return#5 point_init::abs16s2_return#6 point_init::abs16s2_$2#0 divr16s::return#2 divr16s::return#1 divr16s::return#7 divr16s::resultu#0 divr16s::return#3 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 point_init::x_stepf#0 bitmap_plot::$3 bitmap_plot::plotter#1 ]
zp ZP_WORD:7 [ divr16s::remu#3 divr16s::remu#7 divr16s::remu#8 divr16u::rem#4 divr16u::rem#3 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 divr16s::rem#0 divr16s::$10 point_init::$4 point_init::y_diff#0 bitmap_plot::$1 ]
zp ZP_WORD:7 [ divr16s::remu#3 divr16s::remu#7 divr16s::remu#8 divr16u::rem#4 divr16u::rem#3 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 divr16s::rem#0 divr16s::$10 point_init::$3 point_init::y_diff#0 bitmap_plot::$1 ]
zp ZP_WORD:9 [ divr16s::divisoru#3 divr16s::divisoru#4 divr16s::divisoru#5 divr16s::divisor#0 divr16u::divisor#0 divr16s::$13 point_init::x_diff#1 ]
reg byte y [ divr16s::neg#4 divr16s::neg#2 divr16s::neg#3 ]
reg byte x [ divr16u::i#2 divr16u::i#1 ]
@ -310,12 +313,16 @@ 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 [ main::$9 ]
reg byte y [ bitmap_plot::y#0 ]
reg byte a [ main::$12 ]
reg byte x [ bitmap_plot::y#0 ]
reg byte a [ bitmap_plot::$2 ]
zp ZP_BYTE:11 [ point_init::point_idx1#0 ]
reg byte x [ point_init::$18 ]
reg byte a [ point_init::$19 ]
reg byte a [ point_init::$20 ]
reg byte a [ point_init::$21 ]
reg byte a [ point_init::$22 ]
reg byte a [ point_init::$15 ]
reg byte a [ point_init::$16 ]
reg byte a [ point_init::$17 ]
reg byte a [ divr16u::$1 ]
reg byte a [ divr16u::$2 ]
reg byte a [ bitmap_init::$4 ]

View File

@ -265,7 +265,7 @@ plex_irq: {
// Show the next sprite.
// plexSort() prepares showing the sprites
plexShowSprite: {
.label _7 = 6
.label _6 = 6
.label plex_sprite_idx2 = $d
.label plexFreeAdd1__2 = 9
lda plex_sprite_idx
@ -289,14 +289,18 @@ plexShowSprite: {
lda PLEX_PTR,y
ldx plex_sprite_idx
sta PLEX_SCREEN_PTR,x
ldx plex_show_idx
lda PLEX_SORTED_IDX,x
ldy plex_show_idx
ldx PLEX_SORTED_IDX,y
txa
asl
tax
lda PLEX_XPOS,x
tay
lda PLEX_XPOS,y
ldy plex_sprite_idx2
sta SPRITES_XPOS,y
lda PLEX_XPOS+1,x
txa
asl
tay
lda PLEX_XPOS+1,y
cmp #0
bne b1
lda #$ff
@ -307,7 +311,7 @@ plexShowSprite: {
ldx plex_sprite_idx
inx
lda #7
sax _7
sax _6
inc plex_show_idx
asl plex_sprite_msb
lda plex_sprite_msb

View File

@ -132,8 +132,8 @@ init::@1: scope:[init] from init init::@1
[60] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte/signed byte/word/signed word/dword/signed dword) $20 )
[60] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[61] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40
[62] (byte~) init::$7 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[63] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte~) init::$7) ← (word) init::xp#2
[62] (byte) init::$9 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[63] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) init::$9) ← (word) init::xp#2
[64] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9
[65] (byte) init::sx#1 ← ++ (byte) init::sx#2
[66] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1
@ -180,7 +180,7 @@ plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7
[87] (byte) plex_sprite_msb#29 ← phi( plex_irq/(byte) plex_sprite_msb#0 plex_irq::@7/(byte) plex_sprite_msb#17 )
[87] (byte) plex_free_next#27 ← phi( plex_irq/(byte) plex_free_next#31 plex_irq::@7/(byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 )
[87] (byte) plex_show_idx#27 ← phi( plex_irq/(byte) plex_show_idx#0 plex_irq::@7/(byte) plex_show_idx#16 )
[87] (byte) plex_sprite_idx#25 ← phi( plex_irq/(byte) plex_sprite_idx#0 plex_irq::@7/(byte/word/dword~) plexShowSprite::$7 )
[87] (byte) plex_sprite_idx#25 ← phi( plex_irq/(byte) plex_sprite_idx#0 plex_irq::@7/(byte/word/dword~) plexShowSprite::$6 )
[88] call plexShowSprite
to:plex_irq::plexFreeNextYpos1
plex_irq::plexFreeNextYpos1: scope:[plex_irq] from plex_irq::@3
@ -222,30 +222,32 @@ plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite
to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1
[106] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27))
[107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27) << (byte/signed byte/word/signed word/dword/signed dword) 1
[108] (byte~) plexShowSprite::$3 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0)
[109] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$3
[110] (byte~) plexShowSprite::$4 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0)
[111] if((byte~) plexShowSprite::$4!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1
[107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)
[108] (byte) plexShowSprite::$10 ← (byte) plexShowSprite::xpos_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[109] (byte~) plexShowSprite::$2 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::$10)
[110] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2
[111] (byte) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte/signed byte/word/signed word/dword/signed dword) 1
[112] (byte~) plexShowSprite::$3 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::$11)
[113] if((byte~) plexShowSprite::$3!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1
to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@5
[112] (byte/word/dword~) plexShowSprite::$10 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#29
[113] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$10
[114] (byte/word/dword~) plexShowSprite::$9 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#29
[115] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$9
to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3
[114] (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 ← (byte) plex_sprite_idx#25 + (byte/signed byte/word/signed word/dword/signed dword) 1
[115] (byte/word/dword~) plexShowSprite::$7 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 & (byte/signed byte/word/signed word/dword/signed dword) 7
[116] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27
[117] (byte) plex_sprite_msb#27 ← (byte) plex_sprite_msb#29 << (byte/signed byte/word/signed word/dword/signed dword) 1
[118] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@return
[116] (byte/signed word/word/dword/signed dword~) plexShowSprite::$5 ← (byte) plex_sprite_idx#25 + (byte/signed byte/word/signed word/dword/signed dword) 1
[117] (byte/word/dword~) plexShowSprite::$6 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$5 & (byte/signed byte/word/signed word/dword/signed dword) 7
[118] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27
[119] (byte) plex_sprite_msb#27 ← (byte) plex_sprite_msb#29 << (byte/signed byte/word/signed word/dword/signed dword) 1
[120] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@return
to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@2
[119] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1
[121] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1
to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@4
[120] (byte) plex_sprite_msb#17 ← phi( plexShowSprite::@2/(byte) plex_sprite_msb#27 plexShowSprite::@4/(byte) plex_sprite_msb#4 )
[121] return
[122] (byte) plex_sprite_msb#17 ← phi( plexShowSprite::@2/(byte) plex_sprite_msb#27 plexShowSprite::@4/(byte) plex_sprite_msb#4 )
[123] return
to:@return
plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5
[122] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29
[124] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29
to:plexShowSprite::@2

File diff suppressed because it is too large Load Diff

View File

@ -70,7 +70,7 @@
(bool) framedone#3 framedone zp ZP_BOOL:10 20.0
(bool) framedone#5 framedone zp ZP_BOOL:10 7.333333333333333
(void()) init()
(byte~) init::$7 reg byte a 22.0
(byte) init::$9 reg byte a 22.0
(label) init::@1
(label) init::@2
(label) init::@3
@ -116,11 +116,13 @@
(byte*) plexInit::plexSetScreen1_screen
(byte*) plexInit::screen
(void()) plexShowSprite()
(byte/word/dword~) plexShowSprite::$10 reg byte a 4.0
(byte) plexShowSprite::$10 reg byte a 4.0
(byte) plexShowSprite::$11 reg byte a 4.0
(byte~) plexShowSprite::$2 reg byte a 4.0
(byte~) plexShowSprite::$3 reg byte a 4.0
(byte~) plexShowSprite::$4 reg byte a 4.0
(byte/signed word/word/dword/signed dword~) plexShowSprite::$6 reg byte x 4.0
(byte/word/dword~) plexShowSprite::$7 $7 zp ZP_BYTE:6 1.0833333333333333
(byte/signed word/word/dword/signed dword~) plexShowSprite::$5 reg byte x 4.0
(byte/word/dword~) plexShowSprite::$6 $6 zp ZP_BYTE:6 1.0833333333333333
(byte/word/dword~) plexShowSprite::$9 reg byte a 4.0
(label) plexShowSprite::@1
(label) plexShowSprite::@2
(label) plexShowSprite::@3
@ -133,13 +135,13 @@
(byte/signed word/word/dword/signed dword~) plexShowSprite::plexFreeAdd1_$1
(byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 reg byte x 4.0
(byte/word/dword~) plexShowSprite::plexFreeAdd1_$2
(byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 plexFreeAdd1_$2 zp ZP_BYTE:9 1.0434782608695652
(byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 plexFreeAdd1_$2 zp ZP_BYTE:9 0.96
(byte) plexShowSprite::plexFreeAdd1_ypos
(byte) plexShowSprite::plexFreeAdd1_ypos#0 reg byte a 3.0
(byte) plexShowSprite::plex_sprite_idx2
(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp ZP_BYTE:13 0.6000000000000001
(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp ZP_BYTE:13 0.5454545454545454
(byte) plexShowSprite::xpos_idx
(byte) plexShowSprite::xpos_idx#0 reg byte x 2.0
(byte) plexShowSprite::xpos_idx#0 reg byte x 1.5
(byte) plexShowSprite::ypos
(void()) plexSort()
(label) plexSort::@1
@ -191,17 +193,17 @@ interrupt(KERNEL_MIN)(void()) plex_irq()
(byte) plex_show_idx#0 plex_show_idx zp ZP_BYTE:7 4.0
(byte) plex_show_idx#1 plex_show_idx zp ZP_BYTE:7 20.0
(byte) plex_show_idx#16 plex_show_idx zp ZP_BYTE:7 2.1666666666666665
(byte) plex_show_idx#27 plex_show_idx zp ZP_BYTE:7 1.1052631578947367
(byte) plex_show_idx#27 plex_show_idx zp ZP_BYTE:7 1.0
(byte) plex_sprite_idx
(byte) plex_sprite_idx#0 plex_sprite_idx zp ZP_BYTE:6 4.0
(byte) plex_sprite_idx#1 plex_sprite_idx zp ZP_BYTE:6 20.0
(byte) plex_sprite_idx#25 plex_sprite_idx zp ZP_BYTE:6 1.1176470588235294
(byte) plex_sprite_idx#25 plex_sprite_idx zp ZP_BYTE:6 1.0
(byte) plex_sprite_msb
(byte) plex_sprite_msb#0 plex_sprite_msb zp ZP_BYTE:8 4.0
(byte) plex_sprite_msb#1 plex_sprite_msb zp ZP_BYTE:8 20.0
(byte) plex_sprite_msb#17 plex_sprite_msb zp ZP_BYTE:8 2.142857142857143
(byte) plex_sprite_msb#27 plex_sprite_msb zp ZP_BYTE:8 3.0
(byte) plex_sprite_msb#29 plex_sprite_msb zp ZP_BYTE:8 0.95
(byte) plex_sprite_msb#29 plex_sprite_msb zp ZP_BYTE:8 0.8636363636363638
(byte) plex_sprite_msb#4 plex_sprite_msb zp ZP_BYTE:8 4.0
zp ZP_BYTE:2 [ loop::sin_idx#6 loop::sin_idx#1 ]
@ -214,7 +216,7 @@ reg byte x [ init::sx#2 init::sx#1 ]
zp ZP_WORD:4 [ init::xp#2 init::xp#1 ]
reg byte x [ init::ss#2 init::ss#1 ]
reg byte x [ plexInit::i#2 plexInit::i#1 ]
zp ZP_BYTE:6 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 plex_sprite_idx#1 ]
zp ZP_BYTE:6 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$6 plex_sprite_idx#1 ]
zp ZP_BYTE:7 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 plex_show_idx#1 ]
zp ZP_BYTE:8 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 plex_sprite_msb#1 ]
zp ZP_BYTE:9 [ plex_free_next#0 plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ]
@ -222,14 +224,16 @@ zp ZP_BOOL:10 [ framedone#3 framedone#12 framedone#19 framedone#5 ]
zp ZP_BYTE:11 [ plexSort::nxt_idx#0 ]
zp ZP_BYTE:12 [ plexSort::nxt_y#0 ]
reg byte x [ plexSort::s#2 ]
reg byte a [ init::$7 ]
reg byte a [ init::$9 ]
reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ]
zp ZP_BYTE:13 [ plex_irq::$4 plexShowSprite::plex_sprite_idx2#0 ]
reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ]
reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ]
reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ]
reg byte x [ plexShowSprite::xpos_idx#0 ]
reg byte a [ plexShowSprite::$3 ]
reg byte a [ plexShowSprite::$4 ]
reg byte a [ plexShowSprite::$10 ]
reg byte x [ plexShowSprite::$6 ]
reg byte a [ plexShowSprite::$2 ]
reg byte a [ plexShowSprite::$11 ]
reg byte a [ plexShowSprite::$3 ]
reg byte a [ plexShowSprite::$9 ]
reg byte x [ plexShowSprite::$5 ]

View File

@ -8,13 +8,13 @@ main: {
ldy #0
b1:
tya
asl
tax
lda #$80
ldx #$80
jsr sub
lda #$40
tya
ldx #$40
jsr sub
lda #$40
tya
ldx #$40
jsr sub
iny
cpy #9
@ -154,16 +154,17 @@ print_cls: {
bne b1
rts
}
// sub(byte register(X) idx, byte register(A) s)
// sub(byte register(A) idx, byte register(X) s)
sub: {
clc
sbc words,x
eor #$ff
asl
sec
stx $ff
tax
lda words,x
sbc $ff
sta words,x
bcc !+
lda words+1,x
sbc #1
sta words+1,x
bcs !+
dec words+1,x
!:
rts
}

View File

@ -12,128 +12,128 @@ main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@6
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@6/(byte) main::i#1 )
[6] (byte) main::idx#0 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[7] (byte) sub::idx#0 ← (byte) main::idx#0
[8] call sub
[6] (byte) sub::idx#0 ← (byte) main::i#2
[7] call sub
to:main::@4
main::@4: scope:[main] from main::@1
[9] (byte) sub::idx#1 ← (byte) main::idx#0
[10] call sub
[8] (byte) sub::idx#1 ← (byte) main::i#2
[9] call sub
to:main::@5
main::@5: scope:[main] from main::@4
[11] (byte) sub::idx#2 ← (byte) main::idx#0
[12] call sub
[10] (byte) sub::idx#2 ← (byte) main::i#2
[11] call sub
to:main::@6
main::@6: scope:[main] from main::@5
[13] (byte) main::i#1 ← ++ (byte) main::i#2
[14] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@1
[12] (byte) main::i#1 ← ++ (byte) main::i#2
[13] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@6
[15] phi()
[16] call print_cls
[14] phi()
[15] call print_cls
to:main::@3
main::@3: scope:[main] from main::@2 main::@9
[17] (byte*) print_line_cursor#19 ← phi( main::@9/(byte*) print_line_cursor#1 main::@2/((byte*))(word/signed word/dword/signed dword) $400 )
[17] (byte*) print_char_cursor#46 ← phi( main::@9/(byte*~) print_char_cursor#56 main::@2/((byte*))(word/signed word/dword/signed dword) $400 )
[17] (byte) main::j#2 ← phi( main::@9/(byte) main::j#1 main::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[18] (byte~) main::$6 ← (byte) main::j#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[19] (signed word) print_sword::w#1 ← *((const signed word[]) words#0 + (byte~) main::$6)
[20] call print_sword
[16] (byte*) print_line_cursor#19 ← phi( main::@9/(byte*) print_line_cursor#1 main::@2/((byte*))(word/signed word/dword/signed dword) $400 )
[16] (byte*) print_char_cursor#46 ← phi( main::@9/(byte*~) print_char_cursor#56 main::@2/((byte*))(word/signed word/dword/signed dword) $400 )
[16] (byte) main::j#2 ← phi( main::@9/(byte) main::j#1 main::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[17] (byte) main::$8 ← (byte) main::j#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[18] (signed word) print_sword::w#1 ← *((const signed word[]) words#0 + (byte) main::$8)
[19] call print_sword
to:main::@7
main::@7: scope:[main] from main::@3
[21] phi()
[22] call print_ln
[20] phi()
[21] call print_ln
to:main::@8
main::@8: scope:[main] from main::@7
[23] (byte) main::j#1 ← ++ (byte) main::j#2
[24] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@9
[22] (byte) main::j#1 ← ++ (byte) main::j#2
[23] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 9) goto main::@9
to:main::@return
main::@return: scope:[main] from main::@8
[25] return
[24] return
to:@return
main::@9: scope:[main] from main::@8
[26] (byte*~) print_char_cursor#56 ← (byte*) print_line_cursor#1
[25] (byte*~) print_char_cursor#56 ← (byte*) print_line_cursor#1
to:main::@3
print_ln: scope:[print_ln] from main::@7
[27] phi()
[26] phi()
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[28] (byte*) print_line_cursor#9 ← phi( print_ln/(byte*) print_line_cursor#19 print_ln::@1/(byte*) print_line_cursor#1 )
[29] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#9 + (byte/signed byte/word/signed word/dword/signed dword) $28
[30] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#12) goto print_ln::@1
[27] (byte*) print_line_cursor#9 ← phi( print_ln/(byte*) print_line_cursor#19 print_ln::@1/(byte*) print_line_cursor#1 )
[28] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#9 + (byte/signed byte/word/signed word/dword/signed dword) $28
[29] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#12) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[31] return
[30] return
to:@return
print_sword: scope:[print_sword] from main::@3
[32] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1
[31] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1
to:print_sword::@2
print_sword::@2: scope:[print_sword] from print_sword
[33] phi()
[34] call print_char
[32] phi()
[33] call print_char
to:print_sword::@3
print_sword::@3: scope:[print_sword] from print_sword::@2
[35] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1
[34] (signed word) print_sword::w#0 ← - (signed word) print_sword::w#1
to:print_sword::@1
print_sword::@1: scope:[print_sword] from print_sword print_sword::@3
[36] (byte*) print_char_cursor#41 ← phi( print_sword/(byte*) print_char_cursor#46 print_sword::@3/(byte*) print_char_cursor#12 )
[36] (signed word) print_sword::w#3 ← phi( print_sword/(signed word) print_sword::w#1 print_sword::@3/(signed word) print_sword::w#0 )
[37] call print_word
[35] (byte*) print_char_cursor#41 ← phi( print_sword/(byte*) print_char_cursor#46 print_sword::@3/(byte*) print_char_cursor#12 )
[35] (signed word) print_sword::w#3 ← phi( print_sword/(signed word) print_sword::w#1 print_sword::@3/(signed word) print_sword::w#0 )
[36] call print_word
to:print_sword::@return
print_sword::@return: scope:[print_sword] from print_sword::@1
[38] return
[37] return
to:@return
print_word: scope:[print_word] from print_sword::@1
[39] (byte) print_byte::b#0 ← > (word)(signed word) print_sword::w#3
[40] call print_byte
[38] (byte) print_byte::b#0 ← > (word)(signed word) print_sword::w#3
[39] call print_byte
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[41] (byte) print_byte::b#1 ← < (word)(signed word) print_sword::w#3
[42] call print_byte
[40] (byte) print_byte::b#1 ← < (word)(signed word) print_sword::w#3
[41] call print_byte
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[43] return
[42] return
to:@return
print_byte: scope:[print_byte] from print_word print_word::@1
[44] (byte*) print_char_cursor#44 ← phi( print_word/(byte*) print_char_cursor#41 print_word::@1/(byte*) print_char_cursor#12 )
[44] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[45] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[46] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[47] call print_char
[43] (byte*) print_char_cursor#44 ← phi( print_word/(byte*) print_char_cursor#41 print_word::@1/(byte*) print_char_cursor#12 )
[43] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[44] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[45] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[46] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[48] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word/dword/signed dword) $f
[49] (byte) print_char::ch#2 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[50] call print_char
[47] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte/signed byte/word/signed word/dword/signed dword) $f
[48] (byte) print_char::ch#2 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[49] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[51] return
[50] return
to:@return
print_char: scope:[print_char] from print_byte print_byte::@1 print_sword::@2
[52] (byte*) print_char_cursor#32 ← phi( print_byte/(byte*) print_char_cursor#44 print_byte::@1/(byte*) print_char_cursor#12 print_sword::@2/(byte*) print_char_cursor#46 )
[52] (byte) print_char::ch#3 ← phi( print_byte/(byte) print_char::ch#1 print_byte::@1/(byte) print_char::ch#2 print_sword::@2/(byte) '-' )
[53] *((byte*) print_char_cursor#32) ← (byte) print_char::ch#3
[54] (byte*) print_char_cursor#12 ← ++ (byte*) print_char_cursor#32
[51] (byte*) print_char_cursor#32 ← phi( print_byte/(byte*) print_char_cursor#44 print_byte::@1/(byte*) print_char_cursor#12 print_sword::@2/(byte*) print_char_cursor#46 )
[51] (byte) print_char::ch#3 ← phi( print_byte/(byte) print_char::ch#1 print_byte::@1/(byte) print_char::ch#2 print_sword::@2/(byte) '-' )
[52] *((byte*) print_char_cursor#32) ← (byte) print_char::ch#3
[53] (byte*) print_char_cursor#12 ← ++ (byte*) print_char_cursor#32
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[55] return
[54] return
to:@return
print_cls: scope:[print_cls] from main::@2
[56] phi()
[55] phi()
to:print_cls::@1
print_cls::@1: scope:[print_cls] from print_cls print_cls::@1
[57] (byte*) print_cls::sc#2 ← phi( print_cls/((byte*))(word/signed word/dword/signed dword) $400 print_cls::@1/(byte*) print_cls::sc#1 )
[58] *((byte*) print_cls::sc#2) ← (byte) ' '
[59] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
[60] if((byte*) print_cls::sc#1!=((byte*))(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
[56] (byte*) print_cls::sc#2 ← phi( print_cls/((byte*))(word/signed word/dword/signed dword) $400 print_cls::@1/(byte*) print_cls::sc#1 )
[57] *((byte*) print_cls::sc#2) ← (byte) ' '
[58] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
[59] if((byte*) print_cls::sc#1!=((byte*))(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls::@1
[61] return
[60] return
to:@return
sub: scope:[sub] from main::@1 main::@4 main::@5
[62] (byte) sub::s#3 ← phi( main::@1/(byte/word/signed word/dword/signed dword) $80 main::@4/(byte/signed byte/word/signed word/dword/signed dword) $40 main::@5/(byte/signed byte/word/signed word/dword/signed dword) $40 )
[62] (byte) sub::idx#3 ← phi( main::@1/(byte) sub::idx#0 main::@4/(byte) sub::idx#1 main::@5/(byte) sub::idx#2 )
[63] *((const signed word[]) words#0 + (byte) sub::idx#3) ← *((const signed word[]) words#0 + (byte) sub::idx#3) - (byte) sub::s#3
[61] (byte) sub::s#3 ← phi( main::@1/(byte/word/signed word/dword/signed dword) $80 main::@4/(byte/signed byte/word/signed word/dword/signed dword) $40 main::@5/(byte/signed byte/word/signed word/dword/signed dword) $40 )
[61] (byte) sub::idx#3 ← phi( main::@1/(byte) sub::idx#0 main::@4/(byte) sub::idx#1 main::@5/(byte) sub::idx#2 )
[62] (byte) sub::$0 ← (byte) sub::idx#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[63] *((const signed word[]) words#0 + (byte) sub::$0) ← *((const signed word[]) words#0 + (byte) sub::$0) - (byte) sub::s#3
to:sub::@return
sub::@return: scope:[sub] from sub
[64] return

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
(label) @begin
(label) @end
(void()) main()
(byte~) main::$6 reg byte a 22.0
(byte) main::$8 reg byte a 22.0
(label) main::@1
(label) main::@2
(label) main::@3
@ -15,9 +15,7 @@
(label) main::@return
(byte) main::i
(byte) main::i#1 reg byte y 16.5
(byte) main::i#2 reg byte y 4.125
(byte) main::idx
(byte) main::idx#0 reg byte x 8.8
(byte) main::i#2 reg byte y 7.857142857142857
(byte) main::j
(byte) main::j#1 reg byte x 11.0
(byte) main::j#2 reg byte x 5.5
@ -73,14 +71,15 @@
(label) print_word::@return
(word) print_word::w
(void()) sub((byte) sub::idx , (byte) sub::s)
(byte) sub::$0 reg byte a 6.0
(label) sub::@return
(byte) sub::idx
(byte) sub::idx#0 reg byte x 22.0
(byte) sub::idx#1 reg byte x 22.0
(byte) sub::idx#2 reg byte x 22.0
(byte) sub::idx#3 reg byte x 37.0
(byte) sub::idx#0 reg byte a 22.0
(byte) sub::idx#1 reg byte a 22.0
(byte) sub::idx#2 reg byte a 22.0
(byte) sub::idx#3 reg byte a 35.0
(byte) sub::s
(byte) sub::s#3 reg byte a 2.0
(byte) sub::s#3 reg byte x 1.0
(signed word[]) words
(const signed word[]) words#0 words = { -(word/signed word/dword/signed dword) $6000, -(word/signed word/dword/signed dword) $600, -(byte/signed byte/word/signed word/dword/signed dword) $60, -(byte/signed byte/word/signed word/dword/signed dword) 6, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 6, (byte/signed byte/word/signed word/dword/signed dword) $60, (word/signed word/dword/signed dword) $600, (word/signed word/dword/signed dword) $6000 }
@ -91,9 +90,9 @@ zp ZP_WORD:4 [ print_sword::w#3 print_sword::w#1 print_sword::w#0 ]
zp ZP_BYTE:6 [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#3 print_char::ch#1 print_char::ch#2 ]
zp ZP_WORD:7 [ print_char_cursor#32 print_char_cursor#44 print_char_cursor#41 print_char_cursor#46 print_char_cursor#56 print_char_cursor#12 ]
reg byte x [ sub::idx#3 sub::idx#0 sub::idx#1 sub::idx#2 ]
reg byte a [ sub::s#3 ]
reg byte x [ main::idx#0 ]
reg byte a [ main::$6 ]
reg byte a [ sub::idx#3 sub::idx#0 sub::idx#1 sub::idx#2 ]
reg byte x [ sub::s#3 ]
reg byte a [ main::$8 ]
reg byte a [ print_byte::$0 ]
reg byte a [ print_byte::$2 ]
reg byte a [ sub::$0 ]

View File

@ -0,0 +1,37 @@
// Test word pointer compound assignment
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.const SIZEOF_WORD = 2
main: {
.label SCREEN = $400
ldx #0
b1:
txa
asl
tay
clc
lda words,y
adc #<$101
sta words,y
lda words+1,y
adc #>$101
sta words+1,y
inx
cpx #3
bne b1
lda words+1
sta SCREEN
lda words
sta SCREEN+1
lda words+1*SIZEOF_WORD+1
sta SCREEN+2
lda words+1*SIZEOF_WORD
sta SCREEN+3
lda words+2*SIZEOF_WORD+1
sta SCREEN+4
lda words+2*SIZEOF_WORD
sta SCREEN+5
rts
words: .word $3031, $3233, $3435
}

View File

@ -0,0 +1,36 @@
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::i#1 )
[6] (byte) main::$7 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[7] *((const word[]) main::words#0 + (byte) main::$7) ← *((const word[]) main::words#0 + (byte) main::$7) + (word/signed word/dword/signed dword) $101
[8] (byte) main::i#1 ← ++ (byte) main::i#2
[9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[10] (byte~) main::$0 ← > *((const word[]) main::words#0)
[11] *((const byte*) main::SCREEN#0) ← (byte~) main::$0
[12] (byte~) main::$1 ← < *((const word[]) main::words#0)
[13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1
[14] (byte~) main::$2 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD)
[15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2
[16] (byte~) main::$3 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD)
[17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$3
[18] (byte~) main::$4 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD)
[19] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte~) main::$4
[20] (byte~) main::$5 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD)
[21] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte~) main::$5
to:main::@return
main::@return: scope:[main] from main::@2
[22] return
to:@return

View File

@ -0,0 +1,604 @@
Fixing pointer array-indexing *((word[]) main::words + (byte) main::i)
Fixing pointer array-indexing *((word[]) main::words + (byte) main::i)
Fixing pointer array-indexing *((word[]) main::words + (byte/signed byte/word/signed word/dword/signed dword) 0)
Fixing pointer array-indexing *((word[]) main::words + (byte/signed byte/word/signed word/dword/signed dword) 0)
Fixing pointer array-indexing *((word[]) main::words + (byte/signed byte/word/signed word/dword/signed dword) 1)
Fixing pointer array-indexing *((word[]) main::words + (byte/signed byte/word/signed word/dword/signed dword) 1)
Fixing pointer array-indexing *((word[]) main::words + (byte/signed byte/word/signed word/dword/signed dword) 2)
Fixing pointer array-indexing *((word[]) main::words + (byte/signed byte/word/signed word/dword/signed dword) 2)
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
main: scope:[main] from @1
(word[]) main::words#0 ← { (word/signed word/dword/signed dword) $3031, (word/signed word/dword/signed dword) $3233, (word/signed word/dword/signed dword) $3435 }
(byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@1
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
(byte) main::$7 ← (byte) main::i#2 * (const byte) SIZEOF_WORD
*((word[]) main::words#0 + (byte) main::$7) ← *((word[]) main::words#0 + (byte) main::$7) + (word/signed word/dword/signed dword) $101
(byte) main::i#1 ← (byte) main::i#2 + rangenext(0,2)
(bool~) main::$6 ← (byte) main::i#1 != rangelast(0,2)
if((bool~) main::$6) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
(byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400
(byte/signed byte/word/signed word/dword/signed dword) main::$8 ← (byte/signed byte/word/signed word/dword/signed dword) 0 * (const byte) SIZEOF_WORD
(byte~) main::$0 ← > *((word[]) main::words#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$8)
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0
(byte/signed byte/word/signed word/dword/signed dword) main::$9 ← (byte/signed byte/word/signed word/dword/signed dword) 0 * (const byte) SIZEOF_WORD
(byte~) main::$1 ← < *((word[]) main::words#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$9)
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1
(byte/signed byte/word/signed word/dword/signed dword) main::$10 ← (byte/signed byte/word/signed word/dword/signed dword) 1 * (const byte) SIZEOF_WORD
(byte~) main::$2 ← > *((word[]) main::words#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$10)
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2
(byte/signed byte/word/signed word/dword/signed dword) main::$11 ← (byte/signed byte/word/signed word/dword/signed dword) 1 * (const byte) SIZEOF_WORD
(byte~) main::$3 ← < *((word[]) main::words#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$11)
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$3
(byte/signed byte/word/signed word/dword/signed dword) main::$12 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (const byte) SIZEOF_WORD
(byte~) main::$4 ← > *((word[]) main::words#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$12)
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte~) main::$4
(byte/signed byte/word/signed word/dword/signed dword) main::$13 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (const byte) SIZEOF_WORD
(byte~) main::$5 ← < *((word[]) main::words#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$13)
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte~) main::$5
to:main::@return
main::@return: scope:[main] from main::@2
return
to:@return
@1: scope:[] from @begin
call main
to:@2
@2: scope:[] from @1
to:@end
@end: scope:[] from @2
SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @begin
(label) @end
(const byte) SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(byte~) main::$0
(byte~) main::$1
(byte/signed byte/word/signed word/dword/signed dword) main::$10
(byte/signed byte/word/signed word/dword/signed dword) main::$11
(byte/signed byte/word/signed word/dword/signed dword) main::$12
(byte/signed byte/word/signed word/dword/signed dword) main::$13
(byte~) main::$2
(byte~) main::$3
(byte~) main::$4
(byte~) main::$5
(bool~) main::$6
(byte) main::$7
(byte/signed byte/word/signed word/dword/signed dword) main::$8
(byte/signed byte/word/signed word/dword/signed dword) main::$9
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) main::SCREEN
(byte*) main::SCREEN#0
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(word[]) main::words
(word[]) main::words#0
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Simple Condition (bool~) main::$6 [7] if((byte) main::i#1!=rangelast(0,2)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const word[]) main::words#0 = { $3031, $3233, $3435 }
Constant (const byte) main::i#0 = 0
Constant (const byte*) main::SCREEN#0 = ((byte*))$400
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$8 = 0*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$9 = 0*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$10 = 1*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$11 = 1*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$12 = 2*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$13 = 2*SIZEOF_WORD
Successful SSA optimization Pass2ConstantIdentification
Consolidated array index constant in *(main::words#0+main::$8)
Consolidated array index constant in *(main::SCREEN#0+0)
Consolidated array index constant in *(main::words#0+main::$9)
Consolidated array index constant in *(main::SCREEN#0+1)
Consolidated array index constant in *(main::words#0+main::$10)
Consolidated array index constant in *(main::SCREEN#0+2)
Consolidated array index constant in *(main::words#0+main::$11)
Consolidated array index constant in *(main::SCREEN#0+3)
Consolidated array index constant in *(main::words#0+main::$12)
Consolidated array index constant in *(main::SCREEN#0+4)
Consolidated array index constant in *(main::words#0+main::$13)
Consolidated array index constant in *(main::SCREEN#0+5)
Successful SSA optimization Pass2ConstantAdditionElimination
Resolved ranged next value main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value if(main::i#1!=rangelast(0,2)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 3
Rewriting multiplication to use shift (byte) main::$7 ← (byte) main::i#2 * (const byte) SIZEOF_WORD
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::$12 = (byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD
Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::$13 = (byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD
Constant inlined main::$9 = (byte/signed byte/word/signed word/dword/signed dword) 0*(const byte) SIZEOF_WORD
Constant inlined main::$10 = (byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$8 = (byte/signed byte/word/signed word/dword/signed dword) 0*(const byte) SIZEOF_WORD
Constant inlined main::$11 = (byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Successful SSA optimization Pass2ConstantInlining
Simplifying constant multiply by zero 0*SIZEOF_WORD
Simplifying constant plus zero main::SCREEN#0+0
Simplifying constant multiply by zero 0*SIZEOF_WORD
Simplifying constant plus zero main::words#0+0
Simplifying constant plus zero main::words#0+0
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
CALL GRAPH
Calls in [] to main:2
Created 1 initial phi equivalence classes
Coalesced [23] main::i#3 ← main::i#1
Coalesced down to 1 phi equivalence classes
Culled Empty Block (label) main::@3
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@1
[5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::i#1 )
[6] (byte) main::$7 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[7] *((const word[]) main::words#0 + (byte) main::$7) ← *((const word[]) main::words#0 + (byte) main::$7) + (word/signed word/dword/signed dword) $101
[8] (byte) main::i#1 ← ++ (byte) main::i#2
[9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[10] (byte~) main::$0 ← > *((const word[]) main::words#0)
[11] *((const byte*) main::SCREEN#0) ← (byte~) main::$0
[12] (byte~) main::$1 ← < *((const word[]) main::words#0)
[13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1
[14] (byte~) main::$2 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD)
[15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2
[16] (byte~) main::$3 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD)
[17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$3
[18] (byte~) main::$4 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD)
[19] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte~) main::$4
[20] (byte~) main::$5 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD)
[21] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte~) main::$5
to:main::@return
main::@return: scope:[main] from main::@2
[22] return
to:@return
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte~) main::$0 4.0
(byte~) main::$1 4.0
(byte~) main::$2 4.0
(byte~) main::$3 4.0
(byte~) main::$4 4.0
(byte~) main::$5 4.0
(byte) main::$7 33.0
(byte*) main::SCREEN
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 11.0
(word[]) main::words
Initial phi equivalence classes
[ main::i#2 main::i#1 ]
Added variable main::$7 to zero page equivalence class [ main::$7 ]
Added variable main::$0 to zero page equivalence class [ main::$0 ]
Added variable main::$1 to zero page equivalence class [ main::$1 ]
Added variable main::$2 to zero page equivalence class [ main::$2 ]
Added variable main::$3 to zero page equivalence class [ main::$3 ]
Added variable main::$4 to zero page equivalence class [ main::$4 ]
Added variable main::$5 to zero page equivalence class [ main::$5 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::$7 ]
[ main::$0 ]
[ main::$1 ]
[ main::$2 ]
[ main::$3 ]
[ main::$4 ]
[ main::$5 ]
Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Allocated zp ZP_BYTE:3 [ main::$7 ]
Allocated zp ZP_BYTE:4 [ main::$0 ]
Allocated zp ZP_BYTE:5 [ main::$1 ]
Allocated zp ZP_BYTE:6 [ main::$2 ]
Allocated zp ZP_BYTE:7 [ main::$3 ]
Allocated zp ZP_BYTE:8 [ main::$4 ]
Allocated zp ZP_BYTE:9 [ main::$5 ]
INITIAL ASM
//SEG0 File Comments
// Test word pointer compound assignment
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_WORD = 2
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
.label SCREEN = $400
.label _0 = 4
.label _1 = 5
.label _2 = 6
.label _3 = 7
.label _4 = 8
.label _5 = 9
.label _7 = 3
.label i = 2
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta i
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
b1_from_b1:
//SEG14 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
jmp b1
//SEG15 main::@1
b1:
//SEG16 [6] (byte) main::$7 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1
lda i
asl
sta _7
//SEG17 [7] *((const word[]) main::words#0 + (byte) main::$7) ← *((const word[]) main::words#0 + (byte) main::$7) + (word/signed word/dword/signed dword) $101 -- pwuc1_derefidx_vbuz1=pwuc1_derefidx_vbuz1_plus_vwuc2
ldy _7
clc
lda words,y
adc #<$101
sta words,y
lda words+1,y
adc #>$101
sta words+1,y
//SEG18 [8] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG19 [9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto main::@1 -- vbuz1_neq_vbuc1_then_la1
lda #3
cmp i
bne b1_from_b1
jmp b2
//SEG20 main::@2
b2:
//SEG21 [10] (byte~) main::$0 ← > *((const word[]) main::words#0) -- vbuz1=_hi__deref_pwuc1
lda words+1
sta _0
//SEG22 [11] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuz1
lda _0
sta SCREEN
//SEG23 [12] (byte~) main::$1 ← < *((const word[]) main::words#0) -- vbuz1=_lo__deref_pwuc1
lda words
sta _1
//SEG24 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuz1
lda _1
sta SCREEN+1
//SEG25 [14] (byte~) main::$2 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) -- vbuz1=_hi__deref_pwuc1
lda words+1*SIZEOF_WORD+1
sta _2
//SEG26 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuz1
lda _2
sta SCREEN+2
//SEG27 [16] (byte~) main::$3 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) -- vbuz1=_lo__deref_pwuc1
lda words+1*SIZEOF_WORD
sta _3
//SEG28 [17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuz1
lda _3
sta SCREEN+3
//SEG29 [18] (byte~) main::$4 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD) -- vbuz1=_hi__deref_pwuc1
lda words+2*SIZEOF_WORD+1
sta _4
//SEG30 [19] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuz1
lda _4
sta SCREEN+4
//SEG31 [20] (byte~) main::$5 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD) -- vbuz1=_lo__deref_pwuc1
lda words+2*SIZEOF_WORD
sta _5
//SEG32 [21] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte~) main::$5 -- _deref_pbuc1=vbuz1
lda _5
sta SCREEN+5
jmp breturn
//SEG33 main::@return
breturn:
//SEG34 [22] return
rts
words: .word $3031, $3233, $3435
}
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte) main::$7 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::i#2 main::i#1 ]
Statement [7] *((const word[]) main::words#0 + (byte) main::$7) ← *((const word[]) main::words#0 + (byte) main::$7) + (word/signed word/dword/signed dword) $101 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [6] (byte) main::$7 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ main::i#2 main::$7 ] ( main:2 [ main::i#2 main::$7 ] ) always clobbers reg byte a
Statement [7] *((const word[]) main::words#0 + (byte) main::$7) ← *((const word[]) main::words#0 + (byte) main::$7) + (word/signed word/dword/signed dword) $101 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:3 [ main::$7 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:4 [ main::$0 ] : zp ZP_BYTE:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:5 [ main::$1 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:6 [ main::$2 ] : zp ZP_BYTE:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:7 [ main::$3 ] : zp ZP_BYTE:7 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:8 [ main::$4 ] : zp ZP_BYTE:8 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:9 [ main::$5 ] : zp ZP_BYTE:9 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 33: zp ZP_BYTE:3 [ main::$7 ] 27.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] 4: zp ZP_BYTE:4 [ main::$0 ] 4: zp ZP_BYTE:5 [ main::$1 ] 4: zp ZP_BYTE:6 [ main::$2 ] 4: zp ZP_BYTE:7 [ main::$3 ] 4: zp ZP_BYTE:8 [ main::$4 ] 4: zp ZP_BYTE:9 [ main::$5 ]
Uplift Scope []
Uplifting [main] best 578 combination reg byte a [ main::$7 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$0 ] reg byte a [ main::$1 ] zp ZP_BYTE:6 [ main::$2 ] zp ZP_BYTE:7 [ main::$3 ] zp ZP_BYTE:8 [ main::$4 ] zp ZP_BYTE:9 [ main::$5 ]
Limited combination testing to 100 combinations of 49152 possible.
Uplifting [] best 578 combination
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ main::$2 ]
Uplifting [main] best 572 combination reg byte a [ main::$2 ]
Attempting to uplift remaining variables inzp ZP_BYTE:7 [ main::$3 ]
Uplifting [main] best 566 combination reg byte a [ main::$3 ]
Attempting to uplift remaining variables inzp ZP_BYTE:8 [ main::$4 ]
Uplifting [main] best 560 combination reg byte a [ main::$4 ]
Attempting to uplift remaining variables inzp ZP_BYTE:9 [ main::$5 ]
Uplifting [main] best 554 combination reg byte a [ main::$5 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
// Test word pointer compound assignment
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_WORD = 2
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
.label SCREEN = $400
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
b1_from_main:
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
jmp b1
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
b1_from_b1:
//SEG14 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
jmp b1
//SEG15 main::@1
b1:
//SEG16 [6] (byte) main::$7 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuxx_rol_1
txa
asl
//SEG17 [7] *((const word[]) main::words#0 + (byte) main::$7) ← *((const word[]) main::words#0 + (byte) main::$7) + (word/signed word/dword/signed dword) $101 -- pwuc1_derefidx_vbuaa=pwuc1_derefidx_vbuaa_plus_vwuc2
tay
clc
lda words,y
adc #<$101
sta words,y
lda words+1,y
adc #>$101
sta words+1,y
//SEG18 [8] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG19 [9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #3
bne b1_from_b1
jmp b2
//SEG20 main::@2
b2:
//SEG21 [10] (byte~) main::$0 ← > *((const word[]) main::words#0) -- vbuaa=_hi__deref_pwuc1
lda words+1
//SEG22 [11] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa
sta SCREEN
//SEG23 [12] (byte~) main::$1 ← < *((const word[]) main::words#0) -- vbuaa=_lo__deref_pwuc1
lda words
//SEG24 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa
sta SCREEN+1
//SEG25 [14] (byte~) main::$2 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) -- vbuaa=_hi__deref_pwuc1
lda words+1*SIZEOF_WORD+1
//SEG26 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa
sta SCREEN+2
//SEG27 [16] (byte~) main::$3 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) -- vbuaa=_lo__deref_pwuc1
lda words+1*SIZEOF_WORD
//SEG28 [17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa
sta SCREEN+3
//SEG29 [18] (byte~) main::$4 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD) -- vbuaa=_hi__deref_pwuc1
lda words+2*SIZEOF_WORD+1
//SEG30 [19] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa
sta SCREEN+4
//SEG31 [20] (byte~) main::$5 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD) -- vbuaa=_lo__deref_pwuc1
lda words+2*SIZEOF_WORD
//SEG32 [21] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte~) main::$5 -- _deref_pbuc1=vbuaa
sta SCREEN+5
jmp breturn
//SEG33 main::@return
breturn:
//SEG34 [22] return
rts
words: .word $3031, $3233, $3435
}
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label b1_from_b1 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction b1_from_b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction b1_from_main:
Removing instruction b2:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(byte~) main::$0 reg byte a 4.0
(byte~) main::$1 reg byte a 4.0
(byte~) main::$2 reg byte a 4.0
(byte~) main::$3 reg byte a 4.0
(byte~) main::$4 reg byte a 4.0
(byte~) main::$5 reg byte a 4.0
(byte) main::$7 reg byte a 33.0
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 11.0
(word[]) main::words
(const word[]) main::words#0 words = { (word/signed word/dword/signed dword) $3031, (word/signed word/dword/signed dword) $3233, (word/signed word/dword/signed dword) $3435 }
reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::$7 ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]
reg byte a [ main::$2 ]
reg byte a [ main::$3 ]
reg byte a [ main::$4 ]
reg byte a [ main::$5 ]
FINAL ASSEMBLER
Score: 449
//SEG0 File Comments
// Test word pointer compound assignment
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_WORD = 2
//SEG3 @begin
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG9 @end
//SEG10 main
main: {
.label SCREEN = $400
//SEG11 [5] phi from main to main::@1 [phi:main->main::@1]
//SEG12 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
//SEG13 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1]
//SEG14 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy
//SEG15 main::@1
b1:
//SEG16 [6] (byte) main::$7 ← (byte) main::i#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuxx_rol_1
txa
asl
//SEG17 [7] *((const word[]) main::words#0 + (byte) main::$7) ← *((const word[]) main::words#0 + (byte) main::$7) + (word/signed word/dword/signed dword) $101 -- pwuc1_derefidx_vbuaa=pwuc1_derefidx_vbuaa_plus_vwuc2
tay
clc
lda words,y
adc #<$101
sta words,y
lda words+1,y
adc #>$101
sta words+1,y
//SEG18 [8] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG19 [9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto main::@1 -- vbuxx_neq_vbuc1_then_la1
cpx #3
bne b1
//SEG20 main::@2
//SEG21 [10] (byte~) main::$0 ← > *((const word[]) main::words#0) -- vbuaa=_hi__deref_pwuc1
lda words+1
//SEG22 [11] *((const byte*) main::SCREEN#0) ← (byte~) main::$0 -- _deref_pbuc1=vbuaa
sta SCREEN
//SEG23 [12] (byte~) main::$1 ← < *((const word[]) main::words#0) -- vbuaa=_lo__deref_pwuc1
lda words
//SEG24 [13] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 -- _deref_pbuc1=vbuaa
sta SCREEN+1
//SEG25 [14] (byte~) main::$2 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) -- vbuaa=_hi__deref_pwuc1
lda words+1*SIZEOF_WORD+1
//SEG26 [15] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2 -- _deref_pbuc1=vbuaa
sta SCREEN+2
//SEG27 [16] (byte~) main::$3 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) -- vbuaa=_lo__deref_pwuc1
lda words+1*SIZEOF_WORD
//SEG28 [17] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$3 -- _deref_pbuc1=vbuaa
sta SCREEN+3
//SEG29 [18] (byte~) main::$4 ← > *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD) -- vbuaa=_hi__deref_pwuc1
lda words+2*SIZEOF_WORD+1
//SEG30 [19] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte~) main::$4 -- _deref_pbuc1=vbuaa
sta SCREEN+4
//SEG31 [20] (byte~) main::$5 ← < *((const word[]) main::words#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_WORD) -- vbuaa=_lo__deref_pwuc1
lda words+2*SIZEOF_WORD
//SEG32 [21] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte~) main::$5 -- _deref_pbuc1=vbuaa
sta SCREEN+5
//SEG33 main::@return
//SEG34 [22] return
rts
words: .word $3031, $3233, $3435
}

View File

@ -0,0 +1,31 @@
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(byte~) main::$0 reg byte a 4.0
(byte~) main::$1 reg byte a 4.0
(byte~) main::$2 reg byte a 4.0
(byte~) main::$3 reg byte a 4.0
(byte~) main::$4 reg byte a 4.0
(byte~) main::$5 reg byte a 4.0
(byte) main::$7 reg byte a 33.0
(label) main::@1
(label) main::@2
(label) main::@return
(byte*) main::SCREEN
(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 11.0
(word[]) main::words
(const word[]) main::words#0 words = { (word/signed word/dword/signed dword) $3031, (word/signed word/dword/signed dword) $3233, (word/signed word/dword/signed dword) $3435 }
reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::$7 ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]
reg byte a [ main::$2 ]
reg byte a [ main::$3 ]
reg byte a [ main::$4 ]
reg byte a [ main::$5 ]