From 473722f8eb9fbaeffce9937e3d5bc40080d905a1 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Sat, 23 Jan 2021 17:23:25 +0100 Subject: [PATCH] One demo program for vera modes. --- .../cache/fragment-cache-wdc65c02.asm | 3103 +++++++---------- src/test/kc/examples/cx16/cx16-vera.c | 12 +- 2 files changed, 1334 insertions(+), 1781 deletions(-) diff --git a/src/main/fragment/cache/fragment-cache-wdc65c02.asm b/src/main/fragment/cache/fragment-cache-wdc65c02.asm index edbaf31bf..5e156ee9c 100644 --- a/src/main/fragment/cache/fragment-cache-wdc65c02.asm +++ b/src/main/fragment/cache/fragment-cache-wdc65c02.asm @@ -19,6 +19,11 @@ sta {z1}+3 //FRAGMENT vbuz1=_deref_pbuc1 lda {c1} sta {z1} +//FRAGMENT vwuz1=vbuc1 +lda #<{c1} +sta {z1} +lda #>{c1} +sta {z1}+1 //FRAGMENT vbuz1_lt_vbuz2_then_la1 lda {z1} cmp {z2} @@ -30,58 +35,59 @@ stx {z1} //FRAGMENT vbuz1=vbuz2 lda {z2} sta {z1} -//FRAGMENT pvoz1=pvoc1 -lda #<{c1} -sta {z1} -lda #>{c1} -sta {z1}+1 -//FRAGMENT vwuz1=vbuc1 -lda #<{c1} -sta {z1} -lda #>{c1} -sta {z1}+1 +//FRAGMENT _deref_pbuc1=vbuc2 +lda #{c2} +sta {c1} +//FRAGMENT _deref_pbuc1=_deref_pbuc1_bor__deref_pbuc2 +lda {c1} +ora {c2} +sta {c1} //FRAGMENT pbuz1=pbuc1 lda #<{c1} sta {z1} lda #>{c1} sta {z1}+1 -//FRAGMENT _deref_pbuc1=_deref_pbuc1_bor__deref_pbuc2 -lda {c1} -ora {c2} -sta {c1} -//FRAGMENT 0_eq_vbuz1_then_la1 +//FRAGMENT vbuz1_eq_0_then_la1 lda {z1} cmp #0 beq {la1} +//FRAGMENT vbuz1_eq_vbuc1_then_la1 +lda #{c1} +cmp {z1} +beq {la1} +//FRAGMENT vbuz1=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +sta {z1} +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuz1 +lda {c1} +and {z1} +sta {c1} +//FRAGMENT vbuz1_neq_vbuc1_then_la1 +lda #{c1} +cmp {z1} +bne {la1} //FRAGMENT vwuz1=vwuz2 lda {z2} sta {z1} lda {z2}+1 sta {z1}+1 -//FRAGMENT vbuz1=_inc_vbuz1 -inc {z1} -//FRAGMENT vbuz1_lt_vbuc1_then_la1 -lda {z1} -cmp #{c1} -bcc {la1} -//FRAGMENT vwuz1=_inc_vwuz1 -inc {z1} +//FRAGMENT vwuz1_eq_vbuc1_then_la1 +lda #{c1} +cmp {z1} bne !+ -inc {z1}+1 -!: -//FRAGMENT vwuz1_le_vwuc1_then_la1 lda {z1}+1 -cmp #>{c1} bne !+ +jmp {la1} +!: +//FRAGMENT vwuz1_eq_vwuc1_then_la1 lda {z1} cmp #<{c1} -!: -bcc {la1} +bne !+ +lda {z1}+1 +cmp #>{c1} beq {la1} -//FRAGMENT vbuz1=vwuz2_band_vbuc1 -lda #{c1} -and {z2} -sta {z1} +!: //FRAGMENT vbuz1=_deref_pbuc1_ror_7 lda {c1} rol @@ -102,10 +108,6 @@ sta {z1} //FRAGMENT _deref_pbuc1=vbuz1 lda {z1} sta {c1} -//FRAGMENT pbuc1_derefidx_vbuz1=vbuz2 -lda {z2} -ldy {z1} -sta {c1},y //FRAGMENT vbuz1=vbuz2_rol_1 lda {z2} asl @@ -116,6 +118,35 @@ lda {c1},y sta {z1} lda {c1}+1,y sta {z1}+1 +//FRAGMENT vbuz1=_deref_pbuz2_band_vbuc1 +lda #{c1} +ldy #0 +and ({z2}),y +sta {z1} +//FRAGMENT vbuz1=vbuz2_ror_4 +lda {z2} +lsr +lsr +lsr +lsr +sta {z1} +//FRAGMENT vwuz1=pwuc1_derefidx_vbuz2 +ldy {z2} +lda {c1},y +sta {z1} +lda {c1}+1,y +sta {z1}+1 +//FRAGMENT vbuz1=vbuz2_ror_6 +lda {z2} +rol +rol +rol +and #$03 +sta {z1} +//FRAGMENT pbuc1_derefidx_vbuz1=vbuz2 +lda {z2} +ldy {z1} +sta {c1},y //FRAGMENT _deref_pbuz1=vbuz2 lda {z2} ldy #0 @@ -155,47 +186,173 @@ lda {z2} sta {c1},y lda {z2}+1 sta {c1}+1,y +//FRAGMENT pbuz1=pbuz2 +lda {z2} +sta {z1} +lda {z2}+1 +sta {z1}+1 +//FRAGMENT vbuz1=vbuz2_rol_4 +lda {z2} +asl +asl +asl +asl +sta {z1} +//FRAGMENT vbuz1=vbuz2_bor_vbuz3 +lda {z2} +ora {z3} +sta {z1} +//FRAGMENT vbuz1_lt_vwuz2_then_la1 +lda {z2}+1 +bne {la1} +lda {z1} +cmp {z2} +bcc {la1} +//FRAGMENT pwuc1_derefidx_vbuz1=vbuc2 +lda #{c2} +ldy {z1} +sta {c1},y +lda #0 +sta {c1}+1,y //FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #{c2} and {c1} sta {c1} -//FRAGMENT vbuz1=_lo_pvoz2 +//FRAGMENT vbuz1=_lo_pbuz2 lda {z2} sta {z1} -//FRAGMENT vbuz1=_hi_pvoz2 +//FRAGMENT vbuz1=_hi_pbuz2 lda {z2}+1 sta {z1} -//FRAGMENT _deref_pbuc1=vbuc2 -lda #{c2} -sta {c1} -//FRAGMENT _deref_pbuc1=_deref_pbuc1_bor_vbuc2 -lda #{c2} -ora {c1} -sta {c1} -//FRAGMENT vbuz1=vbuc1_bor_vbuz2 +//FRAGMENT vbuz1=vbuz2_bor_vbuc1 lda #{c1} ora {z2} sta {z1} -//FRAGMENT vwuz1_lt_vwuz2_then_la1 +//FRAGMENT pbuz1=pbuz1_plus_vwuz2 +lda {z1} +clc +adc {z2} +sta {z1} lda {z1}+1 -cmp {z2}+1 -bcc {la1} +adc {z2}+1 +sta {z1}+1 +//FRAGMENT vbuz1=_inc_vbuz1 +inc {z1} +//FRAGMENT vbuz1=_deref_pbuz2 +ldy #0 +lda ({z2}),y +sta {z1} +//FRAGMENT pbuz1=_inc_pbuz1 +inc {z1} +bne !+ +inc {z1}+1 +!: +//FRAGMENT 0_neq_vbuz1_then_la1 +lda {z1} +cmp #0 +bne {la1} +//FRAGMENT pvoz1=pvoc1 +lda #<{c1} +sta {z1} +lda #>{c1} +sta {z1}+1 +//FRAGMENT vduz1=vbuc1 +lda #{c1} +sta {z1} +lda #0 +sta {z1}+1 +sta {z1}+2 +sta {z1}+3 +//FRAGMENT pbuc1_derefidx_vbuz1=pbuc1_derefidx_vbuz1_plus_1 +ldy {z1} +lda {c1},y +inc +sta {c1},y +//FRAGMENT vbuz1_neq_0_then_la1 +lda {z1} +cmp #0 +bne {la1} +//FRAGMENT pvoz1=pvoz2 +lda {z2} +sta {z1} +lda {z2}+1 +sta {z1}+1 +//FRAGMENT vwuz1=vwuz1_plus_vwuc1 +clc +lda {z1} +adc #<{c1} +sta {z1} +lda {z1}+1 +adc #>{c1} +sta {z1}+1 +//FRAGMENT vbuz1=vbuz1_plus_2 +lda {z1} +clc +adc #2 +sta {z1} +//FRAGMENT vwuz1=_inc_vwuz2 +clc +lda {z2} +adc #1 +sta {z1} +lda {z2}+1 +adc #0 +sta {z1}+1 +//FRAGMENT vwuz1=vwuz2_band_vbuc1 +lda #{c1} +and {z2} +sta {z1} +lda #0 +sta {z1}+1 +//FRAGMENT 0_eq_vbuz1_then_la1 +lda {z1} +cmp #0 +beq {la1} +//FRAGMENT vduz1=vwuc1 +NO_SYNTHESIS +//FRAGMENT vduz1=vwsc1 +NO_SYNTHESIS +//FRAGMENT vwuz1=vwuz1_plus_vbuc1 +lda #{c1} +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: +//FRAGMENT vbuz1=vbuz1_plus_vbuc1 +lda #{c1} +clc +adc {z1} +sta {z1} +//FRAGMENT vwuz1=_inc_vwuz1 +inc {z1} +bne !+ +inc {z1}+1 +!: +//FRAGMENT vbuz1=vbuz1_plus_1 +inc {z1} +//FRAGMENT vbuz1=vbuz2_band_vbuc1 +lda #{c1} +and {z2} +sta {z1} +//FRAGMENT vwuz1_le_vwuc1_then_la1 +lda {z1}+1 +cmp #>{c1} bne !+ lda {z1} -cmp {z2} +cmp #<{c1} +!: bcc {la1} -!: -//FRAGMENT _deref_pbuc1=_deref_pbuc2 -lda {c2} -sta {c1} -//FRAGMENT vwuz1_eq_vbuc1_then_la1 +beq {la1} +//FRAGMENT vbuz1=vwuz2_band_vbuc1 lda #{c1} -cmp {z1} -bne !+ -lda {z1}+1 -bne !+ -jmp {la1} -!: +and {z2} +sta {z1} +//FRAGMENT vbuz1_lt_vbuc1_then_la1 +lda {z1} +cmp #{c1} +bcc {la1} //FRAGMENT vwuz1_neq_vwuc1_then_la1 lda {z1}+1 cmp #>{c1} @@ -203,16 +360,16 @@ bne {la1} lda {z1} cmp #<{c1} bne {la1} +//FRAGMENT vbuz1=vbuz1_bor_vbuc1 +lda #{c1} +ora {z1} +sta {z1} //FRAGMENT pwuc1_derefidx_vbuz1=vwuc2 ldy {z1} lda #<{c2} sta {c1},y lda #>{c2} sta {c1}+1,y -//FRAGMENT vbuz1=vbuz1_bor_vbuc1 -lda #{c1} -ora {z1} -sta {z1} //FRAGMENT vwuz1=_lo_vduz2 lda {z2} sta {z1} @@ -258,24 +415,187 @@ sta {z1} //FRAGMENT vbuz1=_hi_vwuz2 lda {z2}+1 sta {z1} -//FRAGMENT vbuz1=vbuz2_band_vbuc1 -lda #{c1} -and {z2} +//FRAGMENT pbuz1=_deref_qbuc1 +lda {c1} sta {z1} -//FRAGMENT vbuz1_eq_vbuc1_then_la1 +lda {c1}+1 +sta {z1}+1 +//FRAGMENT _deref_pbuz1=_deref_pbuz1_band_vbuc1 lda #{c1} -cmp {z1} -beq {la1} -//FRAGMENT vbuz1_neq_vbuc1_then_la1 -lda #{c1} -cmp {z1} -bne {la1} -//FRAGMENT pwuc1_derefidx_vbuz1=vbuc2 -lda #{c2} -ldy {z1} -sta {c1},y +ldy #0 +and ({z1}),y +ldy #0 +sta ({z1}),y +//FRAGMENT _deref_pbuz1=_deref_pbuz1_bor_vbuz2 +lda {z2} +ldy #0 +ora ({z1}),y +ldy #0 +sta ({z1}),y +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2 +ldy {z2} +lda {c1},y +sta {z1} +//FRAGMENT pbuz1=pbuz2_plus_pwuc1_derefidx_vbuz3 +ldy {z3} +clc +lda {z2} +adc {c1},y +sta {z1} +lda {z2}+1 +adc {c1}+1,y +sta {z1}+1 +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_rol_1 +ldy {z2} +lda {c1},y +asl +sta {z1} +//FRAGMENT pbuz1=pbuz2_plus_vbuz3 +lda {z3} +clc +adc {z2} +sta {z1} lda #0 -sta {c1}+1,y +adc {z2}+1 +sta {z1}+1 +//FRAGMENT pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 +ldx {z1} +inc {c1},x +//FRAGMENT vwuz1=_word_pbuc1_derefidx_vbuz2 +ldy {z2} +lda {c1},y +sta {z1} +lda #0 +sta {z1}+1 +//FRAGMENT vwuz1_neq_vwuz2_then_la1 +lda {z1}+1 +cmp {z2}+1 +bne {la1} +lda {z1} +cmp {z2} +bne {la1} +//FRAGMENT pbuc1_derefidx_vbuz1_neq_vbuz2_then_la1 +lda {z2} +ldy {z1} +cmp {c1},y +bne {la1} +//FRAGMENT vbuz1=_lo_pvoz2 +lda {z2} +sta {z1} +//FRAGMENT vbuz1=_hi_pvoz2 +lda {z2}+1 +sta {z1} +//FRAGMENT vbuz1=vbuc1_bor_vbuz2 +lda #{c1} +ora {z2} +sta {z1} +//FRAGMENT _deref_pbuc1=_deref_pbuc1_bor_vbuc2 +lda #{c2} +ora {c1} +sta {c1} +//FRAGMENT vwuz1_lt_vwuz2_then_la1 +lda {z1}+1 +cmp {z2}+1 +bcc {la1} +bne !+ +lda {z1} +cmp {z2} +bcc {la1} +!: +//FRAGMENT _deref_pbuc1=_deref_pbuc2 +lda {c2} +sta {c1} +//FRAGMENT pbuz1=pbuz2_plus_vwuz3 +lda {z2} +clc +adc {z3} +sta {z1} +lda {z2}+1 +adc {z3}+1 +sta {z1}+1 +//FRAGMENT pbuz1_neq_pbuz2_then_la1 +lda {z1}+1 +cmp {z2}+1 +bne {la1} +lda {z1} +cmp {z2} +bne {la1} +//FRAGMENT _deref_pbuc1=_deref_pbuz1 +ldy #0 +lda ({z1}),y +sta {c1} +//FRAGMENT vduz1=_deref_pduc1 +lda {c1} +sta {z1} +lda {c1}+1 +sta {z1}+1 +lda {c1}+2 +sta {z1}+2 +lda {c1}+3 +sta {z1}+3 +//FRAGMENT vwuz1=vwuc1_rol_vbuz2 +ldy {z2} +lda #<{c1} +sta {z1} +lda #>{c1}+1 +sta {z1}+1 +cpy #0 +beq !e+ +!: +asl {z1} +rol {z1}+1 +dey +bne !- +!e: +//FRAGMENT vbuz1=_lo_vwuz2 +lda {z2} +sta {z1} +//FRAGMENT vduz1=vduz2_plus_vwuz3 +lda {z2} +clc +adc {z3} +sta {z1} +lda {z2}+1 +adc {z3}+1 +sta {z1}+1 +lda {z2}+2 +adc #0 +sta {z1}+2 +lda {z2}+3 +adc #0 +sta {z1}+3 +//FRAGMENT vduz1=vduz2_plus_vbuz3 +lda {z3} +clc +adc {z2} +sta {z1} +lda {z2}+1 +adc #0 +sta {z1}+1 +lda {z2}+2 +adc #0 +sta {z1}+2 +lda {z2}+3 +adc #0 +sta {z1}+3 +//FRAGMENT vduz1=vduz1_plus_vwuz2 +lda {z1} +clc +adc {z2} +sta {z1} +lda {z1}+1 +adc {z2}+1 +sta {z1}+1 +lda {z1}+2 +adc #0 +sta {z1}+2 +lda {z1}+3 +adc #0 +sta {z1}+3 +//FRAGMENT vwuz1_neq_vbuc1_then_la1 +NO_SYNTHESIS +//FRAGMENT vwuz1_neq_vbsc1_then_la1 +NO_SYNTHESIS //FRAGMENT _deref_pwuc1=vwuc2 lda #<{c2} sta {c1} @@ -290,71 +610,10 @@ lda #<{c2}>>$10 sta {c1}+2 lda #>{c2}>>$10 sta {c1}+3 -//FRAGMENT pbuz1=pbuz2 -lda {z2} -sta {z1} -lda {z2}+1 -sta {z1}+1 -//FRAGMENT vbuz1=vbuz2_rol_4 -lda {z2} -asl -asl -asl -asl -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_vbuz3 -lda {z2} -ora {z3} -sta {z1} -//FRAGMENT vbuz1_lt_vwuz2_then_la1 -lda {z2}+1 -bne {la1} -lda {z1} -cmp {z2} -bcc {la1} -//FRAGMENT vbuz1=_lo_pbuz2 -lda {z2} -sta {z1} -//FRAGMENT vbuz1=_hi_pbuz2 -lda {z2}+1 -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_vbuc1 -lda #{c1} -ora {z2} -sta {z1} -//FRAGMENT pbuz1=pbuz1_plus_vwuz2 -lda {z1} -clc -adc {z2} -sta {z1} -lda {z1}+1 -adc {z2}+1 -sta {z1}+1 -//FRAGMENT vbuz1=_deref_pbuz2 -ldy #0 -lda ({z2}),y -sta {z1} -//FRAGMENT pbuz1=_inc_pbuz1 -inc {z1} -bne !+ -inc {z1}+1 -!: -//FRAGMENT 0_neq_vbuz1_then_la1 -lda {z1} -cmp #0 -bne {la1} -//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2 -ldy {z2} -lda {c1},y -sta {z1} //FRAGMENT vbsz1=pbsc1_derefidx_vbuz2 ldy {z2} lda {c1},y sta {z1} -//FRAGMENT vbuz1_neq_0_then_la1 -lda {z1} -cmp #0 -bne {la1} //FRAGMENT vwuz1=vwuz2_ror_3 lda {z2}+1 lsr @@ -445,12 +704,6 @@ lda {z2} clc adc {z3} sta {z1} -//FRAGMENT vwuz1=pwuc1_derefidx_vbuz2 -ldy {z2} -lda {c1},y -sta {z1} -lda {c1}+1,y -sta {z1}+1 //FRAGMENT vduz1=vduz2 lda {z2} sta {z1} @@ -490,20 +743,6 @@ sta ({z1}),y iny lda {z2}+3 sta ({z1}),y -//FRAGMENT vduz1=vduz1_plus_vwuz2 -lda {z1} -clc -adc {z2} -sta {z1} -lda {z1}+1 -adc {z2}+1 -sta {z1}+1 -lda {z1}+2 -adc #0 -sta {z1}+2 -lda {z1}+3 -adc #0 -sta {z1}+3 //FRAGMENT vwuz1=vwuz2_minus_vwuz3 lda {z2} sec @@ -542,10 +781,6 @@ sta {z1} //FRAGMENT vwuz1=vwuz1_rol_1 asl {z1} rol {z1}+1 -//FRAGMENT vbuz1_eq_0_then_la1 -lda {z1} -cmp #0 -beq {la1} //FRAGMENT vwuz1=vwuz1_bor_vbuc1 lda #{c1} ora {z1} @@ -558,84 +793,27 @@ sta {z1} lda {z1}+1 sbc {z2}+1 sta {z1}+1 -//FRAGMENT pbuz1=_deref_qbuc1 -lda {c1} -sta {z1} -lda {c1}+1 -sta {z1}+1 -//FRAGMENT _deref_pbuz1=_deref_pbuz1_band_vbuc1 -lda #{c1} -ldy #0 -and ({z1}),y -ldy #0 -sta ({z1}),y -//FRAGMENT _deref_pbuz1=_deref_pbuz1 -ldy #0 -lda ({z1}),y -ldy #0 -sta ({z1}),y -//FRAGMENT vbuz1=_deref_pbuz2_band_vbuc1 -lda #{c1} -ldy #0 -and ({z2}),y -sta {z1} -//FRAGMENT vbuz1=vbuz2_ror_4 -lda {z2} -lsr -lsr -lsr -lsr -sta {z1} -//FRAGMENT vbuz1=vbuz2_ror_6 -lda {z2} -rol -rol -rol -and #$03 -sta {z1} -//FRAGMENT pbuz1=pbuz2_plus_pwuc1_derefidx_vbuz3 -ldy {z3} -clc -lda {z2} -adc {c1},y -sta {z1} -lda {z2}+1 -adc {c1}+1,y -sta {z1}+1 -//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_rol_1 +//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_rol_4 ldy {z2} lda {c1},y asl +asl +asl +asl sta {z1} -//FRAGMENT pbuz1=pbuz2_plus_vbuz3 -lda {z3} -clc -adc {z2} -sta {z1} -lda #0 -adc {z2}+1 -sta {z1}+1 -//FRAGMENT pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1 -ldx {z1} -inc {c1},x -//FRAGMENT vwuz1=_word_pbuc1_derefidx_vbuz2 -ldy {z2} -lda {c1},y -sta {z1} -lda #0 -sta {z1}+1 -//FRAGMENT vwuz1_neq_vwuz2_then_la1 -lda {z1}+1 -cmp {z2}+1 -bne {la1} -lda {z1} -cmp {z2} -bne {la1} -//FRAGMENT pbuc1_derefidx_vbuz1_neq_vbuz2_then_la1 +//FRAGMENT vbuz1=vbuz2_bor_pbuc1_derefidx_vbuz3 lda {z2} -ldy {z1} -cmp {c1},y -bne {la1} +ldy {z3} +ora {c1},y +sta {z1} +//FRAGMENT vwuz1=vwuz2_plus_vwuz3 +lda {z2} +clc +adc {z3} +sta {z1} +lda {z2}+1 +adc {z3}+1 +sta {z1}+1 //FRAGMENT _deref_pbuc1_neq_pbuc2_derefidx_vbuz1_then_la1 lda {c1} ldy {z1} @@ -675,9 +853,6 @@ asl {z1} rol {z1}+1 rol {z1}+2 rol {z1}+3 -//FRAGMENT vbuz1=_lo_vwuz2 -lda {z2} -sta {z1} //FRAGMENT vduz1_lt_vduz2_then_la1 lda {z1}+3 cmp {z2}+3 @@ -735,27 +910,23 @@ bne !+ dec {z1}+1 !: dec {z1} -//FRAGMENT vbuz1=pbuc1_derefidx_vbuz2_rol_4 -ldy {z2} +//FRAGMENT pbuc1_derefidx_vbuz1_lt_vbuz2_then_la1 +ldy {z1} lda {c1},y -asl -asl -asl -asl -sta {z1} -//FRAGMENT vbuz1=vbuz2_bor_pbuc1_derefidx_vbuz3 -lda {z2} -ldy {z3} -ora {c1},y -sta {z1} -//FRAGMENT vwuz1=vwuz2_plus_vwuz3 -lda {z2} -clc -adc {z3} -sta {z1} -lda {z2}+1 -adc {z3}+1 -sta {z1}+1 +cmp {z2} +bcc {la1} +//FRAGMENT 0_neq_pbuc1_derefidx_vbuz1_then_la1 +ldy {z1} +lda {c1},y +cmp #0 +bne {la1} +//FRAGMENT pbuc1_derefidx_vbuz1_lt_vwuz2_then_la1 +ldy {z1} +lda {c1},y +ldy {z2}+1 +bne {la1} +cmp {z2} +bcc {la1} //FRAGMENT vduz1=_dword__deref_pwuz2 ldy #0 sty {z1}+2 @@ -812,29 +983,6 @@ sta {z1} lda {c1} and {z2} sta {z1} -//FRAGMENT pbuc1_derefidx_vbuz1_lt_vbuz2_then_la1 -ldy {z1} -lda {c1},y -cmp {z2} -bcc {la1} -//FRAGMENT 0_neq_pbuc1_derefidx_vbuz1_then_la1 -ldy {z1} -lda {c1},y -cmp #0 -bne {la1} -//FRAGMENT pbuc1_derefidx_vbuz1_lt_vwuz2_then_la1 -ldy {z1} -lda {c1},y -ldy {z2}+1 -bne {la1} -cmp {z2} -bcc {la1} -//FRAGMENT vbuz1=_lo__deref_pwuc1 -lda {c1} -sta {z1} -//FRAGMENT vbuz1=_hi__deref_pwuc1 -lda {c1}+1 -sta {z1} //FRAGMENT vwuz1=vbuz2_rol_vbuz3 lda {z2} ldy {z3} @@ -849,19 +997,6 @@ rol {z1}+1 dey bne !- !e: -//FRAGMENT pbuz1=pbuz2_plus_vwuz3 -lda {z2} -clc -adc {z3} -sta {z1} -lda {z2}+1 -adc {z3}+1 -sta {z1}+1 -//FRAGMENT pvoz1=pvoz2 -lda {z2} -sta {z1} -lda {z2}+1 -sta {z1}+1 //FRAGMENT vwuz1=vbuz2 lda {z2} sta {z1} @@ -891,23 +1026,37 @@ sta {z1} lda {z1} //FRAGMENT vbuxx=vbuz1 ldx {z1} -//FRAGMENT 0_eq_vbuaa_then_la1 +//FRAGMENT vbuaa_eq_0_then_la1 cmp #0 beq {la1} -//FRAGMENT vbuxx_lt_vbuc1_then_la1 -cpx #{c1} -bcc {la1} -//FRAGMENT vbuaa=vwuz1_band_vbuc1 -lda #{c1} -and {z1} -//FRAGMENT vbuxx=vwuz1_band_vbuc1 -lda #{c1} -and {z1} +//FRAGMENT vbuaa_eq_vbuc1_then_la1 +cmp #{c1} +beq {la1} +//FRAGMENT vbuaa=_bnot__deref_pbuc1 +lda {c1} +eor #$ff +//FRAGMENT vbuxx=_bnot__deref_pbuc1 +lda {c1} +eor #$ff tax -//FRAGMENT vbuyy=vwuz1_band_vbuc1 -lda #{c1} -and {z1} +//FRAGMENT vbuyy=_bnot__deref_pbuc1 +lda {c1} +eor #$ff tay +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuaa +and {c1} +sta {c1} +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuxx +txa +and {c1} +sta {c1} +//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuyy +tya +and {c1} +sta {c1} +//FRAGMENT vbuxx_neq_vbuc1_then_la1 +cpx #{c1} +bne {la1} //FRAGMENT vbuaa=_deref_pbuc1_ror_7 lda {c1} rol @@ -1080,19 +1229,6 @@ bne !- tay //FRAGMENT _deref_pbuc1=vbuaa sta {c1} -//FRAGMENT pbuc1_derefidx_vbuaa=vbuz1 -tay -lda {z1} -sta {c1},y -//FRAGMENT pbuc1_derefidx_vbuxx=vbuz1 -lda {z1} -sta {c1},x -//FRAGMENT pbuc1_derefidx_vbuyy=vbuz1 -lda {z1} -sta {c1},y -//FRAGMENT pbuc1_derefidx_vbuz1=vbuaa -ldy {z1} -sta {c1},y //FRAGMENT vbuaa=vbuz1_rol_1 lda {z1} asl @@ -1161,6 +1297,248 @@ lda {c1},y sta {z1} lda {c1}+1,y sta {z1}+1 +//FRAGMENT vbuaa=_deref_pbuz1_band_vbuc1 +lda #{c1} +ldy #0 +and ({z1}),y +//FRAGMENT vbuxx=_deref_pbuz1_band_vbuc1 +lda #{c1} +ldy #0 +and ({z1}),y +tax +//FRAGMENT vbuyy=_deref_pbuz1_band_vbuc1 +lda #{c1} +ldy #0 +and ({z1}),y +tay +//FRAGMENT vbuaa=vbuz1_ror_4 +lda {z1} +lsr +lsr +lsr +lsr +//FRAGMENT vbuxx=vbuz1_ror_4 +lda {z1} +lsr +lsr +lsr +lsr +tax +//FRAGMENT vbuyy=vbuz1_ror_4 +lda {z1} +lsr +lsr +lsr +lsr +tay +//FRAGMENT vbuz1=vbuaa_ror_4 +lsr +lsr +lsr +lsr +sta {z1} +//FRAGMENT vbuaa=vbuaa_ror_4 +lsr +lsr +lsr +lsr +//FRAGMENT vbuxx=vbuaa_ror_4 +lsr +lsr +lsr +lsr +tax +//FRAGMENT vbuyy=vbuaa_ror_4 +lsr +lsr +lsr +lsr +tay +//FRAGMENT vbuz1=vbuxx_ror_4 +txa +lsr +lsr +lsr +lsr +sta {z1} +//FRAGMENT vbuaa=vbuxx_ror_4 +txa +lsr +lsr +lsr +lsr +//FRAGMENT vbuxx=vbuxx_ror_4 +txa +lsr +lsr +lsr +lsr +tax +//FRAGMENT vbuyy=vbuxx_ror_4 +txa +lsr +lsr +lsr +lsr +tay +//FRAGMENT vbuz1=vbuyy_ror_4 +tya +lsr +lsr +lsr +lsr +sta {z1} +//FRAGMENT vbuaa=vbuyy_ror_4 +tya +lsr +lsr +lsr +lsr +//FRAGMENT vbuxx=vbuyy_ror_4 +tya +lsr +lsr +lsr +lsr +tax +//FRAGMENT vbuyy=vbuyy_ror_4 +tya +lsr +lsr +lsr +lsr +tay +//FRAGMENT vwuz1=pwuc1_derefidx_vbuaa +tay +lda {c1},y +sta {z1} +lda {c1}+1,y +sta {z1}+1 +//FRAGMENT vwuz1=pwuc1_derefidx_vbuxx +lda {c1},x +sta {z1} +lda {c1}+1,x +sta {z1}+1 +//FRAGMENT vwuz1=pwuc1_derefidx_vbuyy +lda {c1},y +sta {z1} +lda {c1}+1,y +sta {z1}+1 +//FRAGMENT vbuaa=vbuz1_ror_6 +lda {z1} +rol +rol +rol +and #$03 +//FRAGMENT vbuxx=vbuz1_ror_6 +lda {z1} +rol +rol +rol +and #$03 +tax +//FRAGMENT vbuyy=vbuz1_ror_6 +lda {z1} +rol +rol +rol +and #$03 +tay +//FRAGMENT vbuz1=vbuaa_ror_6 +rol +rol +rol +and #$03 +sta {z1} +//FRAGMENT vbuaa=vbuaa_ror_6 +rol +rol +rol +and #$03 +//FRAGMENT vbuxx=vbuaa_ror_6 +rol +rol +rol +and #$03 +tax +//FRAGMENT vbuyy=vbuaa_ror_6 +rol +rol +rol +and #$03 +tay +//FRAGMENT vbuz1=vbuxx_ror_6 +txa +rol +rol +rol +and #$03 +sta {z1} +//FRAGMENT vbuaa=vbuxx_ror_6 +txa +rol +rol +rol +and #$03 +//FRAGMENT vbuxx=vbuxx_ror_6 +txa +rol +rol +rol +and #$03 +tax +//FRAGMENT vbuyy=vbuxx_ror_6 +txa +rol +rol +rol +and #$03 +tay +//FRAGMENT vbuz1=vbuyy_ror_6 +tya +rol +rol +rol +and #$03 +sta {z1} +//FRAGMENT vbuaa=vbuyy_ror_6 +tya +rol +rol +rol +and #$03 +//FRAGMENT vbuxx=vbuyy_ror_6 +tya +rol +rol +rol +and #$03 +tax +//FRAGMENT vbuyy=vbuyy_ror_6 +tya +rol +rol +rol +and #$03 +tay +//FRAGMENT pbuc1_derefidx_vbuz1=vbuaa +ldy {z1} +sta {c1},y +//FRAGMENT pbuc1_derefidx_vbuz1=vbuxx +ldy {z1} +txa +sta {c1},y +//FRAGMENT pbuc1_derefidx_vbuz1=vbuyy +tya +ldy {z1} +sta {c1},y +//FRAGMENT pbuc1_derefidx_vbuaa=vbuz1 +tay +lda {z1} +sta {c1},y +//FRAGMENT pbuc1_derefidx_vbuaa=vbuaa +tax +sta {c1},x //FRAGMENT _deref_pbuz1=vbuxx txa ldy #0 @@ -1174,10 +1552,6 @@ ldy {z1} sta $ff cpy $ff bcs {la1} -//FRAGMENT pbuc1_derefidx_vbuz1=vbuxx -ldy {z1} -txa -sta {c1},y //FRAGMENT vwuz1=_word_vbuxx txa sta {z1} @@ -1199,191 +1573,6 @@ lda {z1} sta {c1},y lda {z1}+1 sta {c1}+1,y -//FRAGMENT vbuaa=_lo_pvoz1 -lda {z1} -//FRAGMENT vbuxx=_lo_pvoz1 -ldx {z1} -//FRAGMENT vbuaa=_hi_pvoz1 -lda {z1}+1 -//FRAGMENT vbuxx=_hi_pvoz1 -ldx {z1}+1 -//FRAGMENT vbuz1=vbuc1_bor_vbuxx -txa -ora #{c1} -sta {z1} -//FRAGMENT vbuz1=vbuc1_bor_vbuyy -tya -ora #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuc1_bor_vbuz1 -lda #{c1} -ora {z1} -//FRAGMENT vbuaa=vbuc1_bor_vbuxx -txa -ora #{c1} -//FRAGMENT vbuaa=vbuc1_bor_vbuyy -tya -ora #{c1} -//FRAGMENT vbuxx=vbuc1_bor_vbuz1 -lda #{c1} -ora {z1} -tax -//FRAGMENT vbuxx=vbuc1_bor_vbuxx -txa -ora #{c1} -tax -//FRAGMENT vbuxx=vbuc1_bor_vbuyy -tya -ora #{c1} -tax -//FRAGMENT vbuyy=vbuc1_bor_vbuz1 -lda #{c1} -ora {z1} -tay -//FRAGMENT vbuyy=vbuc1_bor_vbuxx -txa -ora #{c1} -tay -//FRAGMENT vbuyy=vbuc1_bor_vbuyy -tya -ora #{c1} -tay -//FRAGMENT pbuc1_derefidx_vbuxx=vbuc2 -lda #{c2} -sta {c1},x -//FRAGMENT pwuc1_derefidx_vbuaa=vwuc2 -tay -lda #<{c2} -sta {c1},y -lda #>{c2} -sta {c1}+1,y -//FRAGMENT pwuc1_derefidx_vbuxx=vwuc2 -lda #<{c2} -sta {c1},x -lda #>{c2} -sta {c1}+1,x -//FRAGMENT pwuc1_derefidx_vbuyy=vwuc2 -lda #<{c2} -sta {c1},y -lda #>{c2} -sta {c1}+1,y -//FRAGMENT vbuxx=vbuxx_bor_vbuc1 -txa -ora #{c1} -tax -//FRAGMENT vbuyy=vbuyy_bor_vbuc1 -tya -ora #{c1} -tay -//FRAGMENT vbuz1=vbuxx -stx {z1} -//FRAGMENT pbuc1_derefidx_vbuxx=_byte_vwuz1 -lda {z1} -sta {c1},x -//FRAGMENT vbuz1=vbuxx_rol_2 -txa -asl -asl -sta {z1} -//FRAGMENT vbuxx=vbuz1_rol_2 -lda {z1} -asl -asl -tax -//FRAGMENT vbuxx=vbuxx_rol_2 -txa -asl -asl -tax -//FRAGMENT pduc1_derefidx_vbuxx=vduz1 -lda {z1} -sta {c1},x -lda {z1}+1 -sta {c1}+1,x -lda {z1}+2 -sta {c1}+2,x -lda {z1}+3 -sta {c1}+3,x -//FRAGMENT vbuaa=_hi_vwuz1 -lda {z1}+1 -//FRAGMENT vbuxx=_hi_vwuz1 -ldx {z1}+1 -//FRAGMENT vbuz1=vbuaa_band_vbuc1 -and #{c1} -sta {z1} -//FRAGMENT vbuz1=vbuxx_band_vbuc1 -txa -and #{c1} -sta {z1} -//FRAGMENT vbuz1=vbuyy_band_vbuc1 -tya -and #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuz1_band_vbuc1 -lda #{c1} -and {z1} -//FRAGMENT vbuaa=vbuaa_band_vbuc1 -and #{c1} -//FRAGMENT vbuaa=vbuxx_band_vbuc1 -txa -and #{c1} -//FRAGMENT vbuaa=vbuyy_band_vbuc1 -tya -and #{c1} -//FRAGMENT vbuxx=vbuz1_band_vbuc1 -lda #{c1} -and {z1} -tax -//FRAGMENT vbuxx=vbuaa_band_vbuc1 -and #{c1} -tax -//FRAGMENT vbuxx=vbuxx_band_vbuc1 -txa -and #{c1} -tax -//FRAGMENT vbuxx=vbuyy_band_vbuc1 -tya -and #{c1} -tax -//FRAGMENT vbuyy=vbuz1_band_vbuc1 -lda #{c1} -and {z1} -tay -//FRAGMENT vbuyy=vbuaa_band_vbuc1 -and #{c1} -tay -//FRAGMENT vbuyy=vbuxx_band_vbuc1 -txa -and #{c1} -tay -//FRAGMENT vbuyy=vbuyy_band_vbuc1 -tya -and #{c1} -tay -//FRAGMENT vbuxx_eq_vbuc1_then_la1 -cpx #{c1} -beq {la1} -//FRAGMENT vbuxx_neq_vbuc1_then_la1 -cpx #{c1} -bne {la1} -//FRAGMENT vbuaa=vbuaa_bor_vbuc1 -ora #{c1} -//FRAGMENT pwuc1_derefidx_vbuaa=vbuc2 -tay -lda #{c2} -sta {c1},y -lda #0 -sta {c1}+1,y -//FRAGMENT pwuc1_derefidx_vbuxx=vbuc2 -lda #{c2} -sta {c1},x -lda #0 -sta {c1}+1,x -//FRAGMENT pwuc1_derefidx_vbuyy=vbuc2 -lda #{c2} -sta {c1},y -lda #0 -sta {c1}+1,y //FRAGMENT vbuz1=vbuaa_rol_4 asl asl @@ -1551,6 +1740,22 @@ ldy {z1}+1 bne {la1} cmp {z1} bcc {la1} +//FRAGMENT pwuc1_derefidx_vbuaa=vbuc2 +tay +lda #{c2} +sta {c1},y +lda #0 +sta {c1}+1,y +//FRAGMENT pwuc1_derefidx_vbuxx=vbuc2 +lda #{c2} +sta {c1},x +lda #0 +sta {c1}+1,x +//FRAGMENT pwuc1_derefidx_vbuyy=vbuc2 +lda #{c2} +sta {c1},y +lda #0 +sta {c1}+1,y //FRAGMENT vbuaa=_lo_pbuz1 lda {z1} //FRAGMENT vbuxx=_lo_pbuz1 @@ -1577,6 +1782,10 @@ sta {z1} //FRAGMENT vbuaa=vbuxx_bor_vbuc1 txa ora #{c1} +//FRAGMENT vbuxx=vbuxx_bor_vbuc1 +txa +ora #{c1} +tax //FRAGMENT vbuyy=vbuxx_bor_vbuc1 txa ora #{c1} @@ -1597,57 +1806,524 @@ tay //FRAGMENT 0_neq_vbuaa_then_la1 cmp #0 bne {la1} +//FRAGMENT pbuc1_derefidx_vbuaa=pbuc1_derefidx_vbuaa_plus_1 +tay +lda {c1},y +inc +sta {c1},y +//FRAGMENT pbuc1_derefidx_vbuxx=pbuc1_derefidx_vbuxx_plus_1 +lda {c1},x +inc +sta {c1},x +//FRAGMENT pbuc1_derefidx_vbuyy=pbuc1_derefidx_vbuyy_plus_1 +lda {c1},y +inc +sta {c1},y +//FRAGMENT vbuxx_neq_0_then_la1 +cpx #0 +bne {la1} +//FRAGMENT vbuz1=vbuxx +stx {z1} +//FRAGMENT vbuxx=vbuxx_plus_2 +inx +inx +//FRAGMENT 0_eq_vbuaa_then_la1 +cmp #0 +beq {la1} +//FRAGMENT vbuxx=vbuxx_plus_vbuc1 +txa +clc +adc #{c1} +tax +//FRAGMENT vbuyy=vbuyy_plus_vbuc1 +tya +clc +adc #{c1} +tay +//FRAGMENT vbuz1=vbuxx_band_vbuc1 +txa +and #{c1} +sta {z1} +//FRAGMENT vbuz1=vbuyy_band_vbuc1 +tya +and #{c1} +sta {z1} +//FRAGMENT vbuaa=vbuz1_band_vbuc1 +lda #{c1} +and {z1} +//FRAGMENT vbuaa=vbuxx_band_vbuc1 +txa +and #{c1} +//FRAGMENT vbuaa=vbuyy_band_vbuc1 +tya +and #{c1} +//FRAGMENT vbuxx=vbuz1_band_vbuc1 +lda #{c1} +and {z1} +tax +//FRAGMENT vbuxx=vbuxx_band_vbuc1 +txa +and #{c1} +tax +//FRAGMENT vbuxx=vbuyy_band_vbuc1 +tya +and #{c1} +tax +//FRAGMENT vbuyy=vbuz1_band_vbuc1 +lda #{c1} +and {z1} +tay +//FRAGMENT vbuyy=vbuxx_band_vbuc1 +txa +and #{c1} +tay +//FRAGMENT vbuyy=vbuyy_band_vbuc1 +tya +and #{c1} +tay +//FRAGMENT vbuaa_neq_vbuc1_then_la1 +cmp #{c1} +bne {la1} +//FRAGMENT vbuaa=vwuz1_band_vbuc1 +lda #{c1} +and {z1} +//FRAGMENT vbuxx=vwuz1_band_vbuc1 +lda #{c1} +and {z1} +tax +//FRAGMENT vbuyy=vwuz1_band_vbuc1 +lda #{c1} +and {z1} +tay +//FRAGMENT vbuxx_lt_vbuc1_then_la1 +cpx #{c1} +bcc {la1} +//FRAGMENT vbuyy=vbuyy_bor_vbuc1 +tya +ora #{c1} +tay +//FRAGMENT pbuc1_derefidx_vbuxx=vbuc2 +lda #{c2} +sta {c1},x +//FRAGMENT pwuc1_derefidx_vbuaa=vwuc2 +tay +lda #<{c2} +sta {c1},y +lda #>{c2} +sta {c1}+1,y +//FRAGMENT pwuc1_derefidx_vbuxx=vwuc2 +lda #<{c2} +sta {c1},x +lda #>{c2} +sta {c1}+1,x +//FRAGMENT pwuc1_derefidx_vbuyy=vwuc2 +lda #<{c2} +sta {c1},y +lda #>{c2} +sta {c1}+1,y +//FRAGMENT pbuc1_derefidx_vbuxx=_byte_vwuz1 +lda {z1} +sta {c1},x +//FRAGMENT vbuz1=vbuxx_rol_2 +txa +asl +asl +sta {z1} +//FRAGMENT vbuxx=vbuz1_rol_2 +lda {z1} +asl +asl +tax +//FRAGMENT vbuxx=vbuxx_rol_2 +txa +asl +asl +tax +//FRAGMENT pduc1_derefidx_vbuxx=vduz1 +lda {z1} +sta {c1},x +lda {z1}+1 +sta {c1}+1,x +lda {z1}+2 +sta {c1}+2,x +lda {z1}+3 +sta {c1}+3,x +//FRAGMENT vbuaa=_hi_vwuz1 +lda {z1}+1 +//FRAGMENT vbuxx=_hi_vwuz1 +ldx {z1}+1 +//FRAGMENT vbuz1=vbuaa_band_vbuc1 +and #{c1} +sta {z1} +//FRAGMENT vbuaa=vbuaa_band_vbuc1 +and #{c1} +//FRAGMENT vbuxx=vbuaa_band_vbuc1 +and #{c1} +tax +//FRAGMENT vbuyy=vbuaa_band_vbuc1 +and #{c1} +tay +//FRAGMENT vbuxx_eq_vbuc1_then_la1 +cpx #{c1} +beq {la1} +//FRAGMENT vbuaa=vbuaa_bor_vbuc1 +ora #{c1} +//FRAGMENT _deref_pbuz1=_deref_pbuz1_bor_vbuxx +txa +ldy #0 +ora ({z1}),y +ldy #0 +sta ({z1}),y +//FRAGMENT vbuz1=pbuc1_derefidx_vbuaa +tay +lda {c1},y +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx +lda {c1},x +sta {z1} +//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy +lda {c1},y +sta {z1} //FRAGMENT vbuaa=pbuc1_derefidx_vbuz1 ldy {z1} lda {c1},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuaa +tay +lda {c1},y +//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx +lda {c1},x +//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy +lda {c1},y //FRAGMENT vbuxx=pbuc1_derefidx_vbuz1 ldy {z1} ldx {c1},y //FRAGMENT vbuyy=pbuc1_derefidx_vbuz1 ldx {z1} ldy {c1},x -//FRAGMENT vbuz1=pbuc1_derefidx_vbuaa -tay -lda {c1},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuaa -tay -lda {c1},y //FRAGMENT vbuxx=pbuc1_derefidx_vbuaa tay ldx {c1},y //FRAGMENT vbuyy=pbuc1_derefidx_vbuaa tax ldy {c1},x -//FRAGMENT vbuz1=pbuc1_derefidx_vbuxx -lda {c1},x -sta {z1} -//FRAGMENT vbsz1=pbsc1_derefidx_vbuaa +//FRAGMENT pbuz1=pbuz2_plus_pwuc1_derefidx_vbuaa tay -lda {c1},y +clc +lda {z2} +adc {c1},y sta {z1} -//FRAGMENT vbsz1=pbsc1_derefidx_vbuxx -lda {c1},x +lda {z2}+1 +adc {c1}+1,y +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus_pwuc1_derefidx_vbuxx +clc +lda {z2} +adc {c1},x sta {z1} -//FRAGMENT vbsz1=pbsc1_derefidx_vbuyy -lda {c1},y +lda {z2}+1 +adc {c1}+1,x +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus_pwuc1_derefidx_vbuyy +clc +lda {z2} +adc {c1},y sta {z1} -//FRAGMENT vbsaa=pbsc1_derefidx_vbuz1 +lda {z2}+1 +adc {c1}+1,y +sta {z1}+1 +//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_rol_1 ldy {z1} lda {c1},y -//FRAGMENT vbsaa=pbsc1_derefidx_vbuaa -tay -lda {c1},y -//FRAGMENT vbsaa=pbsc1_derefidx_vbuxx +asl +//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_rol_1 +ldx {z1} lda {c1},x -//FRAGMENT vbsaa=pbsc1_derefidx_vbuyy +asl +tax +//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_rol_1 +ldy {z1} +lda {c1},y +asl +tay +//FRAGMENT pbuz1=pbuz2_plus_vbuaa +clc +adc {z2} +sta {z1} +lda #0 +adc {z2}+1 +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus_vbuxx +txa +clc +adc {z2} +sta {z1} +lda #0 +adc {z2}+1 +sta {z1}+1 +//FRAGMENT pbuz1=pbuz2_plus_vbuyy +tya +clc +adc {z2} +sta {z1} +lda #0 +adc {z2}+1 +sta {z1}+1 +//FRAGMENT vbuaa=_lo_pvoz1 +lda {z1} +//FRAGMENT vbuxx=_lo_pvoz1 +ldx {z1} +//FRAGMENT vbuaa=_hi_pvoz1 +lda {z1}+1 +//FRAGMENT vbuxx=_hi_pvoz1 +ldx {z1}+1 +//FRAGMENT vbuz1=vbuc1_bor_vbuxx +txa +ora #{c1} +sta {z1} +//FRAGMENT vbuz1=vbuc1_bor_vbuyy +tya +ora #{c1} +sta {z1} +//FRAGMENT vbuaa=vbuc1_bor_vbuz1 +lda #{c1} +ora {z1} +//FRAGMENT vbuaa=vbuc1_bor_vbuxx +txa +ora #{c1} +//FRAGMENT vbuaa=vbuc1_bor_vbuyy +tya +ora #{c1} +//FRAGMENT vbuxx=vbuc1_bor_vbuz1 +lda #{c1} +ora {z1} +tax +//FRAGMENT vbuxx=vbuc1_bor_vbuxx +txa +ora #{c1} +tax +//FRAGMENT vbuxx=vbuc1_bor_vbuyy +tya +ora #{c1} +tax +//FRAGMENT vbuyy=vbuc1_bor_vbuz1 +lda #{c1} +ora {z1} +tay +//FRAGMENT vbuyy=vbuc1_bor_vbuxx +txa +ora #{c1} +tay +//FRAGMENT vbuyy=vbuc1_bor_vbuyy +tya +ora #{c1} +tay +//FRAGMENT vwuz1=vwuc1_rol_vbuaa +tay +lda #<{c1} +sta {z1} +lda #>{c1}+1 +sta {z1}+1 +cpy #0 +beq !e+ +!: +asl {z1} +rol {z1}+1 +dey +bne !- +!e: +//FRAGMENT vwuz1=vwuc1_rol_vbuxx +lda #<{c1} +sta {z1} +lda #>{c1}+1 +sta {z1}+1 +cpx #0 +beq !e+ +!: +asl {z1} +rol {z1}+1 +dex +bne !- +!e: +//FRAGMENT vwuz1=vwuc1_rol_vbuyy +lda #<{c1} +sta {z1} +lda #>{c1}+1 +sta {z1}+1 +cpy #0 +beq !e+ +!: +asl {z1} +rol {z1}+1 +dey +bne !- +!e: +//FRAGMENT vbuaa=_lo_vwuz1 +lda {z1} +//FRAGMENT vbuxx=_lo_vwuz1 +ldx {z1} +//FRAGMENT vbuz1=vbuaa_bor_vbuxx +stx $ff +ora $ff +sta {z1} +//FRAGMENT vbuaa=vbuaa_bor_vbuxx +stx $ff +ora $ff +//FRAGMENT vbuxx=vbuaa_bor_vbuxx +stx $ff +ora $ff +tax +//FRAGMENT vbuyy=vbuaa_bor_vbuxx +stx $ff +ora $ff +tay +//FRAGMENT vbuz1=vbuaa_bor_vbuyy +sty $ff +ora $ff +sta {z1} +//FRAGMENT vbuaa=vbuaa_bor_vbuyy +sty $ff +ora $ff +//FRAGMENT vbuxx=vbuaa_bor_vbuyy +sty $ff +ora $ff +tax +//FRAGMENT vbuyy=vbuaa_bor_vbuyy +sty $ff +ora $ff +tay +//FRAGMENT vbuz1=vbuxx_bor_vbuz2 +txa +ora {z2} +sta {z1} +//FRAGMENT vbuaa=vbuxx_bor_vbuz1 +txa +ora {z1} +//FRAGMENT vbuxx=vbuxx_bor_vbuz1 +txa +ora {z1} +tax +//FRAGMENT vbuyy=vbuxx_bor_vbuz1 +txa +ora {z1} +tay +//FRAGMENT vbuz1=vbuxx_bor_vbuxx +stx {z1} +//FRAGMENT vbuz1=vbuyy_bor_vbuz2 +tya +ora {z2} +sta {z1} +//FRAGMENT vbuaa=vbuyy_bor_vbuz1 +tya +ora {z1} +//FRAGMENT vbuxx=vbuyy_bor_vbuz1 +tya +ora {z1} +tax +//FRAGMENT vbuyy=vbuyy_bor_vbuz1 +tya +ora {z1} +tay +//FRAGMENT vwuz1=_word_vbuyy +tya +sta {z1} +lda #0 +sta {z1}+1 +//FRAGMENT vwuz1=vwuz2_rol_vbuxx +lda {z2} +sta {z1} +lda {z2}+1 +sta {z1}+1 +cpx #0 +beq !e+ +!: +asl {z1} +rol {z1}+1 +dex +bne !- +!e: +//FRAGMENT vwuz1=vwuz2_rol_vbuyy +lda {z2} +sta {z1} +lda {z2}+1 +sta {z1}+1 +cpy #0 +beq !e+ +!: +asl {z1} +rol {z1}+1 +dey +bne !- +!e: +//FRAGMENT vduz1=vduz2_plus_vbuaa +clc +adc {z2} +sta {z1} +lda {z2}+1 +adc #0 +sta {z1}+1 +lda {z2}+2 +adc #0 +sta {z1}+2 +lda {z2}+3 +adc #0 +sta {z1}+3 +//FRAGMENT vduz1=vduz2_plus_vbuxx +txa +clc +adc {z2} +sta {z1} +lda {z2}+1 +adc #0 +sta {z1}+1 +lda {z2}+2 +adc #0 +sta {z1}+2 +lda {z2}+3 +adc #0 +sta {z1}+3 +//FRAGMENT vduz1=vduz2_plus_vbuyy +tya +clc +adc {z2} +sta {z1} +lda {z2}+1 +adc #0 +sta {z1}+1 +lda {z2}+2 +adc #0 +sta {z1}+2 +lda {z2}+3 +adc #0 +sta {z1}+3 +//FRAGMENT vbuz1=vbuaa_bor_vbuc1 +ora #{c1} +sta {z1} +//FRAGMENT vbuxx=vbuaa_bor_vbuc1 +ora #{c1} +tax +//FRAGMENT vbuyy=vbuaa_bor_vbuc1 +ora #{c1} +tay +//FRAGMENT vbuz1=vbuyy_bor_vbuc1 +tya +ora #{c1} +sta {z1} +//FRAGMENT vbuaa=vbuyy_bor_vbuc1 +tya +ora #{c1} +//FRAGMENT vbuxx=vbuyy_bor_vbuc1 +tya +ora #{c1} +tax +//FRAGMENT vbsaa=pbsc1_derefidx_vbuz1 +ldy {z1} lda {c1},y //FRAGMENT vbsxx=pbsc1_derefidx_vbuz1 ldy {z1} ldx {c1},y -//FRAGMENT vbuaa_neq_0_then_la1 -cmp #0 -bne {la1} +//FRAGMENT vbsyy=pbsc1_derefidx_vbuz1 +ldx {z1} +ldy {c1},x //FRAGMENT vbuxx=vbuxx_ror_2 txa lsr @@ -1658,19 +2334,9 @@ txa sec sbc #{c1} tax -//FRAGMENT vbuxx=vbuxx_ror_4 -txa -lsr -lsr -lsr -lsr -tax //FRAGMENT vbsxx_ge_0_then_la1 cpx #0 bpl {la1} -//FRAGMENT vbuxx_neq_0_then_la1 -cpx #0 -bne {la1} //FRAGMENT vbuaa=vbuz1_rol_2 lda {z1} asl @@ -1680,15 +2346,6 @@ lda {z1} asl asl tay -//FRAGMENT vbuaa=vbuxx_rol_2 -txa -asl -asl -//FRAGMENT vbuyy=vbuxx_rol_2 -txa -asl -asl -tay //FRAGMENT vbuz1=vbuaa_plus_vbuz2 clc adc {z2} @@ -1756,483 +2413,6 @@ tya clc adc {z1} tay -//FRAGMENT vbuz1=vbuz2_plus_vbuxx -txa -clc -adc {z2} -sta {z1} -//FRAGMENT vbuz1=vbuaa_plus_vbuxx -stx $ff -clc -adc $ff -sta {z1} -//FRAGMENT vbuz1=vbuxx_plus_vbuxx -txa -asl -sta {z1} -//FRAGMENT vbuz1=vbuyy_plus_vbuxx -txa -sty $ff -clc -adc $ff -sta {z1} -//FRAGMENT vbuaa=vbuz1_plus_vbuxx -txa -clc -adc {z1} -//FRAGMENT vbuaa=vbuaa_plus_vbuxx -stx $ff -clc -adc $ff -//FRAGMENT vbuaa=vbuxx_plus_vbuxx -txa -asl -//FRAGMENT vbuaa=vbuyy_plus_vbuxx -txa -sty $ff -clc -adc $ff -//FRAGMENT vbuxx=vbuz1_plus_vbuxx -txa -clc -adc {z1} -tax -//FRAGMENT vbuxx=vbuaa_plus_vbuxx -stx $ff -clc -adc $ff -tax -//FRAGMENT vbuxx=vbuxx_plus_vbuxx -txa -asl -tax -//FRAGMENT vbuxx=vbuyy_plus_vbuxx -txa -sty $ff -clc -adc $ff -tax -//FRAGMENT vbuyy=vbuz1_plus_vbuxx -txa -clc -adc {z1} -tay -//FRAGMENT vbuyy=vbuaa_plus_vbuxx -stx $ff -clc -adc $ff -tay -//FRAGMENT vbuyy=vbuxx_plus_vbuxx -txa -asl -tay -//FRAGMENT vbuyy=vbuyy_plus_vbuxx -txa -sty $ff -clc -adc $ff -tay -//FRAGMENT vwuz1=pwuc1_derefidx_vbuaa -tay -lda {c1},y -sta {z1} -lda {c1}+1,y -sta {z1}+1 -//FRAGMENT vwuz1=pwuc1_derefidx_vbuxx -lda {c1},x -sta {z1} -lda {c1}+1,x -sta {z1}+1 -//FRAGMENT vwuz1=pwuc1_derefidx_vbuyy -lda {c1},y -sta {z1} -lda {c1}+1,y -sta {z1}+1 -//FRAGMENT vbuz1=vbuyy_rol_2 -tya -asl -asl -sta {z1} -//FRAGMENT vbuaa=vbuyy_rol_2 -tya -asl -asl -//FRAGMENT vbuxx=vbuyy_rol_2 -tya -asl -asl -tax -//FRAGMENT vbuyy=vbuyy_rol_2 -tya -asl -asl -tay -//FRAGMENT vbuz1=vbuz2_plus_vbuyy -tya -clc -adc {z2} -sta {z1} -//FRAGMENT vbuz1=vbuaa_plus_vbuyy -sty $ff -clc -adc $ff -sta {z1} -//FRAGMENT vbuz1=vbuxx_plus_vbuyy -txa -sty $ff -clc -adc $ff -sta {z1} -//FRAGMENT vbuz1=vbuyy_plus_vbuyy -tya -asl -sta {z1} -//FRAGMENT vbuaa=vbuz1_plus_vbuyy -tya -clc -adc {z1} -//FRAGMENT vbuaa=vbuaa_plus_vbuyy -sty $ff -clc -adc $ff -//FRAGMENT vbuaa=vbuxx_plus_vbuyy -txa -sty $ff -clc -adc $ff -//FRAGMENT vbuaa=vbuyy_plus_vbuyy -tya -asl -//FRAGMENT vbuxx=vbuz1_plus_vbuyy -tya -clc -adc {z1} -tax -//FRAGMENT vbuxx=vbuaa_plus_vbuyy -sty $ff -clc -adc $ff -tax -//FRAGMENT vbuxx=vbuxx_plus_vbuyy -txa -sty $ff -clc -adc $ff -tax -//FRAGMENT vbuxx=vbuyy_plus_vbuyy -tya -asl -tax -//FRAGMENT vbuyy=vbuz1_plus_vbuyy -tya -clc -adc {z1} -tay -//FRAGMENT vbuyy=vbuaa_plus_vbuyy -sty $ff -clc -adc $ff -tay -//FRAGMENT vbuyy=vbuxx_plus_vbuyy -txa -sty $ff -clc -adc $ff -tay -//FRAGMENT vbuyy=vbuyy_plus_vbuyy -tya -asl -tay -//FRAGMENT vbuaa_eq_0_then_la1 -cmp #0 -beq {la1} -//FRAGMENT vbuz1=pbuc1_derefidx_vbuyy -lda {c1},y -sta {z1} -//FRAGMENT vbuaa=pbuc1_derefidx_vbuxx -lda {c1},x -//FRAGMENT vbuaa=pbuc1_derefidx_vbuyy -lda {c1},y -//FRAGMENT vbuaa=_deref_pbuz1_band_vbuc1 -lda #{c1} -ldy #0 -and ({z1}),y -//FRAGMENT vbuxx=_deref_pbuz1_band_vbuc1 -lda #{c1} -ldy #0 -and ({z1}),y -tax -//FRAGMENT vbuyy=_deref_pbuz1_band_vbuc1 -lda #{c1} -ldy #0 -and ({z1}),y -tay -//FRAGMENT vbuz1=vbuaa_ror_4 -lsr -lsr -lsr -lsr -sta {z1} -//FRAGMENT vbuz1=vbuxx_ror_4 -txa -lsr -lsr -lsr -lsr -sta {z1} -//FRAGMENT vbuz1=vbuyy_ror_4 -tya -lsr -lsr -lsr -lsr -sta {z1} -//FRAGMENT vbuaa=vbuz1_ror_4 -lda {z1} -lsr -lsr -lsr -lsr -//FRAGMENT vbuaa=vbuaa_ror_4 -lsr -lsr -lsr -lsr -//FRAGMENT vbuaa=vbuxx_ror_4 -txa -lsr -lsr -lsr -lsr -//FRAGMENT vbuaa=vbuyy_ror_4 -tya -lsr -lsr -lsr -lsr -//FRAGMENT vbuxx=vbuz1_ror_4 -lda {z1} -lsr -lsr -lsr -lsr -tax -//FRAGMENT vbuxx=vbuaa_ror_4 -lsr -lsr -lsr -lsr -tax -//FRAGMENT vbuxx=vbuyy_ror_4 -tya -lsr -lsr -lsr -lsr -tax -//FRAGMENT vbuyy=vbuz1_ror_4 -lda {z1} -lsr -lsr -lsr -lsr -tay -//FRAGMENT vbuyy=vbuaa_ror_4 -lsr -lsr -lsr -lsr -tay -//FRAGMENT vbuyy=vbuxx_ror_4 -txa -lsr -lsr -lsr -lsr -tay -//FRAGMENT vbuyy=vbuyy_ror_4 -tya -lsr -lsr -lsr -lsr -tay -//FRAGMENT vbuz1=vbuaa_ror_6 -rol -rol -rol -and #$03 -sta {z1} -//FRAGMENT vbuz1=vbuxx_ror_6 -txa -rol -rol -rol -and #$03 -sta {z1} -//FRAGMENT vbuz1=vbuyy_ror_6 -tya -rol -rol -rol -and #$03 -sta {z1} -//FRAGMENT vbuaa=vbuz1_ror_6 -lda {z1} -rol -rol -rol -and #$03 -//FRAGMENT vbuaa=vbuaa_ror_6 -rol -rol -rol -and #$03 -//FRAGMENT vbuaa=vbuxx_ror_6 -txa -rol -rol -rol -and #$03 -//FRAGMENT vbuaa=vbuyy_ror_6 -tya -rol -rol -rol -and #$03 -//FRAGMENT vbuxx=vbuz1_ror_6 -lda {z1} -rol -rol -rol -and #$03 -tax -//FRAGMENT vbuxx=vbuaa_ror_6 -rol -rol -rol -and #$03 -tax -//FRAGMENT vbuxx=vbuxx_ror_6 -txa -rol -rol -rol -and #$03 -tax -//FRAGMENT vbuxx=vbuyy_ror_6 -tya -rol -rol -rol -and #$03 -tax -//FRAGMENT vbuyy=vbuz1_ror_6 -lda {z1} -rol -rol -rol -and #$03 -tay -//FRAGMENT vbuyy=vbuaa_ror_6 -rol -rol -rol -and #$03 -tay -//FRAGMENT vbuyy=vbuxx_ror_6 -txa -rol -rol -rol -and #$03 -tay -//FRAGMENT vbuyy=vbuyy_ror_6 -tya -rol -rol -rol -and #$03 -tay -//FRAGMENT pbuz1=pbuz2_plus_pwuc1_derefidx_vbuaa -tay -clc -lda {z2} -adc {c1},y -sta {z1} -lda {z2}+1 -adc {c1}+1,y -sta {z1}+1 -//FRAGMENT pbuz1=pbuz2_plus_pwuc1_derefidx_vbuxx -clc -lda {z2} -adc {c1},x -sta {z1} -lda {z2}+1 -adc {c1}+1,x -sta {z1}+1 -//FRAGMENT pbuz1=pbuz2_plus_pwuc1_derefidx_vbuyy -clc -lda {z2} -adc {c1},y -sta {z1} -lda {z2}+1 -adc {c1}+1,y -sta {z1}+1 -//FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_rol_1 -ldy {z1} -lda {c1},y -asl -//FRAGMENT vbuxx=pbuc1_derefidx_vbuz1_rol_1 -ldx {z1} -lda {c1},x -asl -tax -//FRAGMENT vbuyy=pbuc1_derefidx_vbuz1_rol_1 -ldy {z1} -lda {c1},y -asl -tay -//FRAGMENT pbuz1=pbuz2_plus_vbuaa -clc -adc {z2} -sta {z1} -lda #0 -adc {z2}+1 -sta {z1}+1 -//FRAGMENT pbuz1=pbuz2_plus_vbuxx -txa -clc -adc {z2} -sta {z1} -lda #0 -adc {z2}+1 -sta {z1}+1 -//FRAGMENT pbuz1=pbuz2_plus_vbuyy -tya -clc -adc {z2} -sta {z1} -lda #0 -adc {z2}+1 -sta {z1}+1 -//FRAGMENT _deref_pbuc1_neq_pbuc2_derefidx_vbuaa_then_la1 -tay -lda {c1} -cmp {c2},y -bne {la1} -//FRAGMENT _deref_pbuc1_neq_pbuc2_derefidx_vbuxx_then_la1 -lda {c2},x -cmp {c1} -bne {la1} -//FRAGMENT _deref_pbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 -lda {c1} -cmp {c2},y -bne {la1} -//FRAGMENT vbuaa=_lo_vwuz1 -lda {z1} -//FRAGMENT vbuxx=_lo_vwuz1 -ldx {z1} //FRAGMENT vbuaa=pbuc1_derefidx_vbuz1_rol_4 ldy {z1} lda {c1},y @@ -2406,6 +2586,22 @@ tax tya ora {c1},x tay +//FRAGMENT _deref_pbuc1_neq_pbuc2_derefidx_vbuaa_then_la1 +tay +lda {c1} +cmp {c2},y +bne {la1} +//FRAGMENT _deref_pbuc1_neq_pbuc2_derefidx_vbuxx_then_la1 +lda {c2},x +cmp {c1} +bne {la1} +//FRAGMENT _deref_pbuc1_neq_pbuc2_derefidx_vbuyy_then_la1 +lda {c1} +cmp {c2},y +bne {la1} +//FRAGMENT vbuxx=vbuz1_minus_1 +ldx {z1} +dex //FRAGMENT vbuxx=vbuxx_rol_vbuz1 txa ldx {z1} @@ -2546,38 +2742,6 @@ tay tya and {c1} tay -//FRAGMENT vbuz1=vbuaa_bor_vbuxx -stx $ff -ora $ff -sta {z1} -//FRAGMENT vbuaa=vbuaa_bor_vbuxx -stx $ff -ora $ff -//FRAGMENT vbuxx=vbuaa_bor_vbuxx -stx $ff -ora $ff -tax -//FRAGMENT vbuyy=vbuaa_bor_vbuxx -stx $ff -ora $ff -tay -//FRAGMENT vbuz1=vbuxx_bor_vbuz2 -txa -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuxx_bor_vbuxx -stx {z1} -//FRAGMENT vbuxx=vbuz1_minus_1 -ldx {z1} -dex -//FRAGMENT vbuaa=_lo__deref_pwuc1 -lda {c1} -//FRAGMENT vbuxx=_lo__deref_pwuc1 -ldx {c1} -//FRAGMENT vbuaa=_hi__deref_pwuc1 -lda {c1}+1 -//FRAGMENT vbuxx=_hi__deref_pwuc1 -ldx {c1}+1 //FRAGMENT vbuz1_le_vbuxx_then_la1 cpx {z1} bcs {la1} @@ -2651,54 +2815,10 @@ ldy {z1} sty {c1} //FRAGMENT vbuyy=_hi_pvoz1 ldy {z1}+1 -//FRAGMENT vbuyy=_lo__deref_pwuc1 -ldy {c1} -//FRAGMENT vbuyy=_hi__deref_pwuc1 -ldy {c1}+1 //FRAGMENT vbuyy=vbuz1 ldy {z1} //FRAGMENT vbuyy=_lo_pbuz1 ldy {z1} -//FRAGMENT vbuz1=vbuyy_bor_vbuz2 -tya -ora {z2} -sta {z1} -//FRAGMENT vbuz1=vbuyy_bor_vbuxx -txa -sty $ff -ora $ff -sta {z1} -//FRAGMENT vbuaa=vbuxx_bor_vbuz1 -txa -ora {z1} -//FRAGMENT vbuaa=vbuyy_bor_vbuz1 -tya -ora {z1} -//FRAGMENT vbuaa=vbuyy_bor_vbuxx -txa -sty $ff -ora $ff -//FRAGMENT vbuxx=vbuxx_bor_vbuz1 -txa -ora {z1} -tax -//FRAGMENT vbuxx=vbuyy_bor_vbuz1 -tya -ora {z1} -tax -//FRAGMENT vbuxx=vbuyy_bor_vbuxx -txa -sty $ff -ora $ff -tax -//FRAGMENT vbuz1=vbuyy -sty {z1} -//FRAGMENT 0_neq_vbuxx_then_la1 -cpx #0 -bne {la1} -//FRAGMENT 0_neq_vbuyy_then_la1 -cpy #0 -bne {la1} //FRAGMENT vbuxx=vbuc1 ldx #{c1} //FRAGMENT vbuz1=vbuxx_minus_1 @@ -2718,6 +2838,16 @@ dey txa tay dey +//FRAGMENT vbuz1=vbuyy +sty {z1} +//FRAGMENT 0_neq_vbuxx_then_la1 +cpx #0 +bne {la1} +//FRAGMENT 0_neq_vbuyy_then_la1 +cpy #0 +bne {la1} +//FRAGMENT vbuyy=_lo_vwuz1 +ldy {z1} //FRAGMENT vbuyy=_hi_vwuz1 ldy {z1}+1 //FRAGMENT vbuxx_eq_0_then_la1 @@ -2742,40 +2872,38 @@ dex //FRAGMENT vbsxx=vbsxx_minus_2 dex dex -//FRAGMENT vbuaa=vbuc1 -lda #{c1} -//FRAGMENT vbuxx=vbuyy -tya -tax -//FRAGMENT vbuyy=_lo_vwuz1 -ldy {z1} //FRAGMENT vbuaa=vbuxx txa //FRAGMENT vbuaa=vbuyy tya +//FRAGMENT vbuxx=vbuyy +tya +tax //FRAGMENT vbuyy=vbuxx txa tay -//FRAGMENT vbuxx=vbuaa -tax -//FRAGMENT vbuyy=vbuaa -tay +//FRAGMENT vbuyy_neq_0_then_la1 +cpy #0 +bne {la1} +//FRAGMENT vbuyy=vbuyy_plus_2 +iny +iny +//FRAGMENT vbuyy=vbuyy_plus_1 +iny +//FRAGMENT vbuaa=vbuc1 +lda #{c1} //FRAGMENT 0_eq_vbuxx_then_la1 cpx #0 beq {la1} //FRAGMENT 0_eq_vbuyy_then_la1 cpy #0 beq {la1} -//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx -lda {c1},x -tax -//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy -ldx {c1},y -//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx -ldy {c1},x -//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy -lda {c1},y -tay +//FRAGMENT pbuc1_derefidx_vbuxx=vbuz1 +lda {z1} +sta {c1},x +//FRAGMENT pbuc1_derefidx_vbuyy=vbuz1 +lda {z1} +sta {c1},y //FRAGMENT pbuc1_derefidx_vbuxx=vbuaa sta {c1},x //FRAGMENT pbuc1_derefidx_vbuyy=vbuaa @@ -2787,10 +2915,6 @@ sta {c1},y //FRAGMENT pbuc1_derefidx_vbuyy=vbuxx txa sta {c1},y -//FRAGMENT pbuc1_derefidx_vbuz1=vbuyy -tya -ldy {z1} -sta {c1},y //FRAGMENT pbuc1_derefidx_vbuaa=vbuyy tax tya @@ -2798,22 +2922,78 @@ sta {c1},x //FRAGMENT pbuc1_derefidx_vbuxx=vbuyy tya sta {c1},x +//FRAGMENT vbuxx=pbuc1_derefidx_vbuxx +lda {c1},x +tax +//FRAGMENT vbuxx=pbuc1_derefidx_vbuyy +ldx {c1},y +//FRAGMENT vbuyy=pbuc1_derefidx_vbuxx +ldy {c1},x +//FRAGMENT vbuyy=pbuc1_derefidx_vbuyy +lda {c1},y +tay +//FRAGMENT vbuxx=vbuaa +tax +//FRAGMENT vbuyy=vbuaa +tay +//FRAGMENT vbuz1=vbuyy_bor_vbuxx +txa +sty $ff +ora $ff +sta {z1} +//FRAGMENT vbuaa=_inc_vbuaa +inc +//FRAGMENT vbuyy_lt_vbuz1_then_la1 +cpy {z1} +bcc {la1} +//FRAGMENT vbuyy=_deref_pbuc1 +ldy {c1} +//FRAGMENT vbuyy_eq_vbuc1_then_la1 +cpy #{c1} +beq {la1} //FRAGMENT vbuz1=vbuyy_bor_vbuaa sty $ff ora $ff sta {z1} +//FRAGMENT vwuz1=vwuz1_band_vbuc1 +lda #{c1} +and {z1} +sta {z1} +lda #0 +sta {z1}+1 //FRAGMENT vduz1=vduz1_ror_1 lsr {z1}+3 ror {z1}+2 ror {z1}+1 ror {z1} -//FRAGMENT vwuz1=vwuz1_bxor_vwuz2 +//FRAGMENT pbuz1=pbuz2_plus_vwuz1 lda {z1} -eor {z2} +clc +adc {z2} sta {z1} lda {z1}+1 -eor {z2}+1 +adc {z2}+1 sta {z1}+1 +//FRAGMENT vbuz1=vbuz1_rol_4 +lda {z1} +asl +asl +asl +asl +sta {z1} +//FRAGMENT vduz1=vduz1_plus_vbuaa +clc +adc {z1} +sta {z1} +lda {z1}+1 +adc #0 +sta {z1}+1 +lda {z1}+2 +adc #0 +sta {z1}+2 +lda {z1}+3 +adc #0 +sta {z1}+3 //FRAGMENT pbuz1=pbuc1_plus_vwuz1 clc lda {z1} @@ -2839,6 +3019,13 @@ bne !- //FRAGMENT vbuz1=vbuz1_bor_vbuaa ora {z1} sta {z1} +//FRAGMENT pbuz1=pbuz1_plus_vbuaa +clc +adc {z1} +sta {z1} +bcc !+ +inc {z1}+1 +!: //FRAGMENT pwuz1=pwuc1_plus_vwuz1 clc lda {z1} @@ -2855,647 +3042,13 @@ sta {z1} lda {z1}+1 adc #>{c1} sta {z1}+1 -//FRAGMENT pbuz1=pbuz1_plus_vbuaa -clc -adc {z1} -sta {z1} -bcc !+ -inc {z1}+1 -!: -//FRAGMENT pbuz1=pbuz2_plus_vwuz1 +//FRAGMENT vwuz1=vwuz1_bxor_vwuz2 lda {z1} -clc -adc {z2} +eor {z2} sta {z1} lda {z1}+1 -adc {z2}+1 +eor {z2}+1 sta {z1}+1 -//FRAGMENT _deref_pbuz1=vbuc1 -lda #{c1} -ldy #0 -sta ({z1}),y -//FRAGMENT pbuc1_derefidx_vbuaa=vbuc2 -tay -lda #{c2} -sta {c1},y -//FRAGMENT pbuc1_derefidx_vbuyy=vbuc2 -lda #{c2} -sta {c1},y -//FRAGMENT vwuz1_eq_vwuc1_then_la1 -lda {z1} -cmp #<{c1} -bne !+ -lda {z1}+1 -cmp #>{c1} -beq {la1} -!: -//FRAGMENT _deref_pbuz1=_deref_pbuz1_bor_vbuz2 -lda {z2} -ldy #0 -ora ({z1}),y -ldy #0 -sta ({z1}),y -//FRAGMENT _deref_pbuz1=_deref_pbuz1_bor_vbuxx -txa -ldy #0 -ora ({z1}),y -ldy #0 -sta ({z1}),y -//FRAGMENT vduz1=vwuc1 -NO_SYNTHESIS -//FRAGMENT vduz1=vwsc1 -NO_SYNTHESIS -//FRAGMENT vbuz1=vbuz1_plus_vbuc1 -lda #{c1} -clc -adc {z1} -sta {z1} -//FRAGMENT vwuz1=_inc_vwuz2 -clc -lda {z2} -adc #1 -sta {z1} -lda {z2}+1 -adc #0 -sta {z1}+1 -//FRAGMENT vwuz1=vwuz2_band_vbuc1 -lda #{c1} -and {z2} -sta {z1} -lda #0 -sta {z1}+1 -//FRAGMENT pbuz1_neq_pbuc1_then_la1 -lda {z1}+1 -cmp #>{c1} -bne {la1} -lda {z1} -cmp #<{c1} -bne {la1} -//FRAGMENT _deref_pbuc1=_deref_pbuz1 -ldy #0 -lda ({z1}),y -sta {c1} -//FRAGMENT vduz1=_deref_pduc1 -lda {c1} -sta {z1} -lda {c1}+1 -sta {z1}+1 -lda {c1}+2 -sta {z1}+2 -lda {c1}+3 -sta {z1}+3 -//FRAGMENT vwuz1=vwuc1_rol_vbuz2 -ldy {z2} -lda #<{c1} -sta {z1} -lda #>{c1}+1 -sta {z1}+1 -cpy #0 -beq !e+ -!: -asl {z1} -rol {z1}+1 -dey -bne !- -!e: -//FRAGMENT vduz1=vduz2_plus_vwuz3 -lda {z2} -clc -adc {z3} -sta {z1} -lda {z2}+1 -adc {z3}+1 -sta {z1}+1 -lda {z2}+2 -adc #0 -sta {z1}+2 -lda {z2}+3 -adc #0 -sta {z1}+3 -//FRAGMENT vduz1=vduz2_plus_vbuz3 -lda {z3} -clc -adc {z2} -sta {z1} -lda {z2}+1 -adc #0 -sta {z1}+1 -lda {z2}+2 -adc #0 -sta {z1}+2 -lda {z2}+3 -adc #0 -sta {z1}+3 -//FRAGMENT vbuxx=vbuxx_plus_vbuc1 -txa -clc -adc #{c1} -tax -//FRAGMENT vbuyy=vbuyy_plus_vbuc1 -tya -clc -adc #{c1} -tay -//FRAGMENT vbuaa_eq_vbuc1_then_la1 -cmp #{c1} -beq {la1} -//FRAGMENT vbuaa_neq_vbuc1_then_la1 -cmp #{c1} -bne {la1} -//FRAGMENT vwuz1=vwuc1_rol_vbuaa -tay -lda #<{c1} -sta {z1} -lda #>{c1}+1 -sta {z1}+1 -cpy #0 -beq !e+ -!: -asl {z1} -rol {z1}+1 -dey -bne !- -!e: -//FRAGMENT vwuz1=vwuc1_rol_vbuxx -lda #<{c1} -sta {z1} -lda #>{c1}+1 -sta {z1}+1 -cpx #0 -beq !e+ -!: -asl {z1} -rol {z1}+1 -dex -bne !- -!e: -//FRAGMENT vwuz1=vwuc1_rol_vbuyy -lda #<{c1} -sta {z1} -lda #>{c1}+1 -sta {z1}+1 -cpy #0 -beq !e+ -!: -asl {z1} -rol {z1}+1 -dey -bne !- -!e: -//FRAGMENT vbuz1=vbuaa_bor_vbuyy -sty $ff -ora $ff -sta {z1} -//FRAGMENT vbuaa=vbuaa_bor_vbuyy -sty $ff -ora $ff -//FRAGMENT vbuxx=vbuaa_bor_vbuyy -sty $ff -ora $ff -tax -//FRAGMENT vbuyy=vbuaa_bor_vbuyy -sty $ff -ora $ff -tay -//FRAGMENT vbuyy=vbuxx_bor_vbuz1 -txa -ora {z1} -tay -//FRAGMENT vbuyy=vbuyy_bor_vbuz1 -tya -ora {z1} -tay -//FRAGMENT vwuz1=_word_vbuyy -tya -sta {z1} -lda #0 -sta {z1}+1 -//FRAGMENT vwuz1=vwuz2_rol_vbuxx -lda {z2} -sta {z1} -lda {z2}+1 -sta {z1}+1 -cpx #0 -beq !e+ -!: -asl {z1} -rol {z1}+1 -dex -bne !- -!e: -//FRAGMENT vwuz1=vwuz2_rol_vbuyy -lda {z2} -sta {z1} -lda {z2}+1 -sta {z1}+1 -cpy #0 -beq !e+ -!: -asl {z1} -rol {z1}+1 -dey -bne !- -!e: -//FRAGMENT vduz1=vduz2_plus_vbuaa -clc -adc {z2} -sta {z1} -lda {z2}+1 -adc #0 -sta {z1}+1 -lda {z2}+2 -adc #0 -sta {z1}+2 -lda {z2}+3 -adc #0 -sta {z1}+3 -//FRAGMENT vduz1=vduz2_plus_vbuxx -txa -clc -adc {z2} -sta {z1} -lda {z2}+1 -adc #0 -sta {z1}+1 -lda {z2}+2 -adc #0 -sta {z1}+2 -lda {z2}+3 -adc #0 -sta {z1}+3 -//FRAGMENT vduz1=vduz2_plus_vbuyy -tya -clc -adc {z2} -sta {z1} -lda {z2}+1 -adc #0 -sta {z1}+1 -lda {z2}+2 -adc #0 -sta {z1}+2 -lda {z2}+3 -adc #0 -sta {z1}+3 -//FRAGMENT vbuz1=vbuaa_bor_vbuc1 -ora #{c1} -sta {z1} -//FRAGMENT vbuz1=vbuyy_bor_vbuc1 -tya -ora #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuyy_bor_vbuc1 -tya -ora #{c1} -//FRAGMENT vbuxx=vbuaa_bor_vbuc1 -ora #{c1} -tax -//FRAGMENT vbuxx=vbuyy_bor_vbuc1 -tya -ora #{c1} -tax -//FRAGMENT vbuyy=vbuaa_bor_vbuc1 -ora #{c1} -tay -//FRAGMENT vbuaa=_inc_vbuaa -inc -//FRAGMENT vbuyy_lt_vbuz1_then_la1 -cpy {z1} -bcc {la1} -//FRAGMENT vbuyy=_deref_pbuc1 -ldy {c1} -//FRAGMENT vbuyy_eq_vbuc1_then_la1 -cpy #{c1} -beq {la1} -//FRAGMENT vwuz1=vwuz1_band_vbuc1 -lda #{c1} -and {z1} -sta {z1} -lda #0 -sta {z1}+1 -//FRAGMENT vduz1=vduz1_plus_vbuaa -clc -adc {z1} -sta {z1} -lda {z1}+1 -adc #0 -sta {z1}+1 -lda {z1}+2 -adc #0 -sta {z1}+2 -lda {z1}+3 -adc #0 -sta {z1}+3 //FRAGMENT vbuz1=vbuaa_bor_vbuz1 ora {z1} sta {z1} -//FRAGMENT vbuz1=vbuz1_plus_2 -lda {z1} -clc -adc #2 -sta {z1} -//FRAGMENT vbuxx=vbuxx_plus_2 -inx -inx -//FRAGMENT vbuz1=vbuz1_plus_1 -inc {z1} -//FRAGMENT vduz1=vbuc1 -lda #{c1} -sta {z1} -lda #0 -sta {z1}+1 -sta {z1}+2 -sta {z1}+3 -//FRAGMENT pbuc1_derefidx_vbuz1=pbuc1_derefidx_vbuz1_plus_1 -ldy {z1} -lda {c1},y -inc -sta {c1},y -//FRAGMENT vwuz1=vwuz1_plus_vwuc1 -clc -lda {z1} -adc #<{c1} -sta {z1} -lda {z1}+1 -adc #>{c1} -sta {z1}+1 -//FRAGMENT vbuz1=_bnot__deref_pbuc1 -lda {c1} -eor #$ff -sta {z1} -//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuz1 -lda {c1} -and {z1} -sta {c1} -//FRAGMENT pbuc1_derefidx_vbuaa=pbuc1_derefidx_vbuaa_plus_1 -tay -lda {c1},y -inc -sta {c1},y -//FRAGMENT pbuc1_derefidx_vbuxx=pbuc1_derefidx_vbuxx_plus_1 -lda {c1},x -inc -sta {c1},x -//FRAGMENT pbuc1_derefidx_vbuyy=pbuc1_derefidx_vbuyy_plus_1 -lda {c1},y -inc -sta {c1},y -//FRAGMENT vbuaa=_bnot__deref_pbuc1 -lda {c1} -eor #$ff -//FRAGMENT vbuxx=_bnot__deref_pbuc1 -lda {c1} -eor #$ff -tax -//FRAGMENT vbuyy=_bnot__deref_pbuc1 -lda {c1} -eor #$ff -tay -//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuaa -and {c1} -sta {c1} -//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuxx -txa -and {c1} -sta {c1} -//FRAGMENT _deref_pbuc1=_deref_pbuc1_band_vbuyy -tya -and {c1} -sta {c1} -//FRAGMENT vbuyy_neq_0_then_la1 -cpy #0 -bne {la1} -//FRAGMENT vwuz1=vwuz1_plus_vbuc1 -lda #{c1} -clc -adc {z1} -sta {z1} -bcc !+ -inc {z1}+1 -!: -//FRAGMENT vbsyy=pbsc1_derefidx_vbuz1 -ldx {z1} -ldy {c1},x -//FRAGMENT vbuxx=vbuxx_plus_1 -inx -//FRAGMENT vbuyy=vbuyy_plus_1 -iny -//FRAGMENT vbuz1=vbuz1_rol_4 -lda {z1} -asl -asl -asl -asl -sta {z1} -//FRAGMENT pbuz1=_ptr_vbuz2 -lda {z2} -sta {z1} -lda #0 -sta {z1}+1 -//FRAGMENT pbuz1=_ptr_vbuaa -sta {z1} -lda #0 -sta {z1}+1 -//FRAGMENT pbuz1=_ptr_vbuxx -stx {z1} -ldx #0 -stx {z1}+1 -//FRAGMENT _deref_pbuz1=pbuc1_derefidx_vbuz2 -ldy {z2} -lda {c1},y -ldy #0 -sta ({z1}),y -//FRAGMENT pbuz1=_inc_pbuz2 -clc -lda {z2} -adc #1 -sta {z1} -lda {z2}+1 -adc #0 -sta {z1}+1 -//FRAGMENT vbuz1_ge_vbuz2_then_la1 -lda {z1} -cmp {z2} -bcs {la1} -//FRAGMENT vbuz1=vbuz1_minus_vbuz2 -lda {z1} -sec -sbc {z2} -sta {z1} -//FRAGMENT vbuaa_lt_vbuc1_then_la1 -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 vbuaa_ge_vbuz1_then_la1 -cmp {z1} -bcs {la1} -//FRAGMENT vbuxx=vbuxx_minus_vbuz1 -txa -sec -sbc {z1} -tax -//FRAGMENT vbuz1=vbuz1_minus_vbuaa -eor #$ff -sec -adc {z1} -sta {z1} -//FRAGMENT vbuxx=vbuxx_minus_vbuaa -sta $ff -txa -sec -sbc $ff -tax -//FRAGMENT vbuz1=vbuz1_minus_vbuxx -txa -eor #$ff -sec -adc {z1} -sta {z1} -//FRAGMENT vbuxx=vbuxx_minus_vbuxx -lda #0 -tax -//FRAGMENT vbuz1=vbuz1_minus_vbuyy -tya -eor #$ff -sec -adc {z1} -sta {z1} -//FRAGMENT vbuxx=vbuxx_minus_vbuyy -txa -sty $ff -sec -sbc $ff -tax -//FRAGMENT vbuxx_ge_vbuz1_then_la1 -cpx {z1} -bcs {la1} -//FRAGMENT vbuz1_ge_vbuxx_then_la1 -lda {z1} -stx $ff -cmp $ff -bcs {la1} -//FRAGMENT vbuz1_ge_vbuyy_then_la1 -lda {z1} -sty $ff -cmp $ff -bcs {la1} -//FRAGMENT vbuxx_ge_vbuyy_then_la1 -sty $ff -cpx $ff -bcs {la1} -//FRAGMENT vbuyy_ge_vbuz1_then_la1 -cpy {z1} -bcs {la1} -//FRAGMENT vbuz1=vbuz2_minus_vbuc1 -lda {z2} -sec -sbc #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuz1_minus_vbuc1 -lda {z1} -sec -sbc #{c1} -//FRAGMENT vbuxx=vbuz1_minus_vbuc1 -lda {z1} -sec -sbc #{c1} -tax -//FRAGMENT vbuyy=vbuz1_minus_vbuc1 -lda {z1} -sec -sbc #{c1} -tay -//FRAGMENT vbuz1=vbuaa_minus_vbuc1 -sec -sbc #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuaa_minus_vbuc1 -sec -sbc #{c1} -//FRAGMENT vbuxx=vbuaa_minus_vbuc1 -sec -sbc #{c1} -tax -//FRAGMENT vbuyy=vbuaa_minus_vbuc1 -sec -sbc #{c1} -tay -//FRAGMENT vbuz1=vbuxx_minus_vbuc1 -txa -sec -sbc #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuxx_minus_vbuc1 -txa -sec -sbc #{c1} -//FRAGMENT vbuxx=vbuxx_minus_vbuc1 -txa -sec -sbc #{c1} -tax -//FRAGMENT vbuyy=vbuxx_minus_vbuc1 -txa -sec -sbc #{c1} -tay -//FRAGMENT vbuz1=vbuyy_minus_vbuc1 -tya -sec -sbc #{c1} -sta {z1} -//FRAGMENT vbuaa=vbuyy_minus_vbuc1 -tya -sec -sbc #{c1} -//FRAGMENT vbuxx=vbuyy_minus_vbuc1 -tya -sec -sbc #{c1} -tax -//FRAGMENT vbuyy=vbuyy_minus_vbuc1 -tya -sec -sbc #{c1} -tay -//FRAGMENT vwuz1_neq_vbuc1_then_la1 -NO_SYNTHESIS -//FRAGMENT vwuz1_neq_vbsc1_then_la1 -NO_SYNTHESIS -//FRAGMENT pbuc1_derefidx_vbuaa=vbuaa -tax -sta {c1},x -//FRAGMENT _deref_pwuc1=vwuz1 -lda {z1} -sta {c1} -lda {z1}+1 -sta {c1}+1 -//FRAGMENT _deref_pbuc1=_byte_vwuz1 -lda {z1} -sta {c1} -//FRAGMENT _deref_pduc1=vduz1 -lda {z1} -sta {c1} -lda {z1}+1 -sta {c1}+1 -lda {z1}+2 -sta {c1}+2 -lda {z1}+3 -sta {c1}+3 -//FRAGMENT _deref_pwuc1=vbuc2 -lda #0 -sta {c1}+1 -lda #<{c2} -sta {c1} diff --git a/src/test/kc/examples/cx16/cx16-vera.c b/src/test/kc/examples/cx16/cx16-vera.c index 749a86c9e..c353ed2b6 100644 --- a/src/test/kc/examples/cx16/cx16-vera.c +++ b/src/test/kc/examples/cx16/cx16-vera.c @@ -74,25 +74,25 @@ void main() { text_8_x_8_1BPP_16_color(); break; case 66: - //text_8_x_8_1BPP_256_color(); + text_8_x_8_1BPP_256_color(); break; case 67: tile_8_x_8_2BPP_4_color(); break; case 68: - //tile_16_x_16_2BPP_4_color(); + tile_16_x_16_2BPP_4_color(); break; case 69: - //tile_8_x_8_4BPP_16_color(); + tile_8_x_8_4BPP_16_color(); break; case 70: - //tile_16_x_16_4BPP_16_color(); + tile_16_x_16_4BPP_16_color(); break; case 71: - //tile_8_x_8_8BPP_256_color(); + tile_8_x_8_8BPP_256_color(); break; case 72: - //tile_16_x_16_8BPP_256_color(); + tile_16_x_16_8BPP_256_color(); break; }