From e8084a4d27cff0ccb2a702d10be64266f29e8bcd Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Sat, 1 Aug 2020 01:28:21 +0200 Subject: [PATCH] Added many Z register fragments. --- .../cache/fragment-cache-csg65ce02.asm | 2 +- .../cache/fragment-cache-mega45gs02.asm | 2 +- .../fragment/cache/fragment-cache-mos6502.asm | 2 +- .../cache/fragment-cache-mos6502x.asm | 98 +++++++++---------- .../cache/fragment-cache-wdc65c02.asm | 2 +- .../csg65ce02-common/_deref_pbuc1=vbuzz.asm | 1 + .../csg65ce02-common/vbuzz=_byte_vbszz.asm | 0 .../csg65ce02-common/vbuzz=_dec_vbuzz.asm | 1 + .../csg65ce02-common/vbuzz=_deref_pbuc1.asm | 1 + .../vbuzz=_hi__deref_pwuc1.asm | 1 + .../csg65ce02-common/vbuzz=_hi_pvom1.asm | 1 + .../csg65ce02-common/vbuzz=_hi_vwum1.asm | 1 + .../vbuzz=_lo__deref_pwuc1.asm | 1 + .../csg65ce02-common/vbuzz=_lo_pvom1.asm | 1 + .../csg65ce02-common/vbuzz=_lo_vwum1.asm | 1 + .../vbuzz=pbuc1_derefidx_vbuxx.asm | 1 + .../fragment/csg65ce02-common/vbuzz=vbuaa.asm | 1 + .../csg65ce02-common/vbuzz=vbuaa_minus_1.asm | 2 + .../fragment/csg65ce02-common/vbuzz=vbuc1.asm | 2 +- .../fragment/csg65ce02-common/vbuzz=vbum1.asm | 1 + .../fragment/csg65ce02-common/vbuzz=vbuxx.asm | 2 + .../csg65ce02-common/vbuzz=vbuxx_plus_1.asm | 3 + .../fragment/csg65ce02-common/vbuzz=vbuyy.asm | 2 + .../csg65ce02-common/vbuzz=vbuyy_plus_1.asm | 3 + .../fragment/csg65ce02-common/vbuzz=vbuzz.asm | 0 .../vbuzz=vbuzz_bor_vbuzz.asm | 0 .../csg65ce02-common/vbuzz=vbuzz_minus_2.asm | 2 + .../csg65ce02-common/vbuzz=vbuzz_plus_1.asm | 1 + .../csg65ce02-common/vbuzz=vbuzz_plus_2.asm | 2 + .../csg65ce02-common/vbuzz_eq_0_then_la1.asm | 2 + .../vbuzz_eq__deref_pbuc1_then_la1.asm | 2 + .../vbuzz_eq_vbuc1_then_la1.asm | 2 + .../vbuzz_eq_vbuxx_then_la1.asm | 3 + .../vbuzz_eq_vbuyy_then_la1.asm | 3 + .../vbuzz_ge_vbuaa_then_la1.asm | 3 + .../vbuzz_ge_vbuc1_then_la1.asm | 2 + .../vbuzz_ge_vbum1_then_la1.asm | 2 + .../vbuzz_ge_vbuxx_then_la1.asm | 3 + .../vbuzz_ge_vbuyy_then_la1.asm | 3 + .../csg65ce02-common/vbuzz_gt_0_then_la1.asm | 2 + .../vbuzz_gt_vbuc1_then_la1.asm | 4 + .../csg65ce02-common/vbuzz_le_0_then_la1.asm | 2 + .../vbuzz_le_vbuc1_then_la1.asm | 3 + .../vbuzz_lt__deref_pbuc1_then_la1.asm | 2 + .../vbuzz_lt_vbuaa_then_la1.asm | 3 + .../vbuzz_lt_vbuc1_then_la1.asm | 2 +- .../vbuzz_lt_vbum1_then_la1.asm | 2 + .../vbuzz_lt_vbuxx_then_la1.asm | 3 + .../vbuzz_lt_vbuyy_then_la1.asm | 3 + .../csg65ce02-common/vbuzz_neq_0_then_la1.asm | 2 + .../vbuzz_neq__deref_pbuc1_then_la1.asm | 2 + .../vbuzz_neq_vbuc1_then_la1.asm | 2 + .../vbuzz_neq_vbum1_then_la1.asm | 2 + .../AsmFragmentTemplateSynthesizer.java | 1 + 54 files changed, 142 insertions(+), 55 deletions(-) create mode 100644 src/main/fragment/csg65ce02-common/_deref_pbuc1=vbuzz.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_byte_vbszz.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_dec_vbuzz.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_deref_pbuc1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_hi__deref_pwuc1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_hi_pvom1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_hi_vwum1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_lo__deref_pwuc1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_lo_pvom1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=_lo_vwum1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=pbuc1_derefidx_vbuxx.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuaa.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuaa_minus_1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbum1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuxx.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuxx_plus_1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuyy.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuyy_plus_1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuzz.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuzz_bor_vbuzz.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuzz_minus_2.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuzz_plus_1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz=vbuzz_plus_2.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_eq_0_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_eq__deref_pbuc1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_eq_vbuc1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_eq_vbuxx_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_eq_vbuyy_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_ge_vbuaa_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_ge_vbuc1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_ge_vbum1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_ge_vbuxx_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_ge_vbuyy_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_gt_0_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_gt_vbuc1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_le_0_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_le_vbuc1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_lt__deref_pbuc1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_lt_vbuaa_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_lt_vbum1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_lt_vbuxx_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_lt_vbuyy_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_neq_0_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_neq__deref_pbuc1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_neq_vbuc1_then_la1.asm create mode 100644 src/main/fragment/csg65ce02-common/vbuzz_neq_vbum1_then_la1.asm diff --git a/src/main/fragment/cache/fragment-cache-csg65ce02.asm b/src/main/fragment/cache/fragment-cache-csg65ce02.asm index 9cbd1f563..2284560c0 100644 --- a/src/main/fragment/cache/fragment-cache-csg65ce02.asm +++ b/src/main/fragment/cache/fragment-cache-csg65ce02.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE 1368a0c981 +//KICKC FRAGMENT CACHE 15196e00e6 //FRAGMENT vbuzz=vbuc1 ldz #{c1} //FRAGMENT vbuzz_lt_vbuc1_then_la1 diff --git a/src/main/fragment/cache/fragment-cache-mega45gs02.asm b/src/main/fragment/cache/fragment-cache-mega45gs02.asm index b2d06b3ad..8730bcb60 100644 --- a/src/main/fragment/cache/fragment-cache-mega45gs02.asm +++ b/src/main/fragment/cache/fragment-cache-mega45gs02.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE 1368a0c981 +//KICKC FRAGMENT CACHE 15196e00e6 //FRAGMENT vduz1=vduc1 lda #<{c1} sta {z1} diff --git a/src/main/fragment/cache/fragment-cache-mos6502.asm b/src/main/fragment/cache/fragment-cache-mos6502.asm index 38df9ce51..bf417a387 100644 --- a/src/main/fragment/cache/fragment-cache-mos6502.asm +++ b/src/main/fragment/cache/fragment-cache-mos6502.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE 1368a0c981 +//KICKC FRAGMENT CACHE 15196e00e6 //FRAGMENT vbuz1=vbuc1 lda #{c1} sta {z1} diff --git a/src/main/fragment/cache/fragment-cache-mos6502x.asm b/src/main/fragment/cache/fragment-cache-mos6502x.asm index 8a381848e..6881246bc 100644 --- a/src/main/fragment/cache/fragment-cache-mos6502x.asm +++ b/src/main/fragment/cache/fragment-cache-mos6502x.asm @@ -1,57 +1,12 @@ -//KICKC FRAGMENT CACHE 1368a0c981 +//KICKC FRAGMENT CACHE 15196e00e6 +//FRAGMENT vbuz1=vbuc1 +lda #{c1} +sta {z1} //FRAGMENT pbuz1=pbuc1 lda #<{c1} sta {z1} lda #>{c1} sta {z1}+1 -//FRAGMENT vbuz1=vbuc1 -lda #{c1} -sta {z1} -//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuz2 -ldy {z2} -lda {c1},y -ldy #0 -sta ({z1}),y -//FRAGMENT vbuz1=_inc_vbuz1 -inc {z1} -//FRAGMENT vbuz1_neq_vbuc1_then_la1 -lda #{c1} -cmp {z1} -bne {la1} -//FRAGMENT pbuz1=_inc_pbuz1 -inc {z1} -bne !+ -inc {z1}+1 -!: -//FRAGMENT pbuz1_lt_pbuc1_then_la1 -lda {z1}+1 -cmp #>{c1} -bcc {la1} -bne !+ -lda {z1} -cmp #<{c1} -bcc {la1} -!: -//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuaa -tay -lda {c1},y -ldy #0 -sta ({z1}),y -//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuxx -lda {c1},x -ldy #0 -sta ({z1}),y -//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuyy -lda {c1},y -ldy #0 -sta ({z1}),y -//FRAGMENT vbuxx_neq_vbuc1_then_la1 -cpx #{c1} -bne {la1} -//FRAGMENT vbuxx=vbuc1 -ldx #{c1} -//FRAGMENT vbuxx=_inc_vbuxx -inx //FRAGMENT vwuz1=vwuc1 lda #<{c1} sta {z1} @@ -88,6 +43,12 @@ lda {z2} sta {z1} lda {z2}+1 sta {z1}+1 +//FRAGMENT vbuz1=_inc_vbuz1 +inc {z1} +//FRAGMENT vbuz1_neq_vbuc1_then_la1 +lda #{c1} +cmp {z1} +bne {la1} //FRAGMENT pbuz1=pbuz2 lda {z2} sta {z1} @@ -108,6 +69,11 @@ sta {z1}+1 lda {z2} ldy #0 sta ({z1}),y +//FRAGMENT pbuz1=_inc_pbuz1 +inc {z1} +bne !+ +inc {z1}+1 +!: //FRAGMENT vbuz1=_hi_vwuz2 lda {z2}+1 sta {z1} @@ -146,6 +112,9 @@ sta {z1} lda #{c1} and {z2} sta {z1} +//FRAGMENT vbuxx_neq_vbuc1_then_la1 +cpx #{c1} +bne {la1} //FRAGMENT _deref_pbuz1=vbuaa ldy #0 sta ({z1}),y @@ -286,6 +255,8 @@ and #{c1} tay //FRAGMENT vbuaa=vbuc1 lda #{c1} +//FRAGMENT vbuxx=vbuc1 +ldx #{c1} //FRAGMENT vbuyy=vbuc1 ldy #{c1} //FRAGMENT vbuaa=pbuc1_derefidx_vbuxx @@ -1307,6 +1278,8 @@ ldy {z1}+1 //FRAGMENT vbuyy=vbuaa_band_vbuc1 and #{c1} tay +//FRAGMENT vbuxx=_inc_vbuxx +inx //FRAGMENT vbuyy=_inc_vbuyy iny //FRAGMENT vbuyy_neq_vbuc1_then_la1 @@ -1686,6 +1659,11 @@ bne {la1} //FRAGMENT _deref_pbuc1=_deref_pbuc2 lda {c2} sta {c1} +//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuz2 +ldy {z2} +lda {c1},y +ldy #0 +sta ({z1}),y //FRAGMENT vbuz1=vbuz1_plus_vbuz2 lda {z1} clc @@ -1908,6 +1886,14 @@ tay //FRAGMENT vbuc1_neq_vbuaa_then_la1 cmp #{c1} bne {la1} +//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuxx +lda {c1},x +ldy #0 +sta ({z1}),y +//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuyy +lda {c1},y +ldy #0 +sta ({z1}),y //FRAGMENT vbuz1=vbuz1_plus_vbuxx txa clc @@ -2903,6 +2889,15 @@ inc {m1} lda #{c1} cmp {m1} bne {la1} +//FRAGMENT pbuz1_lt_pbuc1_then_la1 +lda {z1}+1 +cmp #>{c1} +bcc {la1} +bne !+ +lda {z1} +cmp #<{c1} +bcc {la1} +!: //FRAGMENT vboz1=vbuz2_eq_vbuc1 lda {z2} eor #{c1} @@ -3740,6 +3735,11 @@ tax //FRAGMENT vbuyy=_byte_vwuz1 lda {z1} tay +//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuaa +tay +lda {c1},y +ldy #0 +sta ({z1}),y //FRAGMENT pwsz1=pwsc1_plus_vwsz1 clc lda {z1} diff --git a/src/main/fragment/cache/fragment-cache-wdc65c02.asm b/src/main/fragment/cache/fragment-cache-wdc65c02.asm index bf4d3aabf..7e5f570ba 100644 --- a/src/main/fragment/cache/fragment-cache-wdc65c02.asm +++ b/src/main/fragment/cache/fragment-cache-wdc65c02.asm @@ -1,4 +1,4 @@ -//KICKC FRAGMENT CACHE 1368a0c981 +//KICKC FRAGMENT CACHE 15196e00e6 //FRAGMENT vbuz1=_deref_pbuc1 lda {c1} sta {z1} diff --git a/src/main/fragment/csg65ce02-common/_deref_pbuc1=vbuzz.asm b/src/main/fragment/csg65ce02-common/_deref_pbuc1=vbuzz.asm new file mode 100644 index 000000000..3635807ba --- /dev/null +++ b/src/main/fragment/csg65ce02-common/_deref_pbuc1=vbuzz.asm @@ -0,0 +1 @@ +stz {c1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_byte_vbszz.asm b/src/main/fragment/csg65ce02-common/vbuzz=_byte_vbszz.asm new file mode 100644 index 000000000..e69de29bb diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_dec_vbuzz.asm b/src/main/fragment/csg65ce02-common/vbuzz=_dec_vbuzz.asm new file mode 100644 index 000000000..33e7dee21 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=_dec_vbuzz.asm @@ -0,0 +1 @@ +dez \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_deref_pbuc1.asm b/src/main/fragment/csg65ce02-common/vbuzz=_deref_pbuc1.asm new file mode 100644 index 000000000..f3f55df07 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=_deref_pbuc1.asm @@ -0,0 +1 @@ +ldz {c1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_hi__deref_pwuc1.asm b/src/main/fragment/csg65ce02-common/vbuzz=_hi__deref_pwuc1.asm new file mode 100644 index 000000000..83788eb5c --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=_hi__deref_pwuc1.asm @@ -0,0 +1 @@ +ldz {c1}+1 \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_hi_pvom1.asm b/src/main/fragment/csg65ce02-common/vbuzz=_hi_pvom1.asm new file mode 100644 index 000000000..f8bd8093c --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=_hi_pvom1.asm @@ -0,0 +1 @@ +ldz {m1}+1 diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_hi_vwum1.asm b/src/main/fragment/csg65ce02-common/vbuzz=_hi_vwum1.asm new file mode 100644 index 000000000..f8bd8093c --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=_hi_vwum1.asm @@ -0,0 +1 @@ +ldz {m1}+1 diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_lo__deref_pwuc1.asm b/src/main/fragment/csg65ce02-common/vbuzz=_lo__deref_pwuc1.asm new file mode 100644 index 000000000..8cfc90ab8 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=_lo__deref_pwuc1.asm @@ -0,0 +1 @@ +ldz {c1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_lo_pvom1.asm b/src/main/fragment/csg65ce02-common/vbuzz=_lo_pvom1.asm new file mode 100644 index 000000000..a14e67f20 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=_lo_pvom1.asm @@ -0,0 +1 @@ +ldz {m1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz=_lo_vwum1.asm b/src/main/fragment/csg65ce02-common/vbuzz=_lo_vwum1.asm new file mode 100644 index 000000000..575e9a290 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=_lo_vwum1.asm @@ -0,0 +1 @@ +ldz {m1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=pbuc1_derefidx_vbuxx.asm b/src/main/fragment/csg65ce02-common/vbuzz=pbuc1_derefidx_vbuxx.asm new file mode 100644 index 000000000..c42104046 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=pbuc1_derefidx_vbuxx.asm @@ -0,0 +1 @@ +ldz {c1},x \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuaa.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuaa.asm new file mode 100644 index 000000000..b10335c63 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuaa.asm @@ -0,0 +1 @@ +taz \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuaa_minus_1.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuaa_minus_1.asm new file mode 100644 index 000000000..61bc33696 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuaa_minus_1.asm @@ -0,0 +1,2 @@ +taz +dez \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuc1.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuc1.asm index 476927492..95dfea438 100644 --- a/src/main/fragment/csg65ce02-common/vbuzz=vbuc1.asm +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuc1.asm @@ -1 +1 @@ -ldz #{c1} \ No newline at end of file +ldz #{c1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbum1.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbum1.asm new file mode 100644 index 000000000..a14e67f20 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbum1.asm @@ -0,0 +1 @@ +ldz {m1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuxx.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuxx.asm new file mode 100644 index 000000000..cf7644693 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuxx.asm @@ -0,0 +1,2 @@ +stx $ff +ldz $ff \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuxx_plus_1.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuxx_plus_1.asm new file mode 100644 index 000000000..31983de3a --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuxx_plus_1.asm @@ -0,0 +1,3 @@ +txa +taz +inz \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuyy.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuyy.asm new file mode 100644 index 000000000..29809425d --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuyy.asm @@ -0,0 +1,2 @@ +sty $ff +ldz $ff \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuyy_plus_1.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuyy_plus_1.asm new file mode 100644 index 000000000..079d9a10b --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuyy_plus_1.asm @@ -0,0 +1,3 @@ +tya +taz +inz \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuzz.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuzz.asm new file mode 100644 index 000000000..e69de29bb diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_bor_vbuzz.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_bor_vbuzz.asm new file mode 100644 index 000000000..e69de29bb diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_minus_2.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_minus_2.asm new file mode 100644 index 000000000..7e6e01602 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_minus_2.asm @@ -0,0 +1,2 @@ +dez +dez \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_plus_1.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_plus_1.asm new file mode 100644 index 000000000..ea2a13222 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_plus_1.asm @@ -0,0 +1 @@ +inz \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_plus_2.asm b/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_plus_2.asm new file mode 100644 index 000000000..0fd151369 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz=vbuzz_plus_2.asm @@ -0,0 +1,2 @@ +inz +inz \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_eq_0_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_eq_0_then_la1.asm new file mode 100644 index 000000000..4b240b8e9 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_eq_0_then_la1.asm @@ -0,0 +1,2 @@ +cpz #0 +beq {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_eq__deref_pbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_eq__deref_pbuc1_then_la1.asm new file mode 100644 index 000000000..0efbd925c --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_eq__deref_pbuc1_then_la1.asm @@ -0,0 +1,2 @@ +cpz {c1} +beq {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuc1_then_la1.asm new file mode 100644 index 000000000..a61f41277 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuc1_then_la1.asm @@ -0,0 +1,2 @@ +cpz #{c1} +beq {la1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuxx_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuxx_then_la1.asm new file mode 100644 index 000000000..09c1496a3 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuxx_then_la1.asm @@ -0,0 +1,3 @@ +stx $ff +cpz $ff +beq {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuyy_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuyy_then_la1.asm new file mode 100644 index 000000000..aa1013957 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_eq_vbuyy_then_la1.asm @@ -0,0 +1,3 @@ +sty $ff +cpz $ff +beq {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuaa_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuaa_then_la1.asm new file mode 100644 index 000000000..00ec27c0b --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuaa_then_la1.asm @@ -0,0 +1,3 @@ +sta $ff +cpz $ff +bcs {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuc1_then_la1.asm new file mode 100644 index 000000000..058d93dcb --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuc1_then_la1.asm @@ -0,0 +1,2 @@ +cpz #{c1} +bcs {la1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz_ge_vbum1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbum1_then_la1.asm new file mode 100644 index 000000000..c83fa2b27 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbum1_then_la1.asm @@ -0,0 +1,2 @@ +cpz {m1} +bcs {la1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuxx_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuxx_then_la1.asm new file mode 100644 index 000000000..a4b4e5a41 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuxx_then_la1.asm @@ -0,0 +1,3 @@ +stx $ff +cpz $ff +bcs {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuyy_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuyy_then_la1.asm new file mode 100644 index 000000000..79089fbe4 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_ge_vbuyy_then_la1.asm @@ -0,0 +1,3 @@ +sty $ff +cpz $ff +bcs {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_gt_0_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_gt_0_then_la1.asm new file mode 100644 index 000000000..c0ee809e7 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_gt_0_then_la1.asm @@ -0,0 +1,2 @@ +cpz #0 +bne {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_gt_vbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_gt_vbuc1_then_la1.asm new file mode 100644 index 000000000..adb9f0d03 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_gt_vbuc1_then_la1.asm @@ -0,0 +1,4 @@ +cpz #{c1} +beq !+ +bcs {la1} +!: diff --git a/src/main/fragment/csg65ce02-common/vbuzz_le_0_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_le_0_then_la1.asm new file mode 100644 index 000000000..4b240b8e9 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_le_0_then_la1.asm @@ -0,0 +1,2 @@ +cpz #0 +beq {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_le_vbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_le_vbuc1_then_la1.asm new file mode 100644 index 000000000..1c2b6c692 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_le_vbuc1_then_la1.asm @@ -0,0 +1,3 @@ +cpz #{c1} +bcc {la1} +beq {la1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz_lt__deref_pbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_lt__deref_pbuc1_then_la1.asm new file mode 100644 index 000000000..ccf6dc164 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_lt__deref_pbuc1_then_la1.asm @@ -0,0 +1,2 @@ +cpz {c1} +bcc {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuaa_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuaa_then_la1.asm new file mode 100644 index 000000000..289bb8c72 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuaa_then_la1.asm @@ -0,0 +1,3 @@ +sta $ff +cpz $ff +bcc {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuc1_then_la1.asm index 201f1582d..ff1511d76 100644 --- a/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuc1_then_la1.asm +++ b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuc1_then_la1.asm @@ -1,2 +1,2 @@ cpz #{c1} -bcc {la1} \ No newline at end of file +bcc {la1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz_lt_vbum1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbum1_then_la1.asm new file mode 100644 index 000000000..ce3d8f322 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbum1_then_la1.asm @@ -0,0 +1,2 @@ +cpz {m1} +bcc {la1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuxx_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuxx_then_la1.asm new file mode 100644 index 000000000..a09a02399 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuxx_then_la1.asm @@ -0,0 +1,3 @@ +stx $ff +cpz $ff +bcc {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuyy_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuyy_then_la1.asm new file mode 100644 index 000000000..1b836e52a --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_lt_vbuyy_then_la1.asm @@ -0,0 +1,3 @@ +sty $ff +cpz $ff +bcc {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_neq_0_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_neq_0_then_la1.asm new file mode 100644 index 000000000..c0ee809e7 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_neq_0_then_la1.asm @@ -0,0 +1,2 @@ +cpz #0 +bne {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_neq__deref_pbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_neq__deref_pbuc1_then_la1.asm new file mode 100644 index 000000000..51b9b72cc --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_neq__deref_pbuc1_then_la1.asm @@ -0,0 +1,2 @@ +cpz {c1} +bne {la1} \ No newline at end of file diff --git a/src/main/fragment/csg65ce02-common/vbuzz_neq_vbuc1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_neq_vbuc1_then_la1.asm new file mode 100644 index 000000000..6b9db3160 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_neq_vbuc1_then_la1.asm @@ -0,0 +1,2 @@ +cpz #{c1} +bne {la1} diff --git a/src/main/fragment/csg65ce02-common/vbuzz_neq_vbum1_then_la1.asm b/src/main/fragment/csg65ce02-common/vbuzz_neq_vbum1_then_la1.asm new file mode 100644 index 000000000..c21657890 --- /dev/null +++ b/src/main/fragment/csg65ce02-common/vbuzz_neq_vbum1_then_la1.asm @@ -0,0 +1,2 @@ +cpz {m1} +bne {la1} diff --git a/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentTemplateSynthesizer.java b/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentTemplateSynthesizer.java index fee620134..d7902d71f 100644 --- a/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentTemplateSynthesizer.java +++ b/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentTemplateSynthesizer.java @@ -112,6 +112,7 @@ public class AsmFragmentTemplateSynthesizer { for(AsmFragmentTemplate candidateTemplate : candidates) { double score = candidateTemplate.getCycles(); if(candidateTemplate.getClobber().isClobberA()) score += 0.5; + if(candidateTemplate.getClobber().isClobberZ()) score += 1.0; if(candidateTemplate.getClobber().isClobberY()) score += 1.0; if(candidateTemplate.getClobber().isClobberX()) score += 1.5; if(score < minScore) {