mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-08 14:37:40 +00:00
Added test to confirm that pointer destinations can now be incremented corrently. Closes #29
This commit is contained in:
parent
b412a4aefc
commit
a3a7d02cd7
src/main/java/dk/camelot64/kickc
@ -20,7 +20,7 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public class AsmFragmentManager {
|
||||
|
||||
static boolean verboseFragmentLog = false;
|
||||
static boolean verboseFragmentLog = true;
|
||||
|
||||
/**
|
||||
* Cache for fragment files. Maps signature to the parsed file.
|
||||
@ -195,7 +195,6 @@ public class AsmFragmentManager {
|
||||
synths.add(new FragmentSynthesis("vbuz1=vbuz1(.*)", ".*=.*vb.aa.*|.*z1.*z1.*z1.*", "lda {z1}\n", "vbuaa=vbuaa$1", "sta {z1}\n", mapZ));
|
||||
synths.add(new FragmentSynthesis("vbsz1=vbsz1(.*)", ".*=.*vb.aa.*|.*z1.*z1.*z1.*", "lda {z1}\n", "vbsaa=vbsaa$1", "sta {z1}\n", mapZ));
|
||||
|
||||
|
||||
synths.add(new FragmentSynthesis("vbuz1_(lt|gt|le|ge|eq|neq)_(.*)", ".*vb.aa.*", "lda {z1}\n", "vbuaa_$1_$2", null, mapZ));
|
||||
synths.add(new FragmentSynthesis("vbsz1_(lt|gt|le|ge|eq|neq)_(.*)", ".*vb.aa.*", "lda {z1}\n", "vbsaa_$1_$2", null, mapZ));
|
||||
synths.add(new FragmentSynthesis("_deref_vwuc1_(lt|gt|le|ge|eq|neq)_(.*)", ".*vb.aa.*", "lda {c1}\n", "vbuaa_$1_$2", null, mapC));
|
||||
@ -253,6 +252,10 @@ public class AsmFragmentManager {
|
||||
synths.add(new FragmentSynthesis("(v..)z1=(.*)_(plus|minus|band|bxor|bor)_(v..)z1", null, null, "$1z1=$2_$3_$4z2", null, mapZ, false));
|
||||
synths.add(new FragmentSynthesis("(v..)z1=_(neg|lo|hi)_(v..)z1", null, null, "$1z1=_$2_$3z2", null, mapZ, false));
|
||||
|
||||
// INC/DEC from +1 / -1
|
||||
synths.add(new FragmentSynthesis("vb(.)aa=_inc_(.*)", null, null, "vb$1aa=$2_plus_1", null, null));
|
||||
synths.add(new FragmentSynthesis("vb(.)aa=_dec_(.*)", null, null, "vb$1aa=$2_minus_1", null, null));
|
||||
|
||||
|
||||
for (FragmentSynthesis synth : synths) {
|
||||
CharStream synthesized = synth.synthesize(signature, log);
|
||||
|
@ -22,6 +22,10 @@ public class TestPrograms extends TestCase {
|
||||
helper = new ReferenceHelper("dk/camelot64/kickc/test/ref/");
|
||||
}
|
||||
|
||||
public void testIncrementInArray() throws IOException, URISyntaxException {
|
||||
compileAndCompare("incrementinarray");
|
||||
}
|
||||
|
||||
public void testForIncrementAssign() throws IOException, URISyntaxException {
|
||||
compileAndCompare("forincrementassign");
|
||||
}
|
||||
|
13
src/main/java/dk/camelot64/kickc/test/incrementinarray.kc
Normal file
13
src/main/java/dk/camelot64/kickc/test/incrementinarray.kc
Normal file
@ -0,0 +1,13 @@
|
||||
import "print.kc"
|
||||
|
||||
byte[] txt = "camelot@";
|
||||
|
||||
void main() {
|
||||
print_cls();
|
||||
for ( byte i: 0..10) {
|
||||
print_str(txt);
|
||||
print_ln();
|
||||
txt[1]++;
|
||||
}
|
||||
|
||||
}
|
@ -15163,7 +15163,7 @@ Removing always clobbered register reg byte a as potential for zp ZP_BYTE:28 [ l
|
||||
Statement [104] (word) plot::plotter_y#0 ← *((const byte[]) plot_yhi#0 + (byte) plot::y#4) w= *((const byte[]) plot_ylo#0 + (byte) plot::y#4) [ plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::plotter_x#0 plot::plotter_y#0 ] ) always clobbers reg byte a
|
||||
Statement [105] (word~) plot::$0 ← (word) plot::plotter_x#0 + (word) plot::plotter_y#0 [ plot::x#4 plot::$0 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::$0 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::$0 ] ) always clobbers reg byte a
|
||||
Statement [106] (byte*) plot::plotter#0 ← ((byte*)) (word~) plot::$0 [ plot::x#4 plot::plotter#0 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::plotter#0 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::x#4 plot::plotter#0 ] ) always clobbers reg byte a
|
||||
Statement [107] (byte~) plot::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) [ plot::plotter#0 plot::$1 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::plotter#0 plot::$1 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [107] (byte~) plotAsm::$1 ← *((byte*) plot::plotter#0) | *((const byte[]) plot_bit#0 + (byte) plot::x#4) [ plot::plotter#0 plot::$1 ] ( main:2::lines:12::line:21::line_ydxi:42::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxi:86::plot:92 [ lines::l#2 line_ydxi::xd#2 line_ydxi::yd#5 line_ydxi::y1#6 line_ydxi::x#3 line_ydxi::y#3 line_ydxi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyi:35::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyi:80::plot:115 [ lines::l#2 line_xdyi::yd#2 line_xdyi::xd#5 line_xdyi::x1#6 line_xdyi::x#3 line_xdyi::y#3 line_xdyi::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxd:56::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_ydxd:72::plot:130 [ lines::l#2 line_ydxd::xd#2 line_ydxd::yd#5 line_ydxd::y1#6 line_ydxd::x#3 line_ydxd::y#3 line_ydxd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyd:50::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::plotter#0 plot::$1 ] main:2::lines:12::line:21::line_xdyd:66::plot:145 [ lines::l#2 line_xdyd::yd#2 line_xdyd::xd#5 line_xdyd::x1#6 line_xdyd::x#3 line_xdyd::y#3 line_xdyd::e#3 plot::plotter#0 plot::$1 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:2 [ lines::l#2 lines::l#1 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:3 [ line_ydxi::xd#2 line_ydxi::xd#1 line_ydxi::xd#0 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ line_ydxi::yd#5 line_ydxi::yd#1 line_ydxi::yd#0 ]
|
||||
|
103
src/main/java/dk/camelot64/kickc/test/ref/incrementinarray.asm
Normal file
103
src/main/java/dk/camelot64/kickc/test/ref/incrementinarray.asm
Normal file
@ -0,0 +1,103 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label char_cursor = 6
|
||||
.label line_cursor = 2
|
||||
txt: .text "camelot@"
|
||||
jsr main
|
||||
main: {
|
||||
jsr print_cls
|
||||
ldx #0
|
||||
lda #<$400
|
||||
sta line_cursor
|
||||
lda #>$400
|
||||
sta line_cursor+1
|
||||
lda #<$400
|
||||
sta char_cursor
|
||||
lda #>$400
|
||||
sta char_cursor+1
|
||||
b1:
|
||||
jsr print_str
|
||||
jsr print_ln
|
||||
lda txt+1
|
||||
clc
|
||||
adc #1
|
||||
sta txt+1
|
||||
inx
|
||||
cpx #$b
|
||||
bne b6
|
||||
rts
|
||||
b6:
|
||||
lda line_cursor
|
||||
sta char_cursor
|
||||
lda line_cursor+1
|
||||
sta char_cursor+1
|
||||
jmp b1
|
||||
}
|
||||
print_ln: {
|
||||
b1:
|
||||
lda line_cursor
|
||||
clc
|
||||
adc #$28
|
||||
sta line_cursor
|
||||
bcc !+
|
||||
inc line_cursor+1
|
||||
!:
|
||||
lda line_cursor+1
|
||||
cmp char_cursor+1
|
||||
bcc b1
|
||||
bne !+
|
||||
lda line_cursor
|
||||
cmp char_cursor
|
||||
bcc b1
|
||||
!:
|
||||
rts
|
||||
}
|
||||
print_str: {
|
||||
.label str = 4
|
||||
lda #<txt
|
||||
sta str
|
||||
lda #>txt
|
||||
sta str+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda (str),y
|
||||
cmp #'@'
|
||||
bne b2
|
||||
rts
|
||||
b2:
|
||||
ldy #0
|
||||
lda (str),y
|
||||
sta (char_cursor),y
|
||||
inc char_cursor
|
||||
bne !+
|
||||
inc char_cursor+1
|
||||
!:
|
||||
inc str
|
||||
bne !+
|
||||
inc str+1
|
||||
!:
|
||||
jmp b1
|
||||
}
|
||||
print_cls: {
|
||||
.label sc = 2
|
||||
lda #<$400
|
||||
sta sc
|
||||
lda #>$400
|
||||
sta sc+1
|
||||
b1:
|
||||
ldy #0
|
||||
lda #' '
|
||||
sta (sc),y
|
||||
inc sc
|
||||
bne !+
|
||||
inc sc+1
|
||||
!:
|
||||
lda sc+1
|
||||
cmp #>$400+$3e8
|
||||
bne b1
|
||||
lda sc
|
||||
cmp #<$400+$3e8
|
||||
bne b1
|
||||
rts
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
@begin: scope:[] from
|
||||
[0] phi() [ ] ( )
|
||||
to:@7
|
||||
@7: scope:[] from @begin
|
||||
[1] phi() [ ] ( )
|
||||
[2] call main param-assignment [ ] ( )
|
||||
to:@end
|
||||
@end: scope:[] from @7
|
||||
[3] phi() [ ] ( )
|
||||
main: scope:[main] from @7
|
||||
[4] phi() [ ] ( main:2 [ ] )
|
||||
[5] call print_cls param-assignment [ ] ( main:2 [ ] )
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main main::@6
|
||||
[6] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word) 0 main::@6/(byte) main::i#1 ) [ char_cursor#19 line_cursor#13 main::i#2 ] ( main:2 [ char_cursor#19 line_cursor#13 main::i#2 ] )
|
||||
[6] (byte*) line_cursor#13 ← phi( main/((byte*))(word/signed word) 1024 main::@6/(byte*) line_cursor#1 ) [ char_cursor#19 line_cursor#13 main::i#2 ] ( main:2 [ char_cursor#19 line_cursor#13 main::i#2 ] )
|
||||
[6] (byte*) char_cursor#19 ← phi( main/((byte*))(word/signed word) 1024 main::@6/(byte*~) char_cursor#25 ) [ char_cursor#19 line_cursor#13 main::i#2 ] ( main:2 [ char_cursor#19 line_cursor#13 main::i#2 ] )
|
||||
[7] call print_str param-assignment [ line_cursor#13 main::i#2 char_cursor#10 ] ( main:2 [ line_cursor#13 main::i#2 char_cursor#10 ] )
|
||||
to:main::@4
|
||||
main::@4: scope:[main] from main::@1
|
||||
[8] phi() [ line_cursor#13 main::i#2 char_cursor#10 ] ( main:2 [ line_cursor#13 main::i#2 char_cursor#10 ] )
|
||||
[9] call print_ln param-assignment [ main::i#2 line_cursor#1 ] ( main:2 [ main::i#2 line_cursor#1 ] )
|
||||
to:main::@5
|
||||
main::@5: scope:[main] from main::@4
|
||||
[10] *((const byte[]) txt#0+(byte/signed byte/word/signed word) 1) ← ++ *((const byte[]) txt#0+(byte/signed byte/word/signed word) 1) [ main::i#2 line_cursor#1 ] ( main:2 [ main::i#2 line_cursor#1 ] )
|
||||
[11] (byte) main::i#1 ← ++ (byte) main::i#2 [ line_cursor#1 main::i#1 ] ( main:2 [ line_cursor#1 main::i#1 ] )
|
||||
[12] if((byte) main::i#1!=(byte/signed byte/word/signed word) 11) goto main::@6 [ line_cursor#1 main::i#1 ] ( main:2 [ line_cursor#1 main::i#1 ] )
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@5
|
||||
[13] return [ ] ( main:2 [ ] )
|
||||
to:@return
|
||||
main::@6: scope:[main] from main::@5
|
||||
[14] (byte*~) char_cursor#25 ← (byte*) line_cursor#1 [ char_cursor#25 line_cursor#1 main::i#1 ] ( main:2 [ char_cursor#25 line_cursor#1 main::i#1 ] )
|
||||
to:main::@1
|
||||
print_ln: scope:[print_ln] from main::@4
|
||||
[15] phi() [ line_cursor#13 char_cursor#10 ] ( main:2::print_ln:9 [ main::i#2 line_cursor#13 char_cursor#10 ] )
|
||||
to:print_ln::@1
|
||||
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
|
||||
[16] (byte*) line_cursor#6 ← phi( print_ln/(byte*) line_cursor#13 print_ln::@1/(byte*) line_cursor#1 ) [ line_cursor#6 char_cursor#10 ] ( main:2::print_ln:9 [ main::i#2 line_cursor#6 char_cursor#10 ] )
|
||||
[17] (byte*) line_cursor#1 ← (byte*) line_cursor#6 + (byte/signed byte/word/signed word) 40 [ line_cursor#1 char_cursor#10 ] ( main:2::print_ln:9 [ main::i#2 line_cursor#1 char_cursor#10 ] )
|
||||
[18] if((byte*) line_cursor#1<(byte*) char_cursor#10) goto print_ln::@1 [ line_cursor#1 char_cursor#10 ] ( main:2::print_ln:9 [ main::i#2 line_cursor#1 char_cursor#10 ] )
|
||||
to:print_ln::@return
|
||||
print_ln::@return: scope:[print_ln] from print_ln::@1
|
||||
[19] return [ line_cursor#1 ] ( main:2::print_ln:9 [ main::i#2 line_cursor#1 ] )
|
||||
to:@return
|
||||
print_str: scope:[print_str] from main::@1
|
||||
[20] phi() [ char_cursor#19 ] ( main:2::print_str:7 [ line_cursor#13 main::i#2 char_cursor#19 ] )
|
||||
to:print_str::@1
|
||||
print_str::@1: scope:[print_str] from print_str print_str::@2
|
||||
[21] (byte*) char_cursor#10 ← phi( print_str/(byte*) char_cursor#19 print_str::@2/(byte*) char_cursor#1 ) [ char_cursor#10 print_str::str#2 ] ( main:2::print_str:7 [ line_cursor#13 main::i#2 char_cursor#10 print_str::str#2 ] )
|
||||
[21] (byte*) print_str::str#2 ← phi( print_str/(const byte[]) txt#0 print_str::@2/(byte*) print_str::str#0 ) [ char_cursor#10 print_str::str#2 ] ( main:2::print_str:7 [ line_cursor#13 main::i#2 char_cursor#10 print_str::str#2 ] )
|
||||
[22] if(*((byte*) print_str::str#2)!=(byte) '@') goto print_str::@2 [ char_cursor#10 print_str::str#2 ] ( main:2::print_str:7 [ line_cursor#13 main::i#2 char_cursor#10 print_str::str#2 ] )
|
||||
to:print_str::@return
|
||||
print_str::@return: scope:[print_str] from print_str::@1
|
||||
[23] return [ char_cursor#10 ] ( main:2::print_str:7 [ line_cursor#13 main::i#2 char_cursor#10 ] )
|
||||
to:@return
|
||||
print_str::@2: scope:[print_str] from print_str::@1
|
||||
[24] *((byte*) char_cursor#10) ← *((byte*) print_str::str#2) [ char_cursor#10 print_str::str#2 ] ( main:2::print_str:7 [ line_cursor#13 main::i#2 char_cursor#10 print_str::str#2 ] )
|
||||
[25] (byte*) char_cursor#1 ← ++ (byte*) char_cursor#10 [ print_str::str#2 char_cursor#1 ] ( main:2::print_str:7 [ line_cursor#13 main::i#2 print_str::str#2 char_cursor#1 ] )
|
||||
[26] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#2 [ print_str::str#0 char_cursor#1 ] ( main:2::print_str:7 [ line_cursor#13 main::i#2 print_str::str#0 char_cursor#1 ] )
|
||||
to:print_str::@1
|
||||
print_cls: scope:[print_cls] from main
|
||||
[27] phi() [ ] ( main:2::print_cls:5 [ ] )
|
||||
to:print_cls::@1
|
||||
print_cls::@1: scope:[print_cls] from print_cls print_cls::@1
|
||||
[28] (byte*) print_cls::sc#2 ← phi( print_cls/((byte*))(word/signed word) 1024 print_cls::@1/(byte*) print_cls::sc#1 ) [ print_cls::sc#2 ] ( main:2::print_cls:5 [ print_cls::sc#2 ] )
|
||||
[29] *((byte*) print_cls::sc#2) ← (byte) ' ' [ print_cls::sc#2 ] ( main:2::print_cls:5 [ print_cls::sc#2 ] )
|
||||
[30] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2 [ print_cls::sc#1 ] ( main:2::print_cls:5 [ print_cls::sc#1 ] )
|
||||
[31] if((byte*) print_cls::sc#1!=(word/signed word) 1024+(word/signed word) 1000) goto print_cls::@1 [ print_cls::sc#1 ] ( main:2::print_cls:5 [ print_cls::sc#1 ] )
|
||||
to:print_cls::@return
|
||||
print_cls::@return: scope:[print_cls] from print_cls::@1
|
||||
[32] return [ ] ( main:2::print_cls:5 [ ] )
|
||||
to:@return
|
2924
src/main/java/dk/camelot64/kickc/test/ref/incrementinarray.log
Normal file
2924
src/main/java/dk/camelot64/kickc/test/ref/incrementinarray.log
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,44 @@
|
||||
(label) @7
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte*) char_cursor
|
||||
(byte*) char_cursor#1 char_cursor zp ZP_WORD:6 101.0
|
||||
(byte*) char_cursor#10 char_cursor zp ZP_WORD:6 40.6
|
||||
(byte*) char_cursor#19 char_cursor zp ZP_WORD:6 6.5
|
||||
(byte*~) char_cursor#25 char_cursor zp ZP_WORD:6 22.0
|
||||
(byte*) line_cursor
|
||||
(byte*) line_cursor#1 line_cursor zp ZP_WORD:2 40.625
|
||||
(byte*) line_cursor#13 line_cursor zp ZP_WORD:2 3.25
|
||||
(byte*) line_cursor#6 line_cursor zp ZP_WORD:2 204.0
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@4
|
||||
(label) main::@5
|
||||
(label) main::@6
|
||||
(label) main::@return
|
||||
(byte) main::i
|
||||
(byte) main::i#1 reg byte x 11.0
|
||||
(byte) main::i#2 reg byte x 4.4
|
||||
(void()) print_cls()
|
||||
(label) print_cls::@1
|
||||
(label) print_cls::@return
|
||||
(byte*) print_cls::sc
|
||||
(byte*) print_cls::sc#1 sc zp ZP_WORD:2 16.5
|
||||
(byte*) print_cls::sc#2 sc zp ZP_WORD:2 16.5
|
||||
(void()) print_ln()
|
||||
(label) print_ln::@1
|
||||
(label) print_ln::@return
|
||||
(void()) print_str((byte*) print_str::str)
|
||||
(label) print_str::@1
|
||||
(label) print_str::@2
|
||||
(label) print_str::@return
|
||||
(byte*) print_str::str
|
||||
(byte*) print_str::str#0 str zp ZP_WORD:4 202.0
|
||||
(byte*) print_str::str#2 str zp ZP_WORD:4 101.0
|
||||
(byte[]) txt
|
||||
(const byte[]) txt#0 txt = (string) "camelot@"
|
||||
|
||||
reg byte x [ main::i#2 main::i#1 ]
|
||||
zp ZP_WORD:2 [ line_cursor#6 line_cursor#13 line_cursor#1 print_cls::sc#2 print_cls::sc#1 ]
|
||||
zp ZP_WORD:4 [ print_str::str#2 print_str::str#0 ]
|
||||
zp ZP_WORD:6 [ char_cursor#10 char_cursor#19 char_cursor#25 char_cursor#1 ]
|
Loading…
x
Reference in New Issue
Block a user