diff --git a/src/main/java/dk/camelot64/kickc/test/TestCompilationOutput.java b/src/main/java/dk/camelot64/kickc/test/TestCompilationOutput.java index 6be86faaf..d89269906 100644 --- a/src/main/java/dk/camelot64/kickc/test/TestCompilationOutput.java +++ b/src/main/java/dk/camelot64/kickc/test/TestCompilationOutput.java @@ -24,6 +24,10 @@ public class TestCompilationOutput extends TestCase { helper = new ReferenceHelper("dk/camelot64/kickc/test/ref/"); } + public void testScroll() throws IOException, URISyntaxException { + compileAndCompare("scroll"); + } + public void testConstantMin() throws IOException, URISyntaxException { compileAndCompare("constantmin"); } diff --git a/src/main/java/dk/camelot64/kickc/test/ref/scroll.asm b/src/main/java/dk/camelot64/kickc/test/ref/scroll.asm new file mode 100644 index 000000000..53a53c7d9 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/test/ref/scroll.asm @@ -0,0 +1,88 @@ + .const SCREEN = $400 + .const RASTER = $d012 + .const BGCOL = $d020 + .const SCROLL = $d016 + TEXT: .text "this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. " + STOP: .byte 0 + jsr main +main: { + .const line = SCREEN+$28 + .label nxt = 2 + jsr fillscreen + lda #TEXT + sta nxt+1 + ldx #7 + b2: + lda RASTER + cmp #$fe + bne b2 + b3: + lda RASTER + cmp #$ff + bne b3 + lda BGCOL + clc + adc #1 + sta BGCOL + dex + cpx #$ff + bne b4 + ldx #0 + b5: + lda line+1,x + sta line,x + inx + cpx #$27 + bne b5 + ldy #0 + lda (nxt),y + cmp #0 + bne b6 + lda #TEXT + sta nxt+1 + lda TEXT + b6: + sta line+$27 + inc nxt + bne !+ + inc nxt+1 + !: + ldx #7 + b4: + stx SCROLL + lda BGCOL + sec + sbc #1 + sta BGCOL + jmp b2 + rts +} +fillscreen: { + .const fill = $20 + .label cursor = 2 + lda #SCREEN + sta cursor+1 + b1: + ldy #0 + lda #fill + sta (cursor),y + inc cursor + bne !+ + inc cursor+1 + !: + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1 + bne !+ + lda cursor + cmp #TEXT + sta nxt+1 + //SEG10 [3] phi (byte) main::scroll#3 = (byte) 7 -- zpby1=coby1 + lda #7 + sta scroll + jmp b2 + //SEG11 [3] phi from main::@2 to main::@2 + b2_from_b2: + jmp b2 + //SEG12 [3] phi from main::@4 to main::@2 + b2_from_b4: + //SEG13 [3] phi (byte*) main::nxt#3 = (byte*) main::nxt#10 -- register_copy + //SEG14 [3] phi (byte) main::scroll#3 = (byte) main::scroll#10 -- register_copy + jmp b2 + //SEG15 main::@2 + b2: + //SEG16 [4] (byte~) main::$2 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$2 ] -- zpby1=_star_cowo1 + lda RASTER + sta _2 + //SEG17 [5] if((byte~) main::$2!=(byte) 254) goto main::@2 [ main::scroll#3 main::nxt#3 ] -- zpby1_neq_coby1_then_la1 + lda _2 + cmp #$fe + bne b2_from_b2 + jmp b3 + //SEG18 main::@3 + b3: + //SEG19 [6] (byte~) main::$4 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$4 ] -- zpby1=_star_cowo1 + lda RASTER + sta _4 + //SEG20 [7] if((byte~) main::$4!=(byte) 255) goto main::@3 [ main::scroll#3 main::nxt#3 ] -- zpby1_neq_coby1_then_la1 + lda _4 + cmp #$ff + bne b3 + jmp b8 + //SEG21 main::@8 + b8: + //SEG22 [8] (byte~) main::$6 ← * (const byte*) BGCOL#0 [ main::scroll#3 main::nxt#3 main::$6 ] -- zpby1=_star_cowo1 + lda BGCOL + sta _6 + //SEG23 [9] (byte~) main::$7 ← (byte~) main::$6 + (byte) 1 [ main::scroll#3 main::nxt#3 main::$7 ] -- zpby1=zpby2_plus_1 + lda _6 + clc + adc #1 + sta _7 + //SEG24 [10] *((const byte*) BGCOL#0) ← (byte~) main::$7 [ main::scroll#3 main::nxt#3 ] -- _star_cowo1=zpby1 + lda _7 + sta BGCOL + //SEG25 [11] (byte) main::scroll#1 ← -- (byte) main::scroll#3 [ main::nxt#3 main::scroll#1 ] -- zpby1=_dec_zpby1 + dec scroll + //SEG26 [12] if((byte) main::scroll#1!=(byte) 255) goto main::@4 [ main::nxt#3 main::scroll#1 ] -- zpby1_neq_coby1_then_la1 + lda scroll + cmp #$ff + bne b4_from_b8 + //SEG27 [13] phi from main::@8 to main::@5 + b5_from_b8: + //SEG28 [13] phi (byte) main::i#2 = (byte) 0 -- zpby1=coby1 + lda #0 + sta i + jmp b5 + //SEG29 [13] phi from main::@5 to main::@5 + b5_from_b5: + //SEG30 [13] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy + jmp b5 + //SEG31 main::@5 + b5: + //SEG32 [14] (byte~) main::$11 ← (const byte[]) main::line#0+(byte) 1 *idx (byte) main::i#2 [ main::nxt#3 main::i#2 main::$11 ] -- zpby1=cowo1_staridx_zpby2 + ldx i + lda line+1,x + sta _11 + //SEG33 [15] *((const byte[]) main::line#0 + (byte) main::i#2) ← (byte~) main::$11 [ main::nxt#3 main::i#2 ] -- cowo1_staridx_zpby1=zpby2 + lda _11 + ldx i + sta line,x + //SEG34 [16] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::nxt#3 main::i#1 ] -- zpby1=_inc_zpby1 + inc i + //SEG35 [17] if((byte) main::i#1!=(byte) 39) goto main::@5 [ main::nxt#3 main::i#1 ] -- zpby1_neq_coby1_then_la1 + lda i + cmp #$27 + bne b5_from_b5 + jmp b10 + //SEG36 main::@10 + b10: + //SEG37 [18] (byte) main::c#0 ← * (byte*) main::nxt#3 [ main::nxt#3 main::c#0 ] -- zpby1=_star_zpptrby1 + ldy #0 + lda (nxt),y + sta c + //SEG38 [19] if((byte) main::c#0!=(byte) 0) goto main::@6 [ main::nxt#3 main::c#0 ] -- zpby1_neq_0_then_la1 + lda c + bne b6_from_b10 + jmp b11 + //SEG39 main::@11 + b11: + //SEG40 [20] (byte) main::c#1 ← * (const byte*) TEXT#0 [ main::c#1 ] -- zpby1=_star_cowo1 + lda TEXT + sta c + //SEG41 [21] phi from main::@11 to main::@6 + b6_from_b11: + //SEG42 [21] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 -- zpptrby1=cowo1 + lda #TEXT + sta nxt+1 + //SEG43 [21] phi (byte) main::c#2 = (byte) main::c#1 -- register_copy + jmp b6 + //SEG44 [21] phi from main::@10 to main::@6 + b6_from_b10: + //SEG45 [21] phi (byte*) main::nxt#4 = (byte*) main::nxt#3 -- register_copy + //SEG46 [21] phi (byte) main::c#2 = (byte) main::c#0 -- register_copy + jmp b6 + //SEG47 main::@6 + b6: + //SEG48 [22] *((const byte[]) main::line#0+(byte) 39) ← (byte) main::c#2 [ main::nxt#4 ] -- _star_cowo1=zpby1 + lda c + sta line+$27 + //SEG49 [23] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 [ main::nxt#1 ] -- zpptrby1=_inc_zpptrby1 + inc nxt + bne !+ + inc nxt+1 + !: + //SEG50 [24] phi from main::@6 to main::@4 + b4_from_b6: + //SEG51 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 -- register_copy + //SEG52 [24] phi (byte) main::scroll#10 = (byte) 7 -- zpby1=coby1 + lda #7 + sta scroll + jmp b4 + //SEG53 [24] phi from main::@8 to main::@4 + b4_from_b8: + //SEG54 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#3 -- register_copy + //SEG55 [24] phi (byte) main::scroll#10 = (byte) main::scroll#1 -- register_copy + jmp b4 + //SEG56 main::@4 + b4: + //SEG57 [25] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=zpby1 + lda scroll + sta SCROLL + //SEG58 [26] (byte~) main::$17 ← * (const byte*) BGCOL#0 [ main::scroll#10 main::nxt#10 main::$17 ] -- zpby1=_star_cowo1 + lda BGCOL + sta _17 + //SEG59 [27] (byte~) main::$18 ← (byte~) main::$17 - (byte) 1 [ main::scroll#10 main::nxt#10 main::$18 ] -- zpby1=zpby2_minus_1 + lda _17 + sec + sbc #1 + sta _18 + //SEG60 [28] *((const byte*) BGCOL#0) ← (byte~) main::$18 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=zpby1 + lda _18 + sta BGCOL + //SEG61 [29] if(true) goto main::@2 [ main::scroll#10 main::nxt#10 ] -- true_then_la1 + jmp b2_from_b4 + jmp breturn + //SEG62 main::@return + breturn: + //SEG63 [30] return [ ] + rts +} +//SEG64 fillscreen +fillscreen: { + .const fill = $20 + .label cursor = 7 + //SEG65 [32] phi from fillscreen to fillscreen::@1 + b1_from_fillscreen: + //SEG66 [32] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 -- zpptrby1=cowo1 + lda #SCREEN + sta cursor+1 + jmp b1 + //SEG67 [32] phi from fillscreen::@1 to fillscreen::@1 + b1_from_b1: + //SEG68 [32] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 -- register_copy + jmp b1 + //SEG69 fillscreen::@1 + b1: + //SEG70 [33] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] -- _star_zpptrby1=coby1 + ldy #0 + lda #fill + sta (cursor),y + //SEG71 [34] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] -- zpptrby1=_inc_zpptrby1 + inc cursor + bne !+ + inc cursor+1 + !: + //SEG72 [35] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] -- zpptrby1_lt_cowo1_then_la1 + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1_from_b1 + bne !+ + lda cursor + cmp #TEXT + sta nxt+1 + //SEG10 [3] phi (byte) main::scroll#3 = (byte) 7 -- xby=coby1 + ldx #7 + jmp b2 + //SEG11 [3] phi from main::@2 to main::@2 + b2_from_b2: + jmp b2 + //SEG12 [3] phi from main::@4 to main::@2 + b2_from_b4: + //SEG13 [3] phi (byte*) main::nxt#3 = (byte*) main::nxt#10 -- register_copy + //SEG14 [3] phi (byte) main::scroll#3 = (byte) main::scroll#10 -- register_copy + //SEG15 main::@2 + b2: + //SEG16 [4] (byte~) main::$2 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$2 ] -- aby=_star_cowo1 + lda RASTER + //SEG17 [5] if((byte~) main::$2!=(byte) 254) goto main::@2 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$fe + bne b2_from_b2 + //SEG18 main::@3 + b3: + //SEG19 [6] (byte~) main::$4 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$4 ] -- aby=_star_cowo1 + lda RASTER + //SEG20 [7] if((byte~) main::$4!=(byte) 255) goto main::@3 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$ff + bne b3 + //SEG21 main::@8 + b8: + //SEG22 [8] (byte~) main::$6 ← * (const byte*) BGCOL#0 [ main::scroll#3 main::nxt#3 main::$6 ] -- aby=_star_cowo1 + lda BGCOL + //SEG23 [9] (byte~) main::$7 ← (byte~) main::$6 + (byte) 1 [ main::scroll#3 main::nxt#3 main::$7 ] -- aby=aby_plus_1 + clc + adc #1 + //SEG24 [10] *((const byte*) BGCOL#0) ← (byte~) main::$7 [ main::scroll#3 main::nxt#3 ] -- _star_cowo1=aby + sta BGCOL + //SEG25 [11] (byte) main::scroll#1 ← -- (byte) main::scroll#3 [ main::nxt#3 main::scroll#1 ] -- xby=_dec_xby + dex + //SEG26 [12] if((byte) main::scroll#1!=(byte) 255) goto main::@4 [ main::nxt#3 main::scroll#1 ] -- xby_neq_coby1_then_la1 + cpx #$ff + bne b4_from_b8 + //SEG27 [13] phi from main::@8 to main::@5 + b5_from_b8: + //SEG28 [13] phi (byte) main::i#2 = (byte) 0 -- xby=coby1 + ldx #0 + jmp b5 + //SEG29 [13] phi from main::@5 to main::@5 + b5_from_b5: + //SEG30 [13] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy + //SEG31 main::@5 + b5: + //SEG32 [14] (byte~) main::$11 ← (const byte[]) main::line#0+(byte) 1 *idx (byte) main::i#2 [ main::nxt#3 main::i#2 main::$11 ] -- aby=cowo1_staridx_xby + lda line+1,x + //SEG33 [15] *((const byte[]) main::line#0 + (byte) main::i#2) ← (byte~) main::$11 [ main::nxt#3 main::i#2 ] -- cowo1_staridx_xby=aby + sta line,x + //SEG34 [16] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::nxt#3 main::i#1 ] -- xby=_inc_xby + inx + //SEG35 [17] if((byte) main::i#1!=(byte) 39) goto main::@5 [ main::nxt#3 main::i#1 ] -- xby_neq_coby1_then_la1 + cpx #$27 + bne b5_from_b5 + //SEG36 main::@10 + b10: + //SEG37 [18] (byte) main::c#0 ← * (byte*) main::nxt#3 [ main::nxt#3 main::c#0 ] -- aby=_star_zpptrby1 + ldy #0 + lda (nxt),y + //SEG38 [19] if((byte) main::c#0!=(byte) 0) goto main::@6 [ main::nxt#3 main::c#0 ] -- aby_neq_0_then_la1 + cmp #0 + bne b6_from_b10 + //SEG39 main::@11 + b11: + //SEG40 [20] (byte) main::c#1 ← * (const byte*) TEXT#0 [ main::c#1 ] -- aby=_star_cowo1 + lda TEXT + //SEG41 [21] phi from main::@11 to main::@6 + b6_from_b11: + //SEG42 [21] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 -- zpptrby1=cowo1 + lda #TEXT + sta nxt+1 + //SEG43 [21] phi (byte) main::c#2 = (byte) main::c#1 -- register_copy + jmp b6 + //SEG44 [21] phi from main::@10 to main::@6 + b6_from_b10: + //SEG45 [21] phi (byte*) main::nxt#4 = (byte*) main::nxt#3 -- register_copy + //SEG46 [21] phi (byte) main::c#2 = (byte) main::c#0 -- register_copy + //SEG47 main::@6 + b6: + //SEG48 [22] *((const byte[]) main::line#0+(byte) 39) ← (byte) main::c#2 [ main::nxt#4 ] -- _star_cowo1=aby + sta line+$27 + //SEG49 [23] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 [ main::nxt#1 ] -- zpptrby1=_inc_zpptrby1 + inc nxt + bne !+ + inc nxt+1 + !: + //SEG50 [24] phi from main::@6 to main::@4 + b4_from_b6: + //SEG51 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 -- register_copy + //SEG52 [24] phi (byte) main::scroll#10 = (byte) 7 -- xby=coby1 + ldx #7 + jmp b4 + //SEG53 [24] phi from main::@8 to main::@4 + b4_from_b8: + //SEG54 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#3 -- register_copy + //SEG55 [24] phi (byte) main::scroll#10 = (byte) main::scroll#1 -- register_copy + //SEG56 main::@4 + b4: + //SEG57 [25] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=xby + stx SCROLL + //SEG58 [26] (byte~) main::$17 ← * (const byte*) BGCOL#0 [ main::scroll#10 main::nxt#10 main::$17 ] -- aby=_star_cowo1 + lda BGCOL + //SEG59 [27] (byte~) main::$18 ← (byte~) main::$17 - (byte) 1 [ main::scroll#10 main::nxt#10 main::$18 ] -- aby=aby_minus_1 + sec + sbc #1 + //SEG60 [28] *((const byte*) BGCOL#0) ← (byte~) main::$18 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=aby + sta BGCOL + //SEG61 [29] if(true) goto main::@2 [ main::scroll#10 main::nxt#10 ] -- true_then_la1 + jmp b2_from_b4 + //SEG62 main::@return + breturn: + //SEG63 [30] return [ ] + rts +} +//SEG64 fillscreen +fillscreen: { + .const fill = $20 + .label cursor = 2 + //SEG65 [32] phi from fillscreen to fillscreen::@1 + b1_from_fillscreen: + //SEG66 [32] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 -- zpptrby1=cowo1 + lda #SCREEN + sta cursor+1 + jmp b1 + //SEG67 [32] phi from fillscreen::@1 to fillscreen::@1 + b1_from_b1: + //SEG68 [32] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 -- register_copy + //SEG69 fillscreen::@1 + b1: + //SEG70 [33] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] -- _star_zpptrby1=coby1 + ldy #0 + lda #fill + sta (cursor),y + //SEG71 [34] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] -- zpptrby1=_inc_zpptrby1 + inc cursor + bne !+ + inc cursor+1 + !: + //SEG72 [35] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] -- zpptrby1_lt_cowo1_then_la1 + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1_from_b1 + bne !+ + lda cursor + cmp #TEXT + sta nxt+1 + //SEG10 [3] phi (byte) main::scroll#3 = (byte) 7 -- xby=coby1 + ldx #7 + jmp b2 + //SEG11 [3] phi from main::@2 to main::@2 + b2_from_b2: + jmp b2 + //SEG12 [3] phi from main::@4 to main::@2 + //SEG13 [3] phi (byte*) main::nxt#3 = (byte*) main::nxt#10 -- register_copy + //SEG14 [3] phi (byte) main::scroll#3 = (byte) main::scroll#10 -- register_copy + //SEG15 main::@2 + b2: + //SEG16 [4] (byte~) main::$2 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$2 ] -- aby=_star_cowo1 + lda RASTER + //SEG17 [5] if((byte~) main::$2!=(byte) 254) goto main::@2 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$fe + bne b2_from_b2 + //SEG18 main::@3 + b3: + //SEG19 [6] (byte~) main::$4 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$4 ] -- aby=_star_cowo1 + lda RASTER + //SEG20 [7] if((byte~) main::$4!=(byte) 255) goto main::@3 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$ff + bne b3 + //SEG21 main::@8 + b8: + //SEG22 [8] (byte~) main::$6 ← * (const byte*) BGCOL#0 [ main::scroll#3 main::nxt#3 main::$6 ] -- aby=_star_cowo1 + lda BGCOL + //SEG23 [9] (byte~) main::$7 ← (byte~) main::$6 + (byte) 1 [ main::scroll#3 main::nxt#3 main::$7 ] -- aby=aby_plus_1 + clc + adc #1 + //SEG24 [10] *((const byte*) BGCOL#0) ← (byte~) main::$7 [ main::scroll#3 main::nxt#3 ] -- _star_cowo1=aby + sta BGCOL + //SEG25 [11] (byte) main::scroll#1 ← -- (byte) main::scroll#3 [ main::nxt#3 main::scroll#1 ] -- xby=_dec_xby + dex + //SEG26 [12] if((byte) main::scroll#1!=(byte) 255) goto main::@4 [ main::nxt#3 main::scroll#1 ] -- xby_neq_coby1_then_la1 + cpx #$ff + bne b4 + //SEG27 [13] phi from main::@8 to main::@5 + b5_from_b8: + //SEG28 [13] phi (byte) main::i#2 = (byte) 0 -- xby=coby1 + ldx #0 + jmp b5 + //SEG29 [13] phi from main::@5 to main::@5 + //SEG30 [13] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy + //SEG31 main::@5 + b5: + //SEG32 [14] (byte~) main::$11 ← (const byte[]) main::line#0+(byte) 1 *idx (byte) main::i#2 [ main::nxt#3 main::i#2 main::$11 ] -- aby=cowo1_staridx_xby + lda line+1,x + //SEG33 [15] *((const byte[]) main::line#0 + (byte) main::i#2) ← (byte~) main::$11 [ main::nxt#3 main::i#2 ] -- cowo1_staridx_xby=aby + sta line,x + //SEG34 [16] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::nxt#3 main::i#1 ] -- xby=_inc_xby + inx + //SEG35 [17] if((byte) main::i#1!=(byte) 39) goto main::@5 [ main::nxt#3 main::i#1 ] -- xby_neq_coby1_then_la1 + cpx #$27 + bne b5 + //SEG36 main::@10 + b10: + //SEG37 [18] (byte) main::c#0 ← * (byte*) main::nxt#3 [ main::nxt#3 main::c#0 ] -- aby=_star_zpptrby1 + ldy #0 + lda (nxt),y + //SEG38 [19] if((byte) main::c#0!=(byte) 0) goto main::@6 [ main::nxt#3 main::c#0 ] -- aby_neq_0_then_la1 + cmp #0 + bne b6 + //SEG39 main::@11 + b11: + //SEG40 [20] (byte) main::c#1 ← * (const byte*) TEXT#0 [ main::c#1 ] -- aby=_star_cowo1 + lda TEXT + //SEG41 [21] phi from main::@11 to main::@6 + b6_from_b11: + //SEG42 [21] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 -- zpptrby1=cowo1 + lda #TEXT + sta nxt+1 + //SEG43 [21] phi (byte) main::c#2 = (byte) main::c#1 -- register_copy + jmp b6 + //SEG44 [21] phi from main::@10 to main::@6 + //SEG45 [21] phi (byte*) main::nxt#4 = (byte*) main::nxt#3 -- register_copy + //SEG46 [21] phi (byte) main::c#2 = (byte) main::c#0 -- register_copy + //SEG47 main::@6 + b6: + //SEG48 [22] *((const byte[]) main::line#0+(byte) 39) ← (byte) main::c#2 [ main::nxt#4 ] -- _star_cowo1=aby + sta line+$27 + //SEG49 [23] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 [ main::nxt#1 ] -- zpptrby1=_inc_zpptrby1 + inc nxt + bne !+ + inc nxt+1 + !: + //SEG50 [24] phi from main::@6 to main::@4 + b4_from_b6: + //SEG51 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 -- register_copy + //SEG52 [24] phi (byte) main::scroll#10 = (byte) 7 -- xby=coby1 + ldx #7 + jmp b4 + //SEG53 [24] phi from main::@8 to main::@4 + //SEG54 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#3 -- register_copy + //SEG55 [24] phi (byte) main::scroll#10 = (byte) main::scroll#1 -- register_copy + //SEG56 main::@4 + b4: + //SEG57 [25] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=xby + stx SCROLL + //SEG58 [26] (byte~) main::$17 ← * (const byte*) BGCOL#0 [ main::scroll#10 main::nxt#10 main::$17 ] -- aby=_star_cowo1 + lda BGCOL + //SEG59 [27] (byte~) main::$18 ← (byte~) main::$17 - (byte) 1 [ main::scroll#10 main::nxt#10 main::$18 ] -- aby=aby_minus_1 + sec + sbc #1 + //SEG60 [28] *((const byte*) BGCOL#0) ← (byte~) main::$18 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=aby + sta BGCOL + //SEG61 [29] if(true) goto main::@2 [ main::scroll#10 main::nxt#10 ] -- true_then_la1 + jmp b2 + //SEG62 main::@return + breturn: + //SEG63 [30] return [ ] + rts +} +//SEG64 fillscreen +fillscreen: { + .const fill = $20 + .label cursor = 2 + //SEG65 [32] phi from fillscreen to fillscreen::@1 + b1_from_fillscreen: + //SEG66 [32] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 -- zpptrby1=cowo1 + lda #SCREEN + sta cursor+1 + jmp b1 + //SEG67 [32] phi from fillscreen::@1 to fillscreen::@1 + //SEG68 [32] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 -- register_copy + //SEG69 fillscreen::@1 + b1: + //SEG70 [33] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] -- _star_zpptrby1=coby1 + ldy #0 + lda #fill + sta (cursor),y + //SEG71 [34] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] -- zpptrby1=_inc_zpptrby1 + inc cursor + bne !+ + inc cursor+1 + !: + //SEG72 [35] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] -- zpptrby1_lt_cowo1_then_la1 + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1 + bne !+ + lda cursor + cmp #TEXT + sta nxt+1 + //SEG10 [3] phi (byte) main::scroll#3 = (byte) 7 -- xby=coby1 + ldx #7 + jmp b2 + //SEG11 [3] phi from main::@2 to main::@2 + b2_from_b2: + jmp b2 + //SEG12 [3] phi from main::@4 to main::@2 + //SEG13 [3] phi (byte*) main::nxt#3 = (byte*) main::nxt#10 -- register_copy + //SEG14 [3] phi (byte) main::scroll#3 = (byte) main::scroll#10 -- register_copy + //SEG15 main::@2 + b2: + //SEG16 [4] (byte~) main::$2 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$2 ] -- aby=_star_cowo1 + lda RASTER + //SEG17 [5] if((byte~) main::$2!=(byte) 254) goto main::@2 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$fe + bne b2_from_b2 + //SEG18 main::@3 + b3: + //SEG19 [6] (byte~) main::$4 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$4 ] -- aby=_star_cowo1 + lda RASTER + //SEG20 [7] if((byte~) main::$4!=(byte) 255) goto main::@3 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$ff + bne b3 + //SEG21 main::@8 + //SEG22 [8] (byte~) main::$6 ← * (const byte*) BGCOL#0 [ main::scroll#3 main::nxt#3 main::$6 ] -- aby=_star_cowo1 + lda BGCOL + //SEG23 [9] (byte~) main::$7 ← (byte~) main::$6 + (byte) 1 [ main::scroll#3 main::nxt#3 main::$7 ] -- aby=aby_plus_1 + clc + adc #1 + //SEG24 [10] *((const byte*) BGCOL#0) ← (byte~) main::$7 [ main::scroll#3 main::nxt#3 ] -- _star_cowo1=aby + sta BGCOL + //SEG25 [11] (byte) main::scroll#1 ← -- (byte) main::scroll#3 [ main::nxt#3 main::scroll#1 ] -- xby=_dec_xby + dex + //SEG26 [12] if((byte) main::scroll#1!=(byte) 255) goto main::@4 [ main::nxt#3 main::scroll#1 ] -- xby_neq_coby1_then_la1 + cpx #$ff + bne b4 + //SEG27 [13] phi from main::@8 to main::@5 + //SEG28 [13] phi (byte) main::i#2 = (byte) 0 -- xby=coby1 + ldx #0 + jmp b5 + //SEG29 [13] phi from main::@5 to main::@5 + //SEG30 [13] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy + //SEG31 main::@5 + b5: + //SEG32 [14] (byte~) main::$11 ← (const byte[]) main::line#0+(byte) 1 *idx (byte) main::i#2 [ main::nxt#3 main::i#2 main::$11 ] -- aby=cowo1_staridx_xby + lda line+1,x + //SEG33 [15] *((const byte[]) main::line#0 + (byte) main::i#2) ← (byte~) main::$11 [ main::nxt#3 main::i#2 ] -- cowo1_staridx_xby=aby + sta line,x + //SEG34 [16] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::nxt#3 main::i#1 ] -- xby=_inc_xby + inx + //SEG35 [17] if((byte) main::i#1!=(byte) 39) goto main::@5 [ main::nxt#3 main::i#1 ] -- xby_neq_coby1_then_la1 + cpx #$27 + bne b5 + //SEG36 main::@10 + //SEG37 [18] (byte) main::c#0 ← * (byte*) main::nxt#3 [ main::nxt#3 main::c#0 ] -- aby=_star_zpptrby1 + ldy #0 + lda (nxt),y + //SEG38 [19] if((byte) main::c#0!=(byte) 0) goto main::@6 [ main::nxt#3 main::c#0 ] -- aby_neq_0_then_la1 + cmp #0 + bne b6 + //SEG39 main::@11 + //SEG40 [20] (byte) main::c#1 ← * (const byte*) TEXT#0 [ main::c#1 ] -- aby=_star_cowo1 + lda TEXT + //SEG41 [21] phi from main::@11 to main::@6 + //SEG42 [21] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 -- zpptrby1=cowo1 + lda #TEXT + sta nxt+1 + //SEG43 [21] phi (byte) main::c#2 = (byte) main::c#1 -- register_copy + jmp b6 + //SEG44 [21] phi from main::@10 to main::@6 + //SEG45 [21] phi (byte*) main::nxt#4 = (byte*) main::nxt#3 -- register_copy + //SEG46 [21] phi (byte) main::c#2 = (byte) main::c#0 -- register_copy + //SEG47 main::@6 + b6: + //SEG48 [22] *((const byte[]) main::line#0+(byte) 39) ← (byte) main::c#2 [ main::nxt#4 ] -- _star_cowo1=aby + sta line+$27 + //SEG49 [23] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 [ main::nxt#1 ] -- zpptrby1=_inc_zpptrby1 + inc nxt + bne !+ + inc nxt+1 + !: + //SEG50 [24] phi from main::@6 to main::@4 + //SEG51 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 -- register_copy + //SEG52 [24] phi (byte) main::scroll#10 = (byte) 7 -- xby=coby1 + ldx #7 + jmp b4 + //SEG53 [24] phi from main::@8 to main::@4 + //SEG54 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#3 -- register_copy + //SEG55 [24] phi (byte) main::scroll#10 = (byte) main::scroll#1 -- register_copy + //SEG56 main::@4 + b4: + //SEG57 [25] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=xby + stx SCROLL + //SEG58 [26] (byte~) main::$17 ← * (const byte*) BGCOL#0 [ main::scroll#10 main::nxt#10 main::$17 ] -- aby=_star_cowo1 + lda BGCOL + //SEG59 [27] (byte~) main::$18 ← (byte~) main::$17 - (byte) 1 [ main::scroll#10 main::nxt#10 main::$18 ] -- aby=aby_minus_1 + sec + sbc #1 + //SEG60 [28] *((const byte*) BGCOL#0) ← (byte~) main::$18 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=aby + sta BGCOL + //SEG61 [29] if(true) goto main::@2 [ main::scroll#10 main::nxt#10 ] -- true_then_la1 + jmp b2 + //SEG62 main::@return + //SEG63 [30] return [ ] + rts +} +//SEG64 fillscreen +fillscreen: { + .const fill = $20 + .label cursor = 2 + //SEG65 [32] phi from fillscreen to fillscreen::@1 + //SEG66 [32] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 -- zpptrby1=cowo1 + lda #SCREEN + sta cursor+1 + jmp b1 + //SEG67 [32] phi from fillscreen::@1 to fillscreen::@1 + //SEG68 [32] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 -- register_copy + //SEG69 fillscreen::@1 + b1: + //SEG70 [33] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] -- _star_zpptrby1=coby1 + ldy #0 + lda #fill + sta (cursor),y + //SEG71 [34] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] -- zpptrby1=_inc_zpptrby1 + inc cursor + bne !+ + inc cursor+1 + !: + //SEG72 [35] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] -- zpptrby1_lt_cowo1_then_la1 + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1 + bne !+ + lda cursor + cmp #TEXT + sta nxt+1 + //SEG10 [3] phi (byte) main::scroll#3 = (byte) 7 -- xby=coby1 + ldx #7 + jmp b2 + //SEG11 [3] phi from main::@2 to main::@2 + b2_from_b2: + //SEG12 [3] phi from main::@4 to main::@2 + //SEG13 [3] phi (byte*) main::nxt#3 = (byte*) main::nxt#10 -- register_copy + //SEG14 [3] phi (byte) main::scroll#3 = (byte) main::scroll#10 -- register_copy + //SEG15 main::@2 + b2: + //SEG16 [4] (byte~) main::$2 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$2 ] -- aby=_star_cowo1 + lda RASTER + //SEG17 [5] if((byte~) main::$2!=(byte) 254) goto main::@2 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$fe + bne b2_from_b2 + //SEG18 main::@3 + b3: + //SEG19 [6] (byte~) main::$4 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$4 ] -- aby=_star_cowo1 + lda RASTER + //SEG20 [7] if((byte~) main::$4!=(byte) 255) goto main::@3 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$ff + bne b3 + //SEG21 main::@8 + //SEG22 [8] (byte~) main::$6 ← * (const byte*) BGCOL#0 [ main::scroll#3 main::nxt#3 main::$6 ] -- aby=_star_cowo1 + lda BGCOL + //SEG23 [9] (byte~) main::$7 ← (byte~) main::$6 + (byte) 1 [ main::scroll#3 main::nxt#3 main::$7 ] -- aby=aby_plus_1 + clc + adc #1 + //SEG24 [10] *((const byte*) BGCOL#0) ← (byte~) main::$7 [ main::scroll#3 main::nxt#3 ] -- _star_cowo1=aby + sta BGCOL + //SEG25 [11] (byte) main::scroll#1 ← -- (byte) main::scroll#3 [ main::nxt#3 main::scroll#1 ] -- xby=_dec_xby + dex + //SEG26 [12] if((byte) main::scroll#1!=(byte) 255) goto main::@4 [ main::nxt#3 main::scroll#1 ] -- xby_neq_coby1_then_la1 + cpx #$ff + bne b4 + //SEG27 [13] phi from main::@8 to main::@5 + //SEG28 [13] phi (byte) main::i#2 = (byte) 0 -- xby=coby1 + ldx #0 + //SEG29 [13] phi from main::@5 to main::@5 + //SEG30 [13] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy + //SEG31 main::@5 + b5: + //SEG32 [14] (byte~) main::$11 ← (const byte[]) main::line#0+(byte) 1 *idx (byte) main::i#2 [ main::nxt#3 main::i#2 main::$11 ] -- aby=cowo1_staridx_xby + lda line+1,x + //SEG33 [15] *((const byte[]) main::line#0 + (byte) main::i#2) ← (byte~) main::$11 [ main::nxt#3 main::i#2 ] -- cowo1_staridx_xby=aby + sta line,x + //SEG34 [16] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::nxt#3 main::i#1 ] -- xby=_inc_xby + inx + //SEG35 [17] if((byte) main::i#1!=(byte) 39) goto main::@5 [ main::nxt#3 main::i#1 ] -- xby_neq_coby1_then_la1 + cpx #$27 + bne b5 + //SEG36 main::@10 + //SEG37 [18] (byte) main::c#0 ← * (byte*) main::nxt#3 [ main::nxt#3 main::c#0 ] -- aby=_star_zpptrby1 + ldy #0 + lda (nxt),y + //SEG38 [19] if((byte) main::c#0!=(byte) 0) goto main::@6 [ main::nxt#3 main::c#0 ] -- aby_neq_0_then_la1 + cmp #0 + bne b6 + //SEG39 main::@11 + //SEG40 [20] (byte) main::c#1 ← * (const byte*) TEXT#0 [ main::c#1 ] -- aby=_star_cowo1 + lda TEXT + //SEG41 [21] phi from main::@11 to main::@6 + //SEG42 [21] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 -- zpptrby1=cowo1 + lda #TEXT + sta nxt+1 + //SEG43 [21] phi (byte) main::c#2 = (byte) main::c#1 -- register_copy + //SEG44 [21] phi from main::@10 to main::@6 + //SEG45 [21] phi (byte*) main::nxt#4 = (byte*) main::nxt#3 -- register_copy + //SEG46 [21] phi (byte) main::c#2 = (byte) main::c#0 -- register_copy + //SEG47 main::@6 + b6: + //SEG48 [22] *((const byte[]) main::line#0+(byte) 39) ← (byte) main::c#2 [ main::nxt#4 ] -- _star_cowo1=aby + sta line+$27 + //SEG49 [23] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 [ main::nxt#1 ] -- zpptrby1=_inc_zpptrby1 + inc nxt + bne !+ + inc nxt+1 + !: + //SEG50 [24] phi from main::@6 to main::@4 + //SEG51 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 -- register_copy + //SEG52 [24] phi (byte) main::scroll#10 = (byte) 7 -- xby=coby1 + ldx #7 + //SEG53 [24] phi from main::@8 to main::@4 + //SEG54 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#3 -- register_copy + //SEG55 [24] phi (byte) main::scroll#10 = (byte) main::scroll#1 -- register_copy + //SEG56 main::@4 + b4: + //SEG57 [25] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=xby + stx SCROLL + //SEG58 [26] (byte~) main::$17 ← * (const byte*) BGCOL#0 [ main::scroll#10 main::nxt#10 main::$17 ] -- aby=_star_cowo1 + lda BGCOL + //SEG59 [27] (byte~) main::$18 ← (byte~) main::$17 - (byte) 1 [ main::scroll#10 main::nxt#10 main::$18 ] -- aby=aby_minus_1 + sec + sbc #1 + //SEG60 [28] *((const byte*) BGCOL#0) ← (byte~) main::$18 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=aby + sta BGCOL + //SEG61 [29] if(true) goto main::@2 [ main::scroll#10 main::nxt#10 ] -- true_then_la1 + jmp b2 + //SEG62 main::@return + //SEG63 [30] return [ ] + rts +} +//SEG64 fillscreen +fillscreen: { + .const fill = $20 + .label cursor = 2 + //SEG65 [32] phi from fillscreen to fillscreen::@1 + //SEG66 [32] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 -- zpptrby1=cowo1 + lda #SCREEN + sta cursor+1 + //SEG67 [32] phi from fillscreen::@1 to fillscreen::@1 + //SEG68 [32] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 -- register_copy + //SEG69 fillscreen::@1 + b1: + //SEG70 [33] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] -- _star_zpptrby1=coby1 + ldy #0 + lda #fill + sta (cursor),y + //SEG71 [34] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] -- zpptrby1=_inc_zpptrby1 + inc cursor + bne !+ + inc cursor+1 + !: + //SEG72 [35] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] -- zpptrby1_lt_cowo1_then_la1 + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1 + bne !+ + lda cursor + cmp #TEXT + sta nxt+1 + //SEG10 [3] phi (byte) main::scroll#3 = (byte) 7 -- xby=coby1 + ldx #7 + jmp b2 + //SEG11 [3] phi from main::@2 to main::@2 + //SEG12 [3] phi from main::@4 to main::@2 + //SEG13 [3] phi (byte*) main::nxt#3 = (byte*) main::nxt#10 -- register_copy + //SEG14 [3] phi (byte) main::scroll#3 = (byte) main::scroll#10 -- register_copy + //SEG15 main::@2 + b2: + //SEG16 [4] (byte~) main::$2 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$2 ] -- aby=_star_cowo1 + lda RASTER + //SEG17 [5] if((byte~) main::$2!=(byte) 254) goto main::@2 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$fe + bne b2 + //SEG18 main::@3 + b3: + //SEG19 [6] (byte~) main::$4 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$4 ] -- aby=_star_cowo1 + lda RASTER + //SEG20 [7] if((byte~) main::$4!=(byte) 255) goto main::@3 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$ff + bne b3 + //SEG21 main::@8 + //SEG22 [8] (byte~) main::$6 ← * (const byte*) BGCOL#0 [ main::scroll#3 main::nxt#3 main::$6 ] -- aby=_star_cowo1 + lda BGCOL + //SEG23 [9] (byte~) main::$7 ← (byte~) main::$6 + (byte) 1 [ main::scroll#3 main::nxt#3 main::$7 ] -- aby=aby_plus_1 + clc + adc #1 + //SEG24 [10] *((const byte*) BGCOL#0) ← (byte~) main::$7 [ main::scroll#3 main::nxt#3 ] -- _star_cowo1=aby + sta BGCOL + //SEG25 [11] (byte) main::scroll#1 ← -- (byte) main::scroll#3 [ main::nxt#3 main::scroll#1 ] -- xby=_dec_xby + dex + //SEG26 [12] if((byte) main::scroll#1!=(byte) 255) goto main::@4 [ main::nxt#3 main::scroll#1 ] -- xby_neq_coby1_then_la1 + cpx #$ff + bne b4 + //SEG27 [13] phi from main::@8 to main::@5 + //SEG28 [13] phi (byte) main::i#2 = (byte) 0 -- xby=coby1 + ldx #0 + //SEG29 [13] phi from main::@5 to main::@5 + //SEG30 [13] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy + //SEG31 main::@5 + b5: + //SEG32 [14] (byte~) main::$11 ← (const byte[]) main::line#0+(byte) 1 *idx (byte) main::i#2 [ main::nxt#3 main::i#2 main::$11 ] -- aby=cowo1_staridx_xby + lda line+1,x + //SEG33 [15] *((const byte[]) main::line#0 + (byte) main::i#2) ← (byte~) main::$11 [ main::nxt#3 main::i#2 ] -- cowo1_staridx_xby=aby + sta line,x + //SEG34 [16] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::nxt#3 main::i#1 ] -- xby=_inc_xby + inx + //SEG35 [17] if((byte) main::i#1!=(byte) 39) goto main::@5 [ main::nxt#3 main::i#1 ] -- xby_neq_coby1_then_la1 + cpx #$27 + bne b5 + //SEG36 main::@10 + //SEG37 [18] (byte) main::c#0 ← * (byte*) main::nxt#3 [ main::nxt#3 main::c#0 ] -- aby=_star_zpptrby1 + ldy #0 + lda (nxt),y + //SEG38 [19] if((byte) main::c#0!=(byte) 0) goto main::@6 [ main::nxt#3 main::c#0 ] -- aby_neq_0_then_la1 + cmp #0 + bne b6 + //SEG39 main::@11 + //SEG40 [20] (byte) main::c#1 ← * (const byte*) TEXT#0 [ main::c#1 ] -- aby=_star_cowo1 + lda TEXT + //SEG41 [21] phi from main::@11 to main::@6 + //SEG42 [21] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 -- zpptrby1=cowo1 + lda #TEXT + sta nxt+1 + //SEG43 [21] phi (byte) main::c#2 = (byte) main::c#1 -- register_copy + //SEG44 [21] phi from main::@10 to main::@6 + //SEG45 [21] phi (byte*) main::nxt#4 = (byte*) main::nxt#3 -- register_copy + //SEG46 [21] phi (byte) main::c#2 = (byte) main::c#0 -- register_copy + //SEG47 main::@6 + b6: + //SEG48 [22] *((const byte[]) main::line#0+(byte) 39) ← (byte) main::c#2 [ main::nxt#4 ] -- _star_cowo1=aby + sta line+$27 + //SEG49 [23] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 [ main::nxt#1 ] -- zpptrby1=_inc_zpptrby1 + inc nxt + bne !+ + inc nxt+1 + !: + //SEG50 [24] phi from main::@6 to main::@4 + //SEG51 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 -- register_copy + //SEG52 [24] phi (byte) main::scroll#10 = (byte) 7 -- xby=coby1 + ldx #7 + //SEG53 [24] phi from main::@8 to main::@4 + //SEG54 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#3 -- register_copy + //SEG55 [24] phi (byte) main::scroll#10 = (byte) main::scroll#1 -- register_copy + //SEG56 main::@4 + b4: + //SEG57 [25] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=xby + stx SCROLL + //SEG58 [26] (byte~) main::$17 ← * (const byte*) BGCOL#0 [ main::scroll#10 main::nxt#10 main::$17 ] -- aby=_star_cowo1 + lda BGCOL + //SEG59 [27] (byte~) main::$18 ← (byte~) main::$17 - (byte) 1 [ main::scroll#10 main::nxt#10 main::$18 ] -- aby=aby_minus_1 + sec + sbc #1 + //SEG60 [28] *((const byte*) BGCOL#0) ← (byte~) main::$18 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=aby + sta BGCOL + //SEG61 [29] if(true) goto main::@2 [ main::scroll#10 main::nxt#10 ] -- true_then_la1 + jmp b2 + //SEG62 main::@return + //SEG63 [30] return [ ] + rts +} +//SEG64 fillscreen +fillscreen: { + .const fill = $20 + .label cursor = 2 + //SEG65 [32] phi from fillscreen to fillscreen::@1 + //SEG66 [32] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 -- zpptrby1=cowo1 + lda #SCREEN + sta cursor+1 + //SEG67 [32] phi from fillscreen::@1 to fillscreen::@1 + //SEG68 [32] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 -- register_copy + //SEG69 fillscreen::@1 + b1: + //SEG70 [33] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] -- _star_zpptrby1=coby1 + ldy #0 + lda #fill + sta (cursor),y + //SEG71 [34] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] -- zpptrby1=_inc_zpptrby1 + inc cursor + bne !+ + inc cursor+1 + !: + //SEG72 [35] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] -- zpptrby1_lt_cowo1_then_la1 + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1 + bne !+ + lda cursor + cmp #TEXT + sta nxt+1 + //SEG10 [3] phi (byte) main::scroll#3 = (byte) 7 -- xby=coby1 + ldx #7 + //SEG11 [3] phi from main::@2 to main::@2 + //SEG12 [3] phi from main::@4 to main::@2 + //SEG13 [3] phi (byte*) main::nxt#3 = (byte*) main::nxt#10 -- register_copy + //SEG14 [3] phi (byte) main::scroll#3 = (byte) main::scroll#10 -- register_copy + //SEG15 main::@2 + b2: + //SEG16 [4] (byte~) main::$2 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$2 ] -- aby=_star_cowo1 + lda RASTER + //SEG17 [5] if((byte~) main::$2!=(byte) 254) goto main::@2 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$fe + bne b2 + //SEG18 main::@3 + b3: + //SEG19 [6] (byte~) main::$4 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$4 ] -- aby=_star_cowo1 + lda RASTER + //SEG20 [7] if((byte~) main::$4!=(byte) 255) goto main::@3 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$ff + bne b3 + //SEG21 main::@8 + //SEG22 [8] (byte~) main::$6 ← * (const byte*) BGCOL#0 [ main::scroll#3 main::nxt#3 main::$6 ] -- aby=_star_cowo1 + lda BGCOL + //SEG23 [9] (byte~) main::$7 ← (byte~) main::$6 + (byte) 1 [ main::scroll#3 main::nxt#3 main::$7 ] -- aby=aby_plus_1 + clc + adc #1 + //SEG24 [10] *((const byte*) BGCOL#0) ← (byte~) main::$7 [ main::scroll#3 main::nxt#3 ] -- _star_cowo1=aby + sta BGCOL + //SEG25 [11] (byte) main::scroll#1 ← -- (byte) main::scroll#3 [ main::nxt#3 main::scroll#1 ] -- xby=_dec_xby + dex + //SEG26 [12] if((byte) main::scroll#1!=(byte) 255) goto main::@4 [ main::nxt#3 main::scroll#1 ] -- xby_neq_coby1_then_la1 + cpx #$ff + bne b4 + //SEG27 [13] phi from main::@8 to main::@5 + //SEG28 [13] phi (byte) main::i#2 = (byte) 0 -- xby=coby1 + ldx #0 + //SEG29 [13] phi from main::@5 to main::@5 + //SEG30 [13] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy + //SEG31 main::@5 + b5: + //SEG32 [14] (byte~) main::$11 ← (const byte[]) main::line#0+(byte) 1 *idx (byte) main::i#2 [ main::nxt#3 main::i#2 main::$11 ] -- aby=cowo1_staridx_xby + lda line+1,x + //SEG33 [15] *((const byte[]) main::line#0 + (byte) main::i#2) ← (byte~) main::$11 [ main::nxt#3 main::i#2 ] -- cowo1_staridx_xby=aby + sta line,x + //SEG34 [16] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::nxt#3 main::i#1 ] -- xby=_inc_xby + inx + //SEG35 [17] if((byte) main::i#1!=(byte) 39) goto main::@5 [ main::nxt#3 main::i#1 ] -- xby_neq_coby1_then_la1 + cpx #$27 + bne b5 + //SEG36 main::@10 + //SEG37 [18] (byte) main::c#0 ← * (byte*) main::nxt#3 [ main::nxt#3 main::c#0 ] -- aby=_star_zpptrby1 + ldy #0 + lda (nxt),y + //SEG38 [19] if((byte) main::c#0!=(byte) 0) goto main::@6 [ main::nxt#3 main::c#0 ] -- aby_neq_0_then_la1 + cmp #0 + bne b6 + //SEG39 main::@11 + //SEG40 [20] (byte) main::c#1 ← * (const byte*) TEXT#0 [ main::c#1 ] -- aby=_star_cowo1 + lda TEXT + //SEG41 [21] phi from main::@11 to main::@6 + //SEG42 [21] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 -- zpptrby1=cowo1 + lda #TEXT + sta nxt+1 + //SEG43 [21] phi (byte) main::c#2 = (byte) main::c#1 -- register_copy + //SEG44 [21] phi from main::@10 to main::@6 + //SEG45 [21] phi (byte*) main::nxt#4 = (byte*) main::nxt#3 -- register_copy + //SEG46 [21] phi (byte) main::c#2 = (byte) main::c#0 -- register_copy + //SEG47 main::@6 + b6: + //SEG48 [22] *((const byte[]) main::line#0+(byte) 39) ← (byte) main::c#2 [ main::nxt#4 ] -- _star_cowo1=aby + sta line+$27 + //SEG49 [23] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 [ main::nxt#1 ] -- zpptrby1=_inc_zpptrby1 + inc nxt + bne !+ + inc nxt+1 + !: + //SEG50 [24] phi from main::@6 to main::@4 + //SEG51 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 -- register_copy + //SEG52 [24] phi (byte) main::scroll#10 = (byte) 7 -- xby=coby1 + ldx #7 + //SEG53 [24] phi from main::@8 to main::@4 + //SEG54 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#3 -- register_copy + //SEG55 [24] phi (byte) main::scroll#10 = (byte) main::scroll#1 -- register_copy + //SEG56 main::@4 + b4: + //SEG57 [25] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=xby + stx SCROLL + //SEG58 [26] (byte~) main::$17 ← * (const byte*) BGCOL#0 [ main::scroll#10 main::nxt#10 main::$17 ] -- aby=_star_cowo1 + lda BGCOL + //SEG59 [27] (byte~) main::$18 ← (byte~) main::$17 - (byte) 1 [ main::scroll#10 main::nxt#10 main::$18 ] -- aby=aby_minus_1 + sec + sbc #1 + //SEG60 [28] *((const byte*) BGCOL#0) ← (byte~) main::$18 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=aby + sta BGCOL + //SEG61 [29] if(true) goto main::@2 [ main::scroll#10 main::nxt#10 ] -- true_then_la1 + jmp b2 + //SEG62 main::@return + //SEG63 [30] return [ ] + rts +} +//SEG64 fillscreen +fillscreen: { + .const fill = $20 + .label cursor = 2 + //SEG65 [32] phi from fillscreen to fillscreen::@1 + //SEG66 [32] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 -- zpptrby1=cowo1 + lda #SCREEN + sta cursor+1 + //SEG67 [32] phi from fillscreen::@1 to fillscreen::@1 + //SEG68 [32] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 -- register_copy + //SEG69 fillscreen::@1 + b1: + //SEG70 [33] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] -- _star_zpptrby1=coby1 + ldy #0 + lda #fill + sta (cursor),y + //SEG71 [34] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] -- zpptrby1=_inc_zpptrby1 + inc cursor + bne !+ + inc cursor+1 + !: + //SEG72 [35] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] -- zpptrby1_lt_cowo1_then_la1 + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1 + bne !+ + lda cursor + cmp #TEXT + sta nxt+1 + //SEG10 [3] phi (byte) main::scroll#3 = (byte) 7 -- xby=coby1 + ldx #7 + //SEG11 [3] phi from main::@2 to main::@2 + //SEG12 [3] phi from main::@4 to main::@2 + //SEG13 [3] phi (byte*) main::nxt#3 = (byte*) main::nxt#10 -- register_copy + //SEG14 [3] phi (byte) main::scroll#3 = (byte) main::scroll#10 -- register_copy + //SEG15 main::@2 + b2: + //SEG16 [4] (byte~) main::$2 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$2 ] -- aby=_star_cowo1 + lda RASTER + //SEG17 [5] if((byte~) main::$2!=(byte) 254) goto main::@2 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$fe + bne b2 + //SEG18 main::@3 + b3: + //SEG19 [6] (byte~) main::$4 ← * (const byte*) RASTER#0 [ main::scroll#3 main::nxt#3 main::$4 ] -- aby=_star_cowo1 + lda RASTER + //SEG20 [7] if((byte~) main::$4!=(byte) 255) goto main::@3 [ main::scroll#3 main::nxt#3 ] -- aby_neq_coby1_then_la1 + cmp #$ff + bne b3 + //SEG21 main::@8 + //SEG22 [8] (byte~) main::$6 ← * (const byte*) BGCOL#0 [ main::scroll#3 main::nxt#3 main::$6 ] -- aby=_star_cowo1 + lda BGCOL + //SEG23 [9] (byte~) main::$7 ← (byte~) main::$6 + (byte) 1 [ main::scroll#3 main::nxt#3 main::$7 ] -- aby=aby_plus_1 + clc + adc #1 + //SEG24 [10] *((const byte*) BGCOL#0) ← (byte~) main::$7 [ main::scroll#3 main::nxt#3 ] -- _star_cowo1=aby + sta BGCOL + //SEG25 [11] (byte) main::scroll#1 ← -- (byte) main::scroll#3 [ main::nxt#3 main::scroll#1 ] -- xby=_dec_xby + dex + //SEG26 [12] if((byte) main::scroll#1!=(byte) 255) goto main::@4 [ main::nxt#3 main::scroll#1 ] -- xby_neq_coby1_then_la1 + cpx #$ff + bne b4 + //SEG27 [13] phi from main::@8 to main::@5 + //SEG28 [13] phi (byte) main::i#2 = (byte) 0 -- xby=coby1 + ldx #0 + //SEG29 [13] phi from main::@5 to main::@5 + //SEG30 [13] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy + //SEG31 main::@5 + b5: + //SEG32 [14] (byte~) main::$11 ← (const byte[]) main::line#0+(byte) 1 *idx (byte) main::i#2 [ main::nxt#3 main::i#2 main::$11 ] -- aby=cowo1_staridx_xby + lda line+1,x + //SEG33 [15] *((const byte[]) main::line#0 + (byte) main::i#2) ← (byte~) main::$11 [ main::nxt#3 main::i#2 ] -- cowo1_staridx_xby=aby + sta line,x + //SEG34 [16] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::nxt#3 main::i#1 ] -- xby=_inc_xby + inx + //SEG35 [17] if((byte) main::i#1!=(byte) 39) goto main::@5 [ main::nxt#3 main::i#1 ] -- xby_neq_coby1_then_la1 + cpx #$27 + bne b5 + //SEG36 main::@10 + //SEG37 [18] (byte) main::c#0 ← * (byte*) main::nxt#3 [ main::nxt#3 main::c#0 ] -- aby=_star_zpptrby1 + ldy #0 + lda (nxt),y + //SEG38 [19] if((byte) main::c#0!=(byte) 0) goto main::@6 [ main::nxt#3 main::c#0 ] -- aby_neq_0_then_la1 + cmp #0 + bne b6 + //SEG39 main::@11 + //SEG40 [20] (byte) main::c#1 ← * (const byte*) TEXT#0 [ main::c#1 ] -- aby=_star_cowo1 + lda TEXT + //SEG41 [21] phi from main::@11 to main::@6 + //SEG42 [21] phi (byte*) main::nxt#4 = (const byte*) TEXT#0 -- zpptrby1=cowo1 + lda #TEXT + sta nxt+1 + //SEG43 [21] phi (byte) main::c#2 = (byte) main::c#1 -- register_copy + //SEG44 [21] phi from main::@10 to main::@6 + //SEG45 [21] phi (byte*) main::nxt#4 = (byte*) main::nxt#3 -- register_copy + //SEG46 [21] phi (byte) main::c#2 = (byte) main::c#0 -- register_copy + //SEG47 main::@6 + b6: + //SEG48 [22] *((const byte[]) main::line#0+(byte) 39) ← (byte) main::c#2 [ main::nxt#4 ] -- _star_cowo1=aby + sta line+$27 + //SEG49 [23] (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 [ main::nxt#1 ] -- zpptrby1=_inc_zpptrby1 + inc nxt + bne !+ + inc nxt+1 + !: + //SEG50 [24] phi from main::@6 to main::@4 + //SEG51 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#1 -- register_copy + //SEG52 [24] phi (byte) main::scroll#10 = (byte) 7 -- xby=coby1 + ldx #7 + //SEG53 [24] phi from main::@8 to main::@4 + //SEG54 [24] phi (byte*) main::nxt#10 = (byte*) main::nxt#3 -- register_copy + //SEG55 [24] phi (byte) main::scroll#10 = (byte) main::scroll#1 -- register_copy + //SEG56 main::@4 + b4: + //SEG57 [25] *((const byte*) SCROLL#0) ← (byte) main::scroll#10 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=xby + stx SCROLL + //SEG58 [26] (byte~) main::$17 ← * (const byte*) BGCOL#0 [ main::scroll#10 main::nxt#10 main::$17 ] -- aby=_star_cowo1 + lda BGCOL + //SEG59 [27] (byte~) main::$18 ← (byte~) main::$17 - (byte) 1 [ main::scroll#10 main::nxt#10 main::$18 ] -- aby=aby_minus_1 + sec + sbc #1 + //SEG60 [28] *((const byte*) BGCOL#0) ← (byte~) main::$18 [ main::scroll#10 main::nxt#10 ] -- _star_cowo1=aby + sta BGCOL + //SEG61 [29] if(true) goto main::@2 [ main::scroll#10 main::nxt#10 ] -- true_then_la1 + jmp b2 + //SEG62 main::@return + //SEG63 [30] return [ ] + rts +} +//SEG64 fillscreen +fillscreen: { + .const fill = $20 + .label cursor = 2 + //SEG65 [32] phi from fillscreen to fillscreen::@1 + //SEG66 [32] phi (byte*) fillscreen::cursor#2 = (const byte*) SCREEN#0 -- zpptrby1=cowo1 + lda #SCREEN + sta cursor+1 + //SEG67 [32] phi from fillscreen::@1 to fillscreen::@1 + //SEG68 [32] phi (byte*) fillscreen::cursor#2 = (byte*) fillscreen::cursor#1 -- register_copy + //SEG69 fillscreen::@1 + b1: + //SEG70 [33] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] -- _star_zpptrby1=coby1 + ldy #0 + lda #fill + sta (cursor),y + //SEG71 [34] (byte*) fillscreen::cursor#1 ← ++ (byte*) fillscreen::cursor#2 [ fillscreen::cursor#1 ] -- zpptrby1=_inc_zpptrby1 + inc cursor + bne !+ + inc cursor+1 + !: + //SEG72 [35] if((byte*) fillscreen::cursor#1<(const byte*) SCREEN#0+(word) 1000) goto fillscreen::@1 [ fillscreen::cursor#1 ] -- zpptrby1_lt_cowo1_then_la1 + lda cursor+1 + cmp #>SCREEN+$3e8 + bcc b1 + bne !+ + lda cursor + cmp #