1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-04-14 10:37:36 +00:00

Added a few missing fragments. Improved fragments for if() where rvalue1==0. Closes

This commit is contained in:
jespergravgaard 2020-12-12 00:48:31 +01:00
parent df62ca5c9f
commit 7c995f82a1
206 changed files with 7505 additions and 7186 deletions
.idea/codeStyles
src
main
test/ref
32bit-rols.asm32bit-rols.log
adventofcode
arrays-init-short.logatarixl-md5.asmatarixl-md5.logatarixl-md5b.logatoi-1.logbitmap-line-anim-2.logbitmap-plot-0.asmbitmap-plot-0.logbitmap-plot-1.asmbitmap-plot-1.logbitmap-plot-2.asmbitmap-plot-2.logbitmap-plot-3.logbool-not-operator-2.logc-types.logc64dtv-gfxexplorer.logc64dtv-gfxmodes.logcasting-negative.logcirclechars.log
complex
condition-integer-0.asmcondition-integer-0.logcondition-integer-1.asmcondition-integer-1.logcondition-integer-2.asmcondition-integer-2.logcondition-integer-3.logcondition-integer-4.asmcondition-integer-4.logconstants.logcordic-atan2-16-ref.logcordic-atan2-16.logcordic-atan2-clear.logcordic-atan2.asmcordic-atan2.logcpu-65ce02-eightqueens.asmcpu-65ce02-eightqueens.log
examples
fastmultiply-127.logfunction-pointer-noarg-call-10.logfunction-pointer-noarg-call-14.logfunction-pointer-noarg-call-7.log

@ -4,6 +4,24 @@
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
<option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
</JetCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="SPACE_BEFORE_IF_PARENTHESES" value="false" />
<option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" />

@ -1,4 +1,244 @@
//KICKC FRAGMENT CACHE 129161168d 129161348a
//KICKC FRAGMENT CACHE 140bf2a915 140bf2c716
//FRAGMENT vbuzz=vbuc1
ldz #{c1}
//FRAGMENT vbuzz_lt_vbuc1_then_la1
cpz #{c1}
bcc {la1}
//FRAGMENT pbuc1_derefidx_vbuzz=vbuzz
tza
tax
sta {c1},x
//FRAGMENT vbuzz=_inc_vbuzz
inz
//FRAGMENT vbsz1=_deref_pbsc1
lda {c1}
sta {z1}
//FRAGMENT vbsz1=_neg_vbsz2
lda {z2}
neg
sta {z1}
//FRAGMENT _deref_pbsc1=vbsz1
lda {z1}
sta {c1}
//FRAGMENT vbsz1=vbsz2_ror_2
lda {z2}
asr
asr
sta {z1}
//FRAGMENT vbsaa=_deref_pbsc1
lda {c1}
//FRAGMENT vbsxx=_deref_pbsc1
ldx {c1}
//FRAGMENT vbsz1=_neg_vbsaa
neg
sta {z1}
//FRAGMENT vbsz1=_neg_vbsxx
txa
neg
sta {z1}
//FRAGMENT vbsz1=_neg_vbsyy
tya
neg
sta {z1}
//FRAGMENT vbsz1=_neg_vbszz
tza
neg
sta {z1}
//FRAGMENT vbsaa=_neg_vbsz1
lda {z1}
neg
//FRAGMENT vbsaa=_neg_vbsaa
neg
//FRAGMENT vbsaa=_neg_vbsxx
txa
neg
//FRAGMENT vbsaa=_neg_vbsyy
tya
neg
//FRAGMENT vbsaa=_neg_vbszz
tza
neg
//FRAGMENT vbsxx=_neg_vbsz1
lda {z1}
neg
tax
//FRAGMENT vbsxx=_neg_vbsaa
neg
tax
//FRAGMENT vbsxx=_neg_vbsxx
txa
neg
tax
//FRAGMENT vbsxx=_neg_vbsyy
tya
neg
tax
//FRAGMENT vbsxx=_neg_vbszz
tza
neg
tax
//FRAGMENT vbsyy=_neg_vbsz1
lda {z1}
neg
tay
//FRAGMENT vbsyy=_neg_vbsaa
neg
tay
//FRAGMENT vbsyy=_neg_vbsxx
txa
neg
tay
//FRAGMENT vbsyy=_neg_vbsyy
tya
neg
tay
//FRAGMENT vbsyy=_neg_vbszz
tza
neg
tay
//FRAGMENT vbszz=_neg_vbsz1
lda {z1}
neg
taz
//FRAGMENT vbszz=_neg_vbsaa
neg
taz
//FRAGMENT vbszz=_neg_vbsxx
txa
neg
taz
//FRAGMENT vbszz=_neg_vbsyy
tya
neg
taz
//FRAGMENT vbszz=_neg_vbszz
tza
neg
taz
//FRAGMENT _deref_pbsc1=vbsaa
sta {c1}
//FRAGMENT vbsz1=vbsaa_ror_2
asr
asr
sta {z1}
//FRAGMENT vbsz1=vbsxx_ror_2
txa
asr
asr
sta {z1}
//FRAGMENT vbsz1=vbsyy_ror_2
tya
asr
asr
sta {z1}
//FRAGMENT vbsz1=vbszz_ror_2
tza
asr
asr
sta {z1}
//FRAGMENT vbsaa=vbsz1_ror_2
lda {z1}
asr
asr
//FRAGMENT vbsaa=vbsaa_ror_2
asr
asr
//FRAGMENT vbsaa=vbsxx_ror_2
txa
asr
asr
//FRAGMENT vbsaa=vbsyy_ror_2
tya
asr
asr
//FRAGMENT vbsaa=vbszz_ror_2
tza
asr
asr
//FRAGMENT vbsxx=vbsz1_ror_2
lda {z1}
asr
asr
tax
//FRAGMENT vbsxx=vbsaa_ror_2
asr
asr
tax
//FRAGMENT vbsxx=vbsxx_ror_2
txa
asr
asr
tax
//FRAGMENT vbsxx=vbsyy_ror_2
tya
asr
asr
tax
//FRAGMENT vbsxx=vbszz_ror_2
tza
asr
asr
tax
//FRAGMENT vbsyy=vbsz1_ror_2
lda {z1}
asr
asr
tay
//FRAGMENT vbsyy=vbsaa_ror_2
asr
asr
tay
//FRAGMENT vbsyy=vbsxx_ror_2
txa
asr
asr
tay
//FRAGMENT vbsyy=vbsyy_ror_2
tya
asr
asr
tay
//FRAGMENT vbsyy=vbszz_ror_2
tza
asr
asr
tay
//FRAGMENT vbszz=vbsz1_ror_2
lda {z1}
asr
asr
taz
//FRAGMENT vbszz=vbsaa_ror_2
asr
asr
taz
//FRAGMENT vbszz=vbsxx_ror_2
txa
asr
asr
taz
//FRAGMENT vbszz=vbsyy_ror_2
tya
asr
asr
taz
//FRAGMENT vbszz=vbszz_ror_2
tza
asr
asr
taz
//FRAGMENT vbsyy=_deref_pbsc1
ldy {c1}
//FRAGMENT vbszz=_deref_pbsc1
lda {c1}
taz
//FRAGMENT _deref_pbsc1=vbsxx
stx {c1}
//FRAGMENT _deref_pbsc1=vbsyy
sty {c1}
//FRAGMENT _deref_pbsc1=vbszz
tza
sta {c1}
//FRAGMENT vbuz1=vbuc1
lda #{c1}
sta {z1}
@ -92,9 +332,9 @@ lda ({z2}),y
sta {z1}
//FRAGMENT pbuz1=_inc_pbuz1
inw {z1}
//FRAGMENT vbuc1_neq_vbuz1_then_la1
lda #{c1}
cmp {z1}
//FRAGMENT 0_neq_vbuz1_then_la1
lda {z1}
cmp #0
bne {la1}
//FRAGMENT _deref_pbuc1=vbuc2
lda #{c2}
@ -120,9 +360,9 @@ beq {la1}
ldy {z2}
lda {c1},y
sta {z1}
//FRAGMENT vbuc1_eq_vbuz1_then_la1
lda #{c1}
cmp {z1}
//FRAGMENT 0_eq_vbuz1_then_la1
lda {z1}
cmp #0
beq {la1}
//FRAGMENT vbuz1_eq_vbuc1_then_la1
lda #{c1}
@ -217,9 +457,9 @@ bpl {la1}
//FRAGMENT vbsz1=vbsc1
lda #{c1}
sta {z1}
//FRAGMENT vbsc1_neq_vbsz1_then_la1
lda #{c1}
cmp {z1}
//FRAGMENT 0_neq_vbsz1_then_la1
lda {z1}
cmp #0
bne {la1}
//FRAGMENT vbuz1=vbuz2_minus_1
ldx {z2}
@ -290,10 +530,10 @@ sta {z1}
lda {z1}+1
sbc {z2}+1
sta {z1}+1
//FRAGMENT vbuc1_neq__deref_pbuz1_then_la1
//FRAGMENT 0_neq__deref_pbuz1_then_la1
ldy #0
lda ({z1}),y
cmp #{c1}
cmp #0
bne {la1}
//FRAGMENT vwuz1=_inc_vwuz1
inw {z1}
@ -432,8 +672,8 @@ tay
ldy #0
lda ({z1}),y
taz
//FRAGMENT vbuc1_neq_vbuaa_then_la1
cmp #{c1}
//FRAGMENT 0_neq_vbuaa_then_la1
cmp #0
bne {la1}
//FRAGMENT vbuz1=vbuaa
sta {z1}
@ -461,8 +701,8 @@ ldy {c1},x
//FRAGMENT vbuzz=pbuc1_derefidx_vbuz1
ldx {z1}
ldz {c1},x
//FRAGMENT vbuc1_eq_vbuaa_then_la1
cmp #{c1}
//FRAGMENT 0_eq_vbuaa_then_la1
cmp #0
beq {la1}
//FRAGMENT vbuxx_eq_vbuc1_then_la1
cpx #{c1}
@ -624,15 +864,15 @@ lda {c1},y
sta {z1}
lda {c1}+1,y
sta {z1}+1
//FRAGMENT vbuc1_neq_vbuxx_then_la1
cpx #{c1}
//FRAGMENT 0_neq_vbuxx_then_la1
cpx #0
bne {la1}
//FRAGMENT vbsaa=_sbyte_vwuz1
lda {z1}
//FRAGMENT vbsxx=_sbyte_vwuz1
ldx {z1}
//FRAGMENT vbuc1_eq_vbuxx_then_la1
cpx #{c1}
//FRAGMENT 0_eq_vbuxx_then_la1
cpx #0
beq {la1}
//FRAGMENT vbsz1=vbsz2_minus_vbsaa
eor #$ff
@ -956,8 +1196,8 @@ taz
//FRAGMENT vbsxx_ge_0_then_la1
cpx #0
bpl {la1}
//FRAGMENT vbsc1_neq_vbsxx_then_la1
cpx #{c1}
//FRAGMENT 0_neq_vbsxx_then_la1
cpx #0
bne {la1}
//FRAGMENT vbuz1=vbuaa_minus_1
sec
@ -1980,8 +2220,6 @@ cpx {z1}
bcs {la1}
//FRAGMENT vbuxx=vbuc1
ldx #{c1}
//FRAGMENT vbuzz=vbuc1
ldz #{c1}
//FRAGMENT vbuzz=vbuz1
ldz {z1}
//FRAGMENT vbuz1=vbuzz
@ -1996,8 +2234,6 @@ inx
ldy #{c1}
//FRAGMENT vbuyy=_inc_vbuyy
iny
//FRAGMENT vbuzz=_inc_vbuzz
inz
//FRAGMENT vbuz1_ge_vbuxx_then_la1
lda {z1}
stx $ff
@ -2054,9 +2290,6 @@ bcc {la1}
cpy #{c1}
bcc {la1}
beq {la1}
//FRAGMENT vbuzz_lt_vbuc1_then_la1
cpz #{c1}
bcc {la1}
//FRAGMENT vbuzz_le_vbuc1_then_la1
cpz #{c1}
bcc {la1}
@ -2108,11 +2341,11 @@ cpy {z1}
bcs {la1}
//FRAGMENT vbuaa=vbuc1
lda #{c1}
//FRAGMENT vbuc1_neq_vbuyy_then_la1
cpy #{c1}
//FRAGMENT 0_neq_vbuyy_then_la1
cpy #0
bne {la1}
//FRAGMENT vbuc1_neq_vbuzz_then_la1
cpz #{c1}
//FRAGMENT 0_neq_vbuzz_then_la1
cpz #0
bne {la1}
//FRAGMENT vbuyy_ge_vbuxx_then_la1
stx $ff
@ -2130,8 +2363,8 @@ iny
ldz {z1}
//FRAGMENT vbszz=_inc_vbszz
inz
//FRAGMENT vbuc1_eq_vbuzz_then_la1
cpz #{c1}
//FRAGMENT 0_eq_vbuzz_then_la1
cpz #0
beq {la1}
//FRAGMENT vbuz1_neq_vbuxx_then_la1
cpx {z1}
@ -2221,8 +2454,8 @@ bcc {la1}
lda {z1}
sec
sbc #1
//FRAGMENT vbuc1_eq_vbuyy_then_la1
cpy #{c1}
//FRAGMENT 0_eq_vbuyy_then_la1
cpy #0
beq {la1}
//FRAGMENT vbuyy=_deref_pbuc1
ldy {c1}
@ -2286,236 +2519,3 @@ sta {z1}+1
asw {z1}
asw {z1}
asw {z1}
//FRAGMENT pbuc1_derefidx_vbuzz=vbuzz
tza
tax
sta {c1},x
//FRAGMENT vbsz1=_deref_pbsc1
lda {c1}
sta {z1}
//FRAGMENT vbsz1=_neg_vbsz2
lda {z2}
neg
sta {z1}
//FRAGMENT _deref_pbsc1=vbsz1
lda {z1}
sta {c1}
//FRAGMENT vbsz1=vbsz2_ror_2
lda {z2}
asr
asr
sta {z1}
//FRAGMENT vbsaa=_deref_pbsc1
lda {c1}
//FRAGMENT vbsxx=_deref_pbsc1
ldx {c1}
//FRAGMENT vbsz1=_neg_vbsaa
neg
sta {z1}
//FRAGMENT vbsz1=_neg_vbsxx
txa
neg
sta {z1}
//FRAGMENT vbsz1=_neg_vbsyy
tya
neg
sta {z1}
//FRAGMENT vbsz1=_neg_vbszz
tza
neg
sta {z1}
//FRAGMENT vbsaa=_neg_vbsz1
lda {z1}
neg
//FRAGMENT vbsaa=_neg_vbsaa
neg
//FRAGMENT vbsaa=_neg_vbsxx
txa
neg
//FRAGMENT vbsaa=_neg_vbsyy
tya
neg
//FRAGMENT vbsaa=_neg_vbszz
tza
neg
//FRAGMENT vbsxx=_neg_vbsz1
lda {z1}
neg
tax
//FRAGMENT vbsxx=_neg_vbsaa
neg
tax
//FRAGMENT vbsxx=_neg_vbsxx
txa
neg
tax
//FRAGMENT vbsxx=_neg_vbsyy
tya
neg
tax
//FRAGMENT vbsxx=_neg_vbszz
tza
neg
tax
//FRAGMENT vbsyy=_neg_vbsz1
lda {z1}
neg
tay
//FRAGMENT vbsyy=_neg_vbsaa
neg
tay
//FRAGMENT vbsyy=_neg_vbsxx
txa
neg
tay
//FRAGMENT vbsyy=_neg_vbsyy
tya
neg
tay
//FRAGMENT vbsyy=_neg_vbszz
tza
neg
tay
//FRAGMENT vbszz=_neg_vbsz1
lda {z1}
neg
taz
//FRAGMENT vbszz=_neg_vbsaa
neg
taz
//FRAGMENT vbszz=_neg_vbsxx
txa
neg
taz
//FRAGMENT vbszz=_neg_vbsyy
tya
neg
taz
//FRAGMENT vbszz=_neg_vbszz
tza
neg
taz
//FRAGMENT _deref_pbsc1=vbsaa
sta {c1}
//FRAGMENT vbsz1=vbsaa_ror_2
asr
asr
sta {z1}
//FRAGMENT vbsz1=vbsxx_ror_2
txa
asr
asr
sta {z1}
//FRAGMENT vbsz1=vbsyy_ror_2
tya
asr
asr
sta {z1}
//FRAGMENT vbsz1=vbszz_ror_2
tza
asr
asr
sta {z1}
//FRAGMENT vbsaa=vbsz1_ror_2
lda {z1}
asr
asr
//FRAGMENT vbsaa=vbsaa_ror_2
asr
asr
//FRAGMENT vbsaa=vbsxx_ror_2
txa
asr
asr
//FRAGMENT vbsaa=vbsyy_ror_2
tya
asr
asr
//FRAGMENT vbsaa=vbszz_ror_2
tza
asr
asr
//FRAGMENT vbsxx=vbsz1_ror_2
lda {z1}
asr
asr
tax
//FRAGMENT vbsxx=vbsaa_ror_2
asr
asr
tax
//FRAGMENT vbsxx=vbsxx_ror_2
txa
asr
asr
tax
//FRAGMENT vbsxx=vbsyy_ror_2
tya
asr
asr
tax
//FRAGMENT vbsxx=vbszz_ror_2
tza
asr
asr
tax
//FRAGMENT vbsyy=vbsz1_ror_2
lda {z1}
asr
asr
tay
//FRAGMENT vbsyy=vbsaa_ror_2
asr
asr
tay
//FRAGMENT vbsyy=vbsxx_ror_2
txa
asr
asr
tay
//FRAGMENT vbsyy=vbsyy_ror_2
tya
asr
asr
tay
//FRAGMENT vbsyy=vbszz_ror_2
tza
asr
asr
tay
//FRAGMENT vbszz=vbsz1_ror_2
lda {z1}
asr
asr
taz
//FRAGMENT vbszz=vbsaa_ror_2
asr
asr
taz
//FRAGMENT vbszz=vbsxx_ror_2
txa
asr
asr
taz
//FRAGMENT vbszz=vbsyy_ror_2
tya
asr
asr
taz
//FRAGMENT vbszz=vbszz_ror_2
tza
asr
asr
taz
//FRAGMENT vbsyy=_deref_pbsc1
ldy {c1}
//FRAGMENT vbszz=_deref_pbsc1
lda {c1}
taz
//FRAGMENT _deref_pbsc1=vbsxx
stx {c1}
//FRAGMENT _deref_pbsc1=vbsyy
sty {c1}
//FRAGMENT _deref_pbsc1=vbszz
tza
sta {c1}

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 129161168d 129161348a
//KICKC FRAGMENT CACHE 140bf2a915 140bf2c716
//FRAGMENT _deref_pbuc1=vbuc2
lda #{c2}
sta {c1}
@ -1229,9 +1229,9 @@ lda {z2}
sta {z1}
lda {z2}+1
sta {z1}+1
//FRAGMENT vbuc1_neq_vbuz1_then_la1
lda #{c1}
cmp {z1}
//FRAGMENT 0_neq_vbuz1_then_la1
lda {z1}
cmp #0
bne {la1}
//FRAGMENT pbuz1_derefidx_vbuz2=vbuz3
lda {z3}
@ -1313,8 +1313,8 @@ tza
sta {z1}
lda #0
sta {z1}+1
//FRAGMENT vbuc1_neq_vbuaa_then_la1
cmp #{c1}
//FRAGMENT 0_neq_vbuaa_then_la1
cmp #0
bne {la1}
//FRAGMENT vbuz1=vbuaa
sta {z1}
@ -1333,18 +1333,18 @@ sta ({z1}),y
tza
ldz {z2}
sta ({z1}),z
//FRAGMENT vbuc1_neq_vbuxx_then_la1
cpx #{c1}
//FRAGMENT 0_neq_vbuxx_then_la1
cpx #0
bne {la1}
//FRAGMENT vbuaa=vbuxx
txa
//FRAGMENT vbuc1_neq_vbuyy_then_la1
cpy #{c1}
//FRAGMENT 0_neq_vbuyy_then_la1
cpy #0
bne {la1}
//FRAGMENT vbuaa=vbuyy
tya
//FRAGMENT vbuc1_neq_vbuzz_then_la1
cpz #{c1}
//FRAGMENT 0_neq_vbuzz_then_la1
cpz #0
bne {la1}
//FRAGMENT vbuaa=vbuzz
tza
@ -2536,33 +2536,33 @@ sta {c1},x
tay
//FRAGMENT vbuzz=vbuaa
taz
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1
lda #{c1}
//FRAGMENT 0_neq_pbuc1_derefidx_vbuz1_then_la1
ldy {z1}
cmp {c2},y
lda {c1},y
cmp #0
bne {la1}
//FRAGMENT pbuc1_derefidx_vbuz1=vbuz1
ldy {z1}
tya
sta {c1},y
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuaa_then_la1
//FRAGMENT 0_neq_pbuc1_derefidx_vbuaa_then_la1
tay
lda #{c1}
cmp {c2},y
lda {c1},y
cmp #0
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
lda {c2},x
cmp #{c1}
//FRAGMENT 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda {c1},x
cmp #0
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1
lda #{c1}
cmp {c2},y
//FRAGMENT 0_neq_pbuc1_derefidx_vbuyy_then_la1
lda {c1},y
cmp #0
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuzz_then_la1
//FRAGMENT 0_neq_pbuc1_derefidx_vbuzz_then_la1
tza
tay
lda #{c1}
cmp {c2},y
lda {c1},y
cmp #0
bne {la1}
//FRAGMENT pbuc1_derefidx_vbuxx=vbuxx
txa

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 129161168d 129161348a
//KICKC FRAGMENT CACHE 140bf2a915 140bf2c716
//FRAGMENT vbuz1=vbuc1
lda #{c1}
sta {z1}

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 129161168d 129161348a
//KICKC FRAGMENT CACHE 140bf2a915 140bf2c716
//FRAGMENT vbuz1=_deref_pbuc1
lda {c1}
sta {z1}

@ -0,0 +1,2 @@
cpx #0
beq {la1}

@ -0,0 +1,2 @@
cpx #0
bne {la1}

@ -0,0 +1,2 @@
cpy #0
beq {la1}

@ -0,0 +1,2 @@
cpy #0
bne {la1}

@ -199,7 +199,12 @@ public class AsmFragmentInstanceSpecFactory {
ControlFlowBlock block,
ControlFlowGraph graph) {
StringBuilder signature = new StringBuilder();
if(conditionalJump.getrValue1() != null) {
if(conditionalJump.getrValue1() instanceof ConstantInteger && ((ConstantInteger) conditionalJump.getrValue1()).getValue() == 0) {
signature.append("0");
} else if(conditionalJump.getrValue1() instanceof ConstantBool) {
ConstantBool boolValue = (ConstantBool) conditionalJump.getrValue1();
signature.append(boolValue.toString());
} else if(conditionalJump.getrValue1() != null) {
signature.append(bind(conditionalJump.getrValue1()));
}
if(conditionalJump.getOperator() != null) {

@ -2193,8 +2193,8 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
ldy.z __19
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b10
// len++;
iny
@ -2213,10 +2213,11 @@ printf_number_buffer: {
sta.z padding
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
lda #0
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
bne __b2
cmp.z padding
lda.z padding
cmp #0
bne __b7
jmp __b2
__b7:
@ -2228,18 +2229,18 @@ printf_number_buffer: {
jsr printf_padding
__b2:
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b3
// cputc(buffer.sign)
lda.z buffer_sign
jsr cputc
__b3:
// if(format.zero_padding && padding)
lda #0
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
beq __b4
cmp.z padding
lda.z padding
cmp #0
bne __b9
jmp __b4
__b9:
@ -2393,8 +2394,8 @@ uctoa: {
lda RADIX_DECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
lda #0
cmp.z started
lda.z started
cmp #0
bne __b5
cpx.z digit_value
bcs __b5

@ -12763,7 +12763,7 @@ main: {
// main::@12
__b12:
// [26] main::$2 = kbhit::return#2
// [27] if(0==main::$2) goto main::@3 -- vbuc1_eq_vbuaa_then_la1
// [27] if(0==main::$2) goto main::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3_from___b12
// [28] phi from main::@12 to main::@4 [phi:main::@12->main::@4]
@ -12805,7 +12805,7 @@ main: {
// main::@14
__b14:
// [35] main::$6 = kbhit::return#3
// [36] if(0==main::$6) goto main::@5 -- vbuc1_eq_vbuaa_then_la1
// [36] if(0==main::$6) goto main::@5 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b5_from___b14
// [37] phi from main::@14 to main::@6 [phi:main::@14->main::@6]
@ -12847,7 +12847,7 @@ main: {
// main::@16
__b16:
// [44] main::$10 = kbhit::return#4
// [45] if(0==main::$10) goto main::@7 -- vbuc1_eq_vbuaa_then_la1
// [45] if(0==main::$10) goto main::@7 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b7_from___b16
// [46] phi from main::@16 to main::@8 [phi:main::@16->main::@8]
@ -12889,7 +12889,7 @@ main: {
// main::@18
__b18:
// [53] main::$14 = kbhit::return#10
// [54] if(0==main::$14) goto main::@9 -- vbuc1_eq_vbuaa_then_la1
// [54] if(0==main::$14) goto main::@9 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b9_from___b18
jmp __b10
@ -16216,7 +16216,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [466] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [466] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -16488,7 +16488,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [516] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [516] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -16556,7 +16556,7 @@ printf_number_buffer: {
.label buffer_sign = $b
.label padding = $e
.label format_zero_padding = $a
// [528] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- vbuc1_eq_vbuxx_then_la1
// [528] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuxx_then_la1
cpx #0
beq __b1_from_printf_number_buffer
// [529] phi from printf_number_buffer to printf_number_buffer::@5 [phi:printf_number_buffer->printf_number_buffer::@5]
@ -16576,9 +16576,9 @@ printf_number_buffer: {
// [533] printf_number_buffer::len#0 = (signed byte)printf_number_buffer::$19 -- vbsyy=_sbyte_vwuz1
// There is a minimum length - work out the padding
ldy.z __19
// [534] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [534] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b10_from___b11
jmp __b6
// printf_number_buffer::@6
@ -16623,16 +16623,16 @@ printf_number_buffer: {
jmp __b13
// printf_number_buffer::@13
__b13:
// [541] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [541] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
jmp __b12
// printf_number_buffer::@12
__b12:
// [542] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [542] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b7
jmp __b2
// printf_number_buffer::@7
@ -16651,9 +16651,9 @@ printf_number_buffer: {
jmp __b2
// printf_number_buffer::@2
__b2:
// [545] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [545] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
jmp __b8
// printf_number_buffer::@8
@ -16668,16 +16668,16 @@ printf_number_buffer: {
jmp __b3
// printf_number_buffer::@3
__b3:
// [548] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [548] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4_from___b3
jmp __b14
// printf_number_buffer::@14
__b14:
// [549] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [549] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b9
// [552] phi from printf_number_buffer::@14 printf_number_buffer::@3 printf_number_buffer::@9 to printf_number_buffer::@4 [phi:printf_number_buffer::@14/printf_number_buffer::@3/printf_number_buffer::@9->printf_number_buffer::@4]
__b4_from___b14:
@ -16787,7 +16787,7 @@ ultoa: {
sta.z digit_value+2
lda RADIX_HEXADECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// [565] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [565] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -16914,9 +16914,9 @@ uctoa: {
ldy.z digit
lda RADIX_DECIMAL_VALUES_CHAR,y
sta.z digit_value
// [584] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [584] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
jmp __b7
// uctoa::@7
@ -17085,7 +17085,7 @@ strlen: {
jmp __b1
// strlen::@1
__b1:
// [610] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [610] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -18522,8 +18522,7 @@ Removing instruction jmp __b1
Removing instruction jmp __b4
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda.z digit_value+1
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda.z buffer_sign
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __b3:
Removing instruction __b6:
@ -18973,7 +18972,7 @@ mem[12] [ printf_buffer ]
FINAL ASSEMBLER
Score: 2528598
Score: 2528599
// File Comments
// Tests different rotate left commands
@ -19110,7 +19109,7 @@ main: {
// main::@12
// [26] main::$2 = kbhit::return#2
// while(!kbhit())
// [27] if(0==main::$2) goto main::@3 -- vbuc1_eq_vbuaa_then_la1
// [27] if(0==main::$2) goto main::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3
// [28] phi from main::@12 to main::@4 [phi:main::@12->main::@4]
@ -19144,7 +19143,7 @@ main: {
// main::@14
// [35] main::$6 = kbhit::return#3
// while(!kbhit())
// [36] if(0==main::$6) goto main::@5 -- vbuc1_eq_vbuaa_then_la1
// [36] if(0==main::$6) goto main::@5 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b5
// [37] phi from main::@14 to main::@6 [phi:main::@14->main::@6]
@ -19178,7 +19177,7 @@ main: {
// main::@16
// [44] main::$10 = kbhit::return#4
// while(!kbhit())
// [45] if(0==main::$10) goto main::@7 -- vbuc1_eq_vbuaa_then_la1
// [45] if(0==main::$10) goto main::@7 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b7
// [46] phi from main::@16 to main::@8 [phi:main::@16->main::@8]
@ -19212,7 +19211,7 @@ main: {
// main::@18
// [53] main::$14 = kbhit::return#10
// while(!kbhit())
// [54] if(0==main::$14) goto main::@9 -- vbuc1_eq_vbuaa_then_la1
// [54] if(0==main::$14) goto main::@9 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b9
// main::@10
@ -22045,7 +22044,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [466] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [466] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -22305,7 +22304,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [516] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [516] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -22369,7 +22368,7 @@ printf_number_buffer: {
.label padding = $e
.label format_zero_padding = $a
// if(format.min_length)
// [528] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- vbuc1_eq_vbuxx_then_la1
// [528] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuxx_then_la1
cpx #0
beq __b5
// [529] phi from printf_number_buffer to printf_number_buffer::@5 [phi:printf_number_buffer->printf_number_buffer::@5]
@ -22387,9 +22386,9 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
ldy.z __19
// if(buffer.sign)
// [534] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [534] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b10
// printf_number_buffer::@6
// len++;
@ -22423,13 +22422,14 @@ printf_number_buffer: {
__b1:
// printf_number_buffer::@13
// if(!format.justify_left && !format.zero_padding && padding)
// [541] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [541] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
// printf_number_buffer::@12
// [542] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [542] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b7
jmp __b2
// printf_number_buffer::@7
@ -22448,14 +22448,13 @@ printf_number_buffer: {
// printf_number_buffer::@2
__b2:
// if(buffer.sign)
// [545] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [545] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
// printf_number_buffer::@8
// cputc(buffer.sign)
// [546] cputc::c#2 = printf_number_buffer::buffer_sign#10 -- vbuaa=vbuz1
lda.z buffer_sign
// [547] call cputc
// [495] phi from printf_number_buffer::@8 to cputc [phi:printf_number_buffer::@8->cputc]
// [495] phi cputc::c#3 = cputc::c#2 [phi:printf_number_buffer::@8->cputc#0] -- register_copy
@ -22463,13 +22462,14 @@ printf_number_buffer: {
// printf_number_buffer::@3
__b3:
// if(format.zero_padding && padding)
// [548] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [548] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4
// printf_number_buffer::@14
// [549] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [549] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b9
// [552] phi from printf_number_buffer::@14 printf_number_buffer::@3 printf_number_buffer::@9 to printf_number_buffer::@4 [phi:printf_number_buffer::@14/printf_number_buffer::@3/printf_number_buffer::@9->printf_number_buffer::@4]
jmp __b4
@ -22575,7 +22575,7 @@ ultoa: {
lda RADIX_HEXADECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// if (started || value >= digit_value)
// [565] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [565] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// ultoa::@7
@ -22698,9 +22698,9 @@ uctoa: {
lda RADIX_DECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
// [584] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [584] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
// uctoa::@7
// [585] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@5 -- vbuxx_ge_vbuz1_then_la1
@ -22865,7 +22865,7 @@ strlen: {
// strlen::@1
__b1:
// while(*str)
// [610] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [610] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -7941,7 +7941,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [144] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [144] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -8360,7 +8360,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [213] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [213] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -8427,7 +8427,7 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [225] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [225] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
jmp __b3
@ -8530,7 +8530,7 @@ ultoa: {
sta.z digit_value+2
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// [241] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [241] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -10817,7 +10817,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [144] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [144] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -11222,7 +11222,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [213] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [213] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -11283,7 +11283,7 @@ utoa: {
printf_number_buffer: {
// printf_number_buffer::@1
// if(buffer.sign)
// [225] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [225] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// printf_number_buffer::@3
@ -11382,7 +11382,7 @@ ultoa: {
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// if (started || value >= digit_value)
// [241] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [241] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// ultoa::@7

@ -5219,7 +5219,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [20] if(0!=*main::pwd) goto main::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [20] if(0!=*main::pwd) goto main::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (pwd),y
cmp #0
@ -5529,7 +5529,7 @@ main: {
jmp __b6
// main::@6
__b6:
// [71] if(0!=*main::pwd) goto main::@7 -- vbuc1_neq__deref_pbuz1_then_la1
// [71] if(0!=*main::pwd) goto main::@7 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (pwd),y
cmp #0
@ -5880,7 +5880,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [121] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [121] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -6124,7 +6124,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [167] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [167] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -6192,7 +6192,7 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [179] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [179] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
jmp __b3
@ -7228,7 +7228,7 @@ main: {
// main::@1
__b1:
// while(*pwd)
// [20] if(0!=*main::pwd) goto main::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [20] if(0!=*main::pwd) goto main::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (pwd),y
cmp #0
@ -7499,7 +7499,7 @@ main: {
// main::@6
__b6:
// while(*pwd)
// [71] if(0!=*main::pwd) goto main::@7 -- vbuc1_neq__deref_pbuz1_then_la1
// [71] if(0!=*main::pwd) goto main::@7 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (pwd),y
cmp #0
@ -7839,7 +7839,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [121] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [121] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -8078,7 +8078,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [167] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [167] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -8140,7 +8140,7 @@ printf_number_buffer: {
.label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
// printf_number_buffer::@1
// if(buffer.sign)
// [179] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [179] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// printf_number_buffer::@3

@ -5137,7 +5137,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [87] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [87] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -5431,7 +5431,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [138] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [138] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -5499,7 +5499,7 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [150] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [150] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
jmp __b3
@ -6902,7 +6902,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [87] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [87] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -7190,7 +7190,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [138] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [138] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -7252,7 +7252,7 @@ printf_number_buffer: {
.label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
// printf_number_buffer::@1
// if(buffer.sign)
// [150] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [150] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// printf_number_buffer::@3

@ -184,9 +184,9 @@ main: {
__b9:
// Skip letters until we hit another whitespace
// while(*pass && *pass!=' ' && *pass!='\n')
lda #0
tay
cmp (pass),y
ldy #0
lda (pass),y
cmp #0
bne !__b1+
jmp __b1
!__b1:

@ -5663,7 +5663,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [3] if(0!=*main::pass#10) goto main::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [3] if(0!=*main::pass#10) goto main::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (pass),y
cmp #0
@ -5848,7 +5848,7 @@ main: {
jmp __b12_from___b11
// main::@6
__b6:
// [30] if(0==main::tags_found[main::i#2]) goto main::@8 -- vbuc1_eq_pbuc2_derefidx_vbuxx_then_la1
// [30] if(0==main::tags_found[main::i#2]) goto main::@8 -- 0_eq_pbuc1_derefidx_vbuxx_then_la1
lda tags_found,x
cmp #0
beq __b8_from___b6
@ -5910,10 +5910,10 @@ main: {
// Skip letters until we hit another whitespace
// main::@22
__b22:
// [39] if(0==*main::pass#14) goto main::@1 -- vbuc1_eq__deref_pbuz1_then_la1
lda #0
// [39] if(0==*main::pass#14) goto main::@1 -- 0_eq__deref_pbuz1_then_la1
ldy #0
cmp (pass),y
lda (pass),y
cmp #0
beq __b1_from___b22
jmp __b33
// main::@33
@ -6086,7 +6086,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [62] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [62] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -6380,7 +6380,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [113] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [113] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -6448,7 +6448,7 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [125] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [125] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
jmp __b3
@ -6940,7 +6940,6 @@ Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #>0
Removing instruction lda #<0
Removing instruction lda #>0
Replacing instruction ldy #0 with TAY
Removing instruction lda #0
Replacing instruction ldy #0 with TAY
Removing instruction lda #<0
@ -8511,7 +8510,7 @@ main: {
// main::@1
__b1:
// while(*pass)
// [3] if(0!=*main::pass#10) goto main::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [3] if(0!=*main::pass#10) goto main::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (pass),y
cmp #0
@ -8675,7 +8674,7 @@ main: {
// main::@6
__b6:
// if(tags_found[i])
// [30] if(0==main::tags_found[main::i#2]) goto main::@8 -- vbuc1_eq_pbuc2_derefidx_vbuxx_then_la1
// [30] if(0==main::tags_found[main::i#2]) goto main::@8 -- 0_eq_pbuc1_derefidx_vbuxx_then_la1
lda tags_found,x
cmp #0
beq __b8
@ -8732,10 +8731,10 @@ main: {
// Skip letters until we hit another whitespace
// main::@22
// while(*pass && *pass!=' ' && *pass!='\n')
// [39] if(0==*main::pass#14) goto main::@1 -- vbuc1_eq__deref_pbuz1_then_la1
lda #0
tay
cmp (pass),y
// [39] if(0==*main::pass#14) goto main::@1 -- 0_eq__deref_pbuz1_then_la1
ldy #0
lda (pass),y
cmp #0
bne !__b1+
jmp __b1
!__b1:
@ -8899,7 +8898,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [62] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [62] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -9187,7 +9186,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [113] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [113] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -9249,7 +9248,7 @@ printf_number_buffer: {
.label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
// printf_number_buffer::@1
// if(buffer.sign)
// [125] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [125] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// printf_number_buffer::@3

@ -192,7 +192,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [2] if(0!=msg1[main::i#2]) goto main::@2 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
// [2] if(0!=msg1[main::i#2]) goto main::@2 -- 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda msg1,x
cmp #0
bne __b2
@ -203,7 +203,7 @@ main: {
jmp __b3
// main::@3
__b3:
// [4] if(0!=msg2[main::i1#2]) goto main::@4 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
// [4] if(0!=msg2[main::i1#2]) goto main::@4 -- 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda msg2,x
cmp #0
bne __b4
@ -289,7 +289,7 @@ main: {
// main::@1
__b1:
// for(char i=0;msg1[i];i++)
// [2] if(0!=msg1[main::i#2]) goto main::@2 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
// [2] if(0!=msg1[main::i#2]) goto main::@2 -- 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda msg1,x
cmp #0
bne __b2
@ -299,7 +299,7 @@ main: {
// main::@3
__b3:
// for(char i=0;msg2[i];i++)
// [4] if(0!=msg2[main::i1#2]) goto main::@4 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
// [4] if(0!=msg2[main::i1#2]) goto main::@4 -- 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda msg2,x
cmp #0
bne __b4

@ -1644,8 +1644,8 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
lda #0
cmp.z started
lda.z started
cmp #0
bne __b5
cpx.z digit_value
bcs __b5
@ -1688,8 +1688,8 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
ldx.z __19
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b10
// len++;
inx
@ -1707,10 +1707,11 @@ printf_number_buffer: {
sta.z padding
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
lda #0
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
bne __b2
cmp.z padding
lda.z padding
cmp #0
bne __b7
jmp __b2
__b7:
@ -1722,19 +1723,19 @@ printf_number_buffer: {
jsr printf_padding
__b2:
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b3
// cputc(buffer.sign)
lda.z buffer_sign
sta.z cputc.c
jsr cputc
__b3:
// if(format.zero_padding && padding)
lda #0
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
beq __b4
cmp.z padding
lda.z padding
cmp #0
bne __b9
jmp __b4
__b9:

@ -9127,7 +9127,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [12] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [12] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -9161,7 +9161,7 @@ strlen: {
jmp __b1
// strlen::@1
__b1:
// [18] if(0!=*strlen::str#3) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [18] if(0!=*strlen::str#3) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -11298,9 +11298,9 @@ uctoa: {
ldy.z digit
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// [329] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [329] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
jmp __b7
// uctoa::@7
@ -11386,9 +11386,9 @@ printf_number_buffer: {
// [345] printf_number_buffer::len#0 = (signed byte)printf_number_buffer::$19 -- vbsxx=_sbyte_vwuz1
// There is a minimum length - work out the padding
ldx.z __19
// [346] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@10 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [346] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@10 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b10_from___b11
jmp __b6
// printf_number_buffer::@6
@ -11432,16 +11432,16 @@ printf_number_buffer: {
jmp __b13
// printf_number_buffer::@13
__b13:
// [353] if(0!=printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [353] if(0!=printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
jmp __b12
// printf_number_buffer::@12
__b12:
// [354] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [354] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b7
jmp __b2
// printf_number_buffer::@7
@ -11460,9 +11460,9 @@ printf_number_buffer: {
jmp __b2
// printf_number_buffer::@2
__b2:
// [357] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [357] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
jmp __b8
// printf_number_buffer::@8
@ -11475,16 +11475,16 @@ printf_number_buffer: {
jmp __b3
// printf_number_buffer::@3
__b3:
// [360] if(0==printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [360] if(0==printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4_from___b3
jmp __b14
// printf_number_buffer::@14
__b14:
// [361] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [361] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b9
// [364] phi from printf_number_buffer::@14 printf_number_buffer::@3 printf_number_buffer::@9 to printf_number_buffer::@4 [phi:printf_number_buffer::@14/printf_number_buffer::@3/printf_number_buffer::@9->printf_number_buffer::@4]
__b4_from___b14:
@ -12146,8 +12146,7 @@ Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction lda #>4 with TYA
Replacing instruction lda #0 with TYA
Replacing instruction lda #0 with TYA
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda.z buffer_sign
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __b5:
Removing instruction __breturn:
@ -12611,7 +12610,7 @@ mem[12] [ printf_buffer ]
FINAL ASSEMBLER
Score: 652907
Score: 652908
// File Comments
// 8 bit converted md5 calculator
@ -12706,7 +12705,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [12] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [12] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -12738,7 +12737,7 @@ strlen: {
// strlen::@1
__b1:
// while(*str)
// [18] if(0!=*strlen::str#3) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [18] if(0!=*strlen::str#3) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -14835,9 +14834,9 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
// [329] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [329] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
// uctoa::@7
// [330] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@5 -- vbuxx_ge_vbuz1_then_la1
@ -14917,9 +14916,9 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
ldx.z __19
// if(buffer.sign)
// [346] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@10 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [346] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@10 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b10
// printf_number_buffer::@6
// len++;
@ -14952,13 +14951,14 @@ printf_number_buffer: {
__b1:
// printf_number_buffer::@13
// if(!format.justify_left && !format.zero_padding && padding)
// [353] if(0!=printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [353] if(0!=printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
// printf_number_buffer::@12
// [354] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [354] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b7
jmp __b2
// printf_number_buffer::@7
@ -14977,27 +14977,27 @@ printf_number_buffer: {
// printf_number_buffer::@2
__b2:
// if(buffer.sign)
// [357] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [357] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
// printf_number_buffer::@8
// cputc(buffer.sign)
// [358] cputc::c = printf_number_buffer::buffer_sign#0 -- vbuz1=vbuz2
lda.z buffer_sign
sta.z cputc.c
// [359] call cputc
jsr cputc
// printf_number_buffer::@3
__b3:
// if(format.zero_padding && padding)
// [360] if(0==printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [360] if(0==printf_number_buffer::format_zero_padding#0) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4
// printf_number_buffer::@14
// [361] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [361] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b9
// [364] phi from printf_number_buffer::@14 printf_number_buffer::@3 printf_number_buffer::@9 to printf_number_buffer::@4 [phi:printf_number_buffer::@14/printf_number_buffer::@3/printf_number_buffer::@9->printf_number_buffer::@4]
jmp __b4

@ -1013,7 +1013,7 @@ md5: {
// [23] md5::$2 = md5::i#2 & 1 -- vbuaa=vbuxx_band_vbuc1
txa
and #1
// [24] if(0==md5::$2) goto md5::@3 -- vbuc1_eq_vbuaa_then_la1
// [24] if(0==md5::$2) goto md5::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3
// [25] phi from md5::@5 to md5::@4 [phi:md5::@5->md5::@4]
@ -1492,7 +1492,7 @@ md5: {
txa
and #1
// if(i&1)
// [24] if(0==md5::$2) goto md5::@3 -- vbuc1_eq_vbuaa_then_la1
// [24] if(0==md5::$2) goto md5::@3 -- 0_eq_vbuaa_then_la1
cmp #0
// [25] phi from md5::@5 to md5::@4 [phi:md5::@5->md5::@4]
// md5::@4

@ -4463,14 +4463,14 @@ atoi: {
jmp __b3
// atoi::@3
__b3:
// [67] if(0!=atoi::str#2[atoi::i#4]) goto atoi::@4 -- vbuc1_neq_pbuz1_derefidx_vbuyy_then_la1
// [67] if(0!=atoi::str#2[atoi::i#4]) goto atoi::@4 -- 0_neq_pbuz1_derefidx_vbuyy_then_la1
lda (str),y
cmp #0
bne __b4
jmp __b5
// atoi::@5
__b5:
// [68] if(0!=atoi::negative#2) goto atoi::@1 -- vbuc1_neq_vbuxx_then_la1
// [68] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbuxx_then_la1
// Return result with sign
cpx #0
bne __b1
@ -4615,7 +4615,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [93] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [93] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -4700,7 +4700,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [107] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [107] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -4768,7 +4768,7 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [119] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [119] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
jmp __b3
@ -5996,13 +5996,13 @@ atoi: {
// atoi::@3
__b3:
// for (; str[i]; ++i)
// [67] if(0!=atoi::str#2[atoi::i#4]) goto atoi::@4 -- vbuc1_neq_pbuz1_derefidx_vbuyy_then_la1
// [67] if(0!=atoi::str#2[atoi::i#4]) goto atoi::@4 -- 0_neq_pbuz1_derefidx_vbuyy_then_la1
lda (str),y
cmp #0
bne __b4
// atoi::@5
// if(negative)
// [68] if(0!=atoi::negative#2) goto atoi::@1 -- vbuc1_neq_vbuxx_then_la1
// [68] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbuxx_then_la1
// Return result with sign
cpx #0
bne __b1
@ -6144,7 +6144,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [93] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [93] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -6229,7 +6229,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [107] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [107] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -6291,7 +6291,7 @@ printf_number_buffer: {
.label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
// printf_number_buffer::@1
// if(buffer.sign)
// [119] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [119] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// printf_number_buffer::@3

@ -2948,7 +2948,7 @@ abs_u16: {
lda.z w+1
// [100] abs_u16::$1 = abs_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// [101] if(0!=abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [101] if(0!=abs_u16::$1) goto abs_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [103] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return]
@ -2983,7 +2983,7 @@ sgn_u16: {
lda.z w+1
// [107] sgn_u16::$1 = sgn_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// [108] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [108] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1_from_sgn_u16
// [110] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return]
@ -4034,7 +4034,7 @@ abs_u16: {
// [100] abs_u16::$1 = abs_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// if(>w&0x80)
// [101] if(0!=abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [101] if(0!=abs_u16::$1) goto abs_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [103] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return]
@ -4070,7 +4070,7 @@ sgn_u16: {
// [107] sgn_u16::$1 = sgn_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// if(>w&0x80)
// [108] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [108] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [110] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return]

@ -56,8 +56,8 @@ irq: {
lda #WHITE
sta BG_COLOR
// if(frame_cnt)
lda #0
cmp.z frame_cnt
lda.z frame_cnt
cmp #0
beq __b1
// frame_cnt++;
inc.z frame_cnt

@ -1725,9 +1725,9 @@ irq: {
// [5] *BG_COLOR = WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BG_COLOR
// [6] if(0==frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z frame_cnt
// [6] if(0==frame_cnt) goto irq::@1 -- 0_eq_vbuz1_then_la1
lda.z frame_cnt
cmp #0
beq __b1
jmp __b2
// irq::@2
@ -2516,9 +2516,9 @@ irq: {
lda #WHITE
sta BG_COLOR
// if(frame_cnt)
// [6] if(0==frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z frame_cnt
// [6] if(0==frame_cnt) goto irq::@1 -- 0_eq_vbuz1_then_la1
lda.z frame_cnt
cmp #0
beq __b1
// irq::@2
// frame_cnt++;

@ -65,8 +65,8 @@ irq: {
lda #WHITE
sta BG_COLOR
// if(frame_cnt)
lda #0
cmp.z frame_cnt
lda.z frame_cnt
cmp #0
beq __b1
// frame_cnt++;
inc.z frame_cnt

@ -4147,9 +4147,9 @@ irq: {
// [5] *BG_COLOR = WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BG_COLOR
// [6] if(0==frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z frame_cnt
// [6] if(0==frame_cnt) goto irq::@1 -- 0_eq_vbuz1_then_la1
lda.z frame_cnt
cmp #0
beq __b1
jmp __b2
// irq::@2
@ -6294,9 +6294,9 @@ irq: {
lda #WHITE
sta BG_COLOR
// if(frame_cnt)
// [6] if(0==frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z frame_cnt
// [6] if(0==frame_cnt) goto irq::@1 -- 0_eq_vbuz1_then_la1
lda.z frame_cnt
cmp #0
beq __b1
// irq::@2
// frame_cnt++;

@ -66,8 +66,8 @@ irq: {
lda #WHITE
sta BG_COLOR
// if(frame_cnt)
lda #0
cmp.z frame_cnt
lda.z frame_cnt
cmp #0
beq __b1
// frame_cnt++;
inc.z frame_cnt

@ -4380,9 +4380,9 @@ irq: {
// [5] *BG_COLOR = WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BG_COLOR
// [6] if(0==frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z frame_cnt
// [6] if(0==frame_cnt) goto irq::@1 -- 0_eq_vbuz1_then_la1
lda.z frame_cnt
cmp #0
beq __b1
jmp __b2
// irq::@2
@ -6612,9 +6612,9 @@ irq: {
lda #WHITE
sta BG_COLOR
// if(frame_cnt)
// [6] if(0==frame_cnt) goto irq::@1 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z frame_cnt
// [6] if(0==frame_cnt) goto irq::@1 -- 0_eq_vbuz1_then_la1
lda.z frame_cnt
cmp #0
beq __b1
// irq::@2
// frame_cnt++;

@ -3212,7 +3212,7 @@ abs_u16: {
lda.z w+1
// [108] abs_u16::$1 = abs_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// [109] if(0!=abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [109] if(0!=abs_u16::$1) goto abs_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [111] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return]
@ -3247,7 +3247,7 @@ sgn_u16: {
lda.z w+1
// [115] sgn_u16::$1 = sgn_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// [116] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [116] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1_from_sgn_u16
// [118] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return]
@ -4334,7 +4334,7 @@ abs_u16: {
// [108] abs_u16::$1 = abs_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// if(>w&0x80)
// [109] if(0!=abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [109] if(0!=abs_u16::$1) goto abs_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [111] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return]
@ -4370,7 +4370,7 @@ sgn_u16: {
// [115] sgn_u16::$1 = sgn_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// if(>w&0x80)
// [116] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [116] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [118] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return]

@ -225,7 +225,7 @@ main: {
// [2] main::b#0 = main::i#2 & 1 -- vbuaa=vbuxx_band_vbuc1
txa
and #1
// [3] if(0==main::b#0) goto main::@2 -- vbuc1_eq_vbuaa_then_la1
// [3] if(0==main::b#0) goto main::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
// [5] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
@ -323,7 +323,7 @@ main: {
txa
and #1
// !b ? 1 : 0
// [3] if(0==main::b#0) goto main::@2 -- vbuc1_eq_vbuaa_then_la1
// [3] if(0==main::b#0) goto main::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// [5] phi from main::@1 to main::@3 [phi:main::@1->main::@3]

@ -2745,7 +2745,7 @@ print_str: {
jmp __b1
// print_str::@1
__b1:
// [82] if(0!=*print_str::str#5) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [82] if(0!=*print_str::str#5) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -3898,7 +3898,7 @@ print_str: {
// print_str::@1
__b1:
// while(*str)
// [82] if(0!=*print_str::str#5) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [82] if(0!=*print_str::str#5) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -16448,7 +16448,7 @@ print_str_lines: {
jmp __b1
// print_str_lines::@1
__b1:
// [435] if(0!=*print_str_lines::str#3) goto print_str_lines::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [435] if(0!=*print_str_lines::str#3) goto print_str_lines::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -16474,7 +16474,7 @@ print_str_lines: {
bne !+
inc.z str+1
!:
// [440] if(0==print_str_lines::ch#0) goto print_str_lines::@3 -- vbuc1_eq_vbuaa_then_la1
// [440] if(0==print_str_lines::ch#0) goto print_str_lines::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3_from___b2
jmp __b4
@ -16490,7 +16490,7 @@ print_str_lines: {
jmp __b3
// print_str_lines::@3
__b3:
// [444] if(0!=print_str_lines::ch#0) goto print_str_lines::@2 -- vbuc1_neq_vbuaa_then_la1
// [444] if(0!=print_str_lines::ch#0) goto print_str_lines::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2_from___b3
// [445] phi from print_str_lines::@3 to print_str_lines::@5 [phi:print_str_lines::@3->print_str_lines::@5]
@ -18704,7 +18704,7 @@ print_str_at: {
jmp __b1
// print_str_at::@1
__b1:
// [784] if(0!=*print_str_at::str#2) goto print_str_at::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [784] if(0!=*print_str_at::str#2) goto print_str_at::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -23742,7 +23742,7 @@ print_str_lines: {
// print_str_lines::@1
__b1:
// while(*str)
// [435] if(0!=*print_str_lines::str#3) goto print_str_lines::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [435] if(0!=*print_str_lines::str#3) goto print_str_lines::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -23766,7 +23766,7 @@ print_str_lines: {
inc.z str+1
!:
// if(ch)
// [440] if(0==print_str_lines::ch#0) goto print_str_lines::@3 -- vbuc1_eq_vbuaa_then_la1
// [440] if(0==print_str_lines::ch#0) goto print_str_lines::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3
// print_str_lines::@4
@ -23779,7 +23779,7 @@ print_str_lines: {
// print_str_lines::@3
__b3:
// while (ch)
// [444] if(0!=print_str_lines::ch#0) goto print_str_lines::@2 -- vbuc1_neq_vbuaa_then_la1
// [444] if(0!=print_str_lines::ch#0) goto print_str_lines::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// [445] phi from print_str_lines::@3 to print_str_lines::@5 [phi:print_str_lines::@3->print_str_lines::@5]
@ -25856,7 +25856,7 @@ print_str_at: {
// print_str_at::@1
__b1:
// while(*str)
// [784] if(0!=*print_str_at::str#2) goto print_str_at::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [784] if(0!=*print_str_at::str#2) goto print_str_at::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -13700,7 +13700,7 @@ print_str_lines: {
jmp __b1
// print_str_lines::@1
__b1:
// [119] if(0!=*print_str_lines::str#2) goto print_str_lines::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [119] if(0!=*print_str_lines::str#2) goto print_str_lines::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -13726,7 +13726,7 @@ print_str_lines: {
bne !+
inc.z str+1
!:
// [124] if(0==print_str_lines::ch#0) goto print_str_lines::@3 -- vbuc1_eq_vbuaa_then_la1
// [124] if(0==print_str_lines::ch#0) goto print_str_lines::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3_from___b2
jmp __b4
@ -13742,7 +13742,7 @@ print_str_lines: {
jmp __b3
// print_str_lines::@3
__b3:
// [128] if(0!=print_str_lines::ch#0) goto print_str_lines::@2 -- vbuc1_neq_vbuaa_then_la1
// [128] if(0!=print_str_lines::ch#0) goto print_str_lines::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2_from___b3
// [129] phi from print_str_lines::@3 to print_str_lines::@5 [phi:print_str_lines::@3->print_str_lines::@5]
@ -20330,7 +20330,7 @@ print_str_lines: {
// print_str_lines::@1
__b1:
// while(*str)
// [119] if(0!=*print_str_lines::str#2) goto print_str_lines::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [119] if(0!=*print_str_lines::str#2) goto print_str_lines::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -20354,7 +20354,7 @@ print_str_lines: {
inc.z str+1
!:
// if(ch)
// [124] if(0==print_str_lines::ch#0) goto print_str_lines::@3 -- vbuc1_eq_vbuaa_then_la1
// [124] if(0==print_str_lines::ch#0) goto print_str_lines::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3
// print_str_lines::@4
@ -20367,7 +20367,7 @@ print_str_lines: {
// print_str_lines::@3
__b3:
// while (ch)
// [128] if(0!=print_str_lines::ch#0) goto print_str_lines::@2 -- vbuc1_neq_vbuaa_then_la1
// [128] if(0!=print_str_lines::ch#0) goto print_str_lines::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// [129] phi from print_str_lines::@3 to print_str_lines::@5 [phi:print_str_lines::@3->print_str_lines::@5]

@ -3437,7 +3437,6 @@ Statement [1] conio_cursor_x = 0 [ printf_buffer ] ( [ printf_buffer ] { } ) a
Statement [2] conio_cursor_y = 0 [ printf_buffer ] ( [ printf_buffer ] { } ) always clobbers reg byte a
Statement [3] conio_line_text = DEFAULT_SCREEN [ printf_buffer ] ( [ printf_buffer ] { } ) always clobbers reg byte a
Statement [4] conio_line_color = COLORRAM [ printf_buffer ] ( [ printf_buffer ] { } ) always clobbers reg byte a
Statement [19] if(main::signed_char_value#2!=0) goto main::@2 [ conio_cursor_x conio_cursor_y conio_line_text conio_line_color main::signed_char_value#2 printf_buffer ] ( main:7 [ conio_cursor_x conio_cursor_y conio_line_text conio_line_color main::signed_char_value#2 printf_buffer ] { } ) always clobbers reg byte a
Statement [22] test_casting::signed_short_value#0 = main::signed_char_value#1 [ conio_cursor_x conio_cursor_y conio_line_text conio_line_color main::signed_char_value#1 test_casting::signed_short_value#0 printf_buffer ] ( main:7 [ conio_cursor_x conio_cursor_y conio_line_text conio_line_color main::signed_char_value#1 test_casting::signed_short_value#0 printf_buffer ] { { test_casting::signed_short_value#0 = main::signed_char_value#1 } } ) always clobbers reg byte a
Statement [27] conio_cursor_x = gotoxy::x#2 [ gotoxy::y#4 ] ( gotoxy:14 [ gotoxy::y#4 ] { { gotoxy::y#2 = conio_c64_init::line#2 } } conio_c64_init:5::gotoxy:14 [ printf_buffer gotoxy::y#4 ] { { gotoxy::y#2 = conio_c64_init::line#2 } } ) always clobbers reg byte a
Statement [29] gotoxy::$7 = (word)gotoxy::y#4 [ gotoxy::$7 ] ( gotoxy:14 [ gotoxy::$7 ] { { gotoxy::y#2 = conio_c64_init::line#2 } } conio_c64_init:5::gotoxy:14 [ printf_buffer gotoxy::$7 ] { { gotoxy::y#2 = conio_c64_init::line#2 } } ) always clobbers reg byte a
@ -4079,7 +4078,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [73] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [73] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -4165,7 +4164,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [87] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [87] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -4233,7 +4232,7 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [99] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [99] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
jmp __b3
@ -5425,7 +5424,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [73] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [73] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -5511,7 +5510,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [87] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [87] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -5573,7 +5572,7 @@ printf_number_buffer: {
.label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
// printf_number_buffer::@1
// if(buffer.sign)
// [99] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [99] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// printf_number_buffer::@3

@ -4753,7 +4753,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [84] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [84] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -4905,7 +4905,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [115] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [115] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -4973,7 +4973,7 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [127] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [127] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
jmp __b3
@ -6363,7 +6363,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [84] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [84] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -6510,7 +6510,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [115] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [115] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -6572,7 +6572,7 @@ printf_number_buffer: {
.label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
// printf_number_buffer::@1
// if(buffer.sign)
// [127] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [127] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// printf_number_buffer::@3

@ -214,8 +214,8 @@ main: {
bcc __b36
!:
// if (0==stopIt && objects<maxDrawObjects)
lda #0
cmp.z stopIt
lda.z stopIt
cmp #0
bne __b11
lda.z objects
cmp #maxDrawObjects

@ -3692,9 +3692,9 @@ main: {
jmp __b30
// main::@30
__b30:
// [42] if(0!=main::stopIt#5) goto main::@33 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z stopIt
// [42] if(0!=main::stopIt#5) goto main::@33 -- 0_neq_vbuz1_then_la1
lda.z stopIt
cmp #0
bne __b33_from___b30
jmp __b42
// main::@42
@ -5008,9 +5008,9 @@ main: {
!:
// main::@30
// if (0==stopIt && objects<maxDrawObjects)
// [42] if(0!=main::stopIt#5) goto main::@33 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z stopIt
// [42] if(0!=main::stopIt#5) goto main::@33 -- 0_neq_vbuz1_then_la1
lda.z stopIt
cmp #0
bne __b11
// main::@42
// [43] if(main::objects#9<maxDrawObjects) goto main::@31 -- vbuz1_lt_vbuc1_then_la1

@ -5618,7 +5618,7 @@ processChars: {
ror.z xpos
// [77] processChars::$9 = > processChars::xpos#0 -- vbuaa=_hi_vwuz1
lda.z xpos+1
// [78] if(0!=processChars::$9) goto processChars::@4 -- vbuc1_neq_vbuaa_then_la1
// [78] if(0!=processChars::$9) goto processChars::@4 -- 0_neq_vbuaa_then_la1
// Set sprite position
cmp #0
bne __b4
@ -6885,7 +6885,7 @@ atan2_16: {
jmp __b15
// atan2_16::@15
__b15:
// [278] if(0==atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
// [278] if(0==atan2_16::shift#2) goto atan2_16::@17 -- 0_eq_vbuyy_then_la1
cpy #0
beq __b17_from___b15
jmp __b16
@ -8302,7 +8302,7 @@ processChars: {
// [77] processChars::$9 = > processChars::xpos#0 -- vbuaa=_hi_vwuz1
lda.z xpos+1
// if(>xpos)
// [78] if(0!=processChars::$9) goto processChars::@4 -- vbuc1_neq_vbuaa_then_la1
// [78] if(0!=processChars::$9) goto processChars::@4 -- 0_neq_vbuaa_then_la1
// Set sprite position
cmp #0
beq !__b4+
@ -9586,7 +9586,7 @@ atan2_16: {
bcs __b14
// atan2_16::@15
// if(shift)
// [278] if(0==atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
// [278] if(0==atan2_16::shift#2) goto atan2_16::@17 -- 0_eq_vbuyy_then_la1
cpy #0
beq __b17
// atan2_16::@16

@ -268,7 +268,7 @@ strlen: {
jmp __b1
// strlen::@1
__b1:
// [8] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [8] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -386,7 +386,7 @@ strlen: {
// strlen::@1
__b1:
// while(*str)
// [8] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [8] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -315,11 +315,12 @@ main: {
sta $2001
__b13:
// while (!vblank_hit)
lda #0
cmp.z vblank_hit
lda.z vblank_hit
cmp #0
beq __b13
// vblank_hit = 0
// wait for vblank
lda #0
sta.z vblank_hit
// poke(0x2001) = 0x18
lda #$18

@ -2873,7 +2873,7 @@ main: {
// [20] main::initNES1_waitForVBlank1_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [21] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [21] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1___b1
// [22] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -2913,7 +2913,7 @@ main: {
sta MEMORY+$700,x
// [31] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [32] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [32] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1_from_initNES1___b1
// [33] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -2927,7 +2927,7 @@ main: {
// [34] main::initNES1_waitForVBlank2_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [35] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [35] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2___b1
jmp initNES1___b7
@ -3148,9 +3148,9 @@ main: {
jmp __b13
// main::@13
__b13:
// [66] if(0==vblank_hit) goto main::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z vblank_hit
// [66] if(0==vblank_hit) goto main::@13 -- 0_eq_vbuz1_then_la1
lda.z vblank_hit
cmp #0
beq __b13
jmp __b14
// main::@14
@ -3764,7 +3764,6 @@ Removing instruction jmp initNES1___b1
Removing instruction jmp __b5
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Fixing long branch [219] bcc __b2 to bcs
Fixing long branch [243] bne __b25 to beq
@ -3940,7 +3939,7 @@ zp[2]:31 [ rand::$2 ]
FINAL ASSEMBLER
Score: 40983
Score: 41003
// File Comments
//#pragma emulator("java -jar /Applications/Nintaco_bin_2020-05-01/Nintaco.jar")
@ -4142,7 +4141,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [21] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [21] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1
// [22] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -4180,7 +4179,7 @@ main: {
// while (++i)
// [31] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [32] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [32] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1
// [33] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -4192,7 +4191,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [35] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [35] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2
// main::initNES1_@7
@ -4389,14 +4388,15 @@ main: {
// main::@13
__b13:
// while (!vblank_hit)
// [66] if(0==vblank_hit) goto main::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z vblank_hit
// [66] if(0==vblank_hit) goto main::@13 -- 0_eq_vbuz1_then_la1
lda.z vblank_hit
cmp #0
beq __b13
// main::@14
// vblank_hit = 0
// [67] vblank_hit = 0 -- vbuz1=vbuc1
// wait for vblank
lda #0
sta.z vblank_hit
// poke(0x2001) = 0x18
// [68] *((byte*) 8193) = $18 -- _deref_pbuc1=vbuc2

@ -352,11 +352,12 @@ main: {
sta $2001
__b13:
// while (!vblank_hit)
lda #0
cmp.z vblank_hit
lda.z vblank_hit
cmp #0
beq __b13
// vblank_hit = 0
// wait for vblank
lda #0
sta.z vblank_hit
// poke(0x2001) = 0x18
lda #$18

@ -3014,7 +3014,7 @@ main: {
// [20] main::initNES1_waitForVBlank1_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [21] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [21] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1___b1
// [22] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -3054,7 +3054,7 @@ main: {
sta MEMORY+$700,x
// [31] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [32] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [32] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1_from_initNES1___b1
// [33] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -3068,7 +3068,7 @@ main: {
// [34] main::initNES1_waitForVBlank2_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [35] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [35] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2___b1
jmp initNES1___b7
@ -3328,9 +3328,9 @@ main: {
jmp __b13
// main::@13
__b13:
// [67] if(0==vblank_hit) goto main::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z vblank_hit
// [67] if(0==vblank_hit) goto main::@13 -- 0_eq_vbuz1_then_la1
lda.z vblank_hit
cmp #0
beq __b13
jmp __b14
// main::@14
@ -4053,7 +4053,6 @@ Removing instruction jmp initNES1___b1
Removing instruction jmp __b5
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Fixing long branch [225] bcc __b2 to bcs
Fixing long branch [254] bne __b25 to beq
@ -4239,7 +4238,7 @@ zp[2]:45 [ rand::$2 ]
FINAL ASSEMBLER
Score: 64773
Score: 64793
// File Comments
// Upstart
@ -4443,7 +4442,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [21] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [21] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1
// [22] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -4481,7 +4480,7 @@ main: {
// while (++i)
// [31] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [32] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [32] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1
// [33] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -4493,7 +4492,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [35] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [35] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2
// main::initNES1_@7
@ -4726,14 +4725,15 @@ main: {
// main::@13
__b13:
// while (!vblank_hit)
// [67] if(0==vblank_hit) goto main::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z vblank_hit
// [67] if(0==vblank_hit) goto main::@13 -- 0_eq_vbuz1_then_la1
lda.z vblank_hit
cmp #0
beq __b13
// main::@14
// vblank_hit = 0
// [68] vblank_hit = 0 -- vbuz1=vbuc1
// wait for vblank
lda #0
sta.z vblank_hit
// poke(0x2001) = 0x18
// [69] *((byte*) 8193) = $18 -- _deref_pbuc1=vbuc2

@ -302,8 +302,8 @@ main: {
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
__b9:
// while(canvas_show_flag)
lda #0
cmp.z canvas_show_flag
lda.z canvas_show_flag
cmp #0
bne __b9
// VICII->BORDER_COLOR = BLACK
lda #BLACK

@ -4683,7 +4683,7 @@ irq_bottom_2: {
// irq_bottom_2::@4
__b4:
// [11] irq_bottom_2::$0 = kbhit::return#2
// [12] if(0==irq_bottom_2::$0) goto irq_bottom_2::@1 -- vbuc1_eq_vbuaa_then_la1
// [12] if(0==irq_bottom_2::$0) goto irq_bottom_2::@1 -- 0_eq_vbuaa_then_la1
// Show the current canvas (unless a key is being pressed)
cmp #0
beq __b1
@ -5036,9 +5036,9 @@ main: {
jmp __b9
// main::@9
__b9:
// [69] if(0!=canvas_show_flag) goto main::@9 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z canvas_show_flag
// [69] if(0!=canvas_show_flag) goto main::@9 -- 0_neq_vbuz1_then_la1
lda.z canvas_show_flag
cmp #0
bne __b9
jmp __b10
// main::@10
@ -5851,7 +5851,7 @@ abs_u8: {
// [212] abs_u8::$0 = abs_u8::u#2 & $80 -- vbuxx=vbuaa_band_vbuc1
ldx #$80
axs #0
// [213] if(0!=abs_u8::$0) goto abs_u8::@1 -- vbuc1_neq_vbuxx_then_la1
// [213] if(0!=abs_u8::$0) goto abs_u8::@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b1
// [215] phi from abs_u8 abs_u8::@1 to abs_u8::@return [phi:abs_u8/abs_u8::@1->abs_u8::@return]
@ -5878,7 +5878,7 @@ abs_u8: {
sgn_u8: {
// [218] sgn_u8::$0 = sgn_u8::u#2 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// [219] if(0!=sgn_u8::$0) goto sgn_u8::@1 -- vbuc1_neq_vbuaa_then_la1
// [219] if(0!=sgn_u8::$0) goto sgn_u8::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1_from_sgn_u8
// [221] phi from sgn_u8 to sgn_u8::@return [phi:sgn_u8->sgn_u8::@return]
@ -6593,7 +6593,7 @@ irq_bottom_2: {
// irq_bottom_2::@4
// [11] irq_bottom_2::$0 = kbhit::return#2
// if(!kbhit())
// [12] if(0==irq_bottom_2::$0) goto irq_bottom_2::@1 -- vbuc1_eq_vbuaa_then_la1
// [12] if(0==irq_bottom_2::$0) goto irq_bottom_2::@1 -- 0_eq_vbuaa_then_la1
// Show the current canvas (unless a key is being pressed)
cmp #0
beq __b1
@ -6931,9 +6931,9 @@ main: {
// main::@9
__b9:
// while(canvas_show_flag)
// [69] if(0!=canvas_show_flag) goto main::@9 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z canvas_show_flag
// [69] if(0!=canvas_show_flag) goto main::@9 -- 0_neq_vbuz1_then_la1
lda.z canvas_show_flag
cmp #0
bne __b9
// main::@10
// VICII->BORDER_COLOR = BLACK
@ -7753,7 +7753,7 @@ abs_u8: {
ldx #$80
axs #0
// if(u & 0x80)
// [213] if(0!=abs_u8::$0) goto abs_u8::@1 -- vbuc1_neq_vbuxx_then_la1
// [213] if(0!=abs_u8::$0) goto abs_u8::@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b1
// [215] phi from abs_u8 abs_u8::@1 to abs_u8::@return [phi:abs_u8/abs_u8::@1->abs_u8::@return]
@ -7780,7 +7780,7 @@ sgn_u8: {
// [218] sgn_u8::$0 = sgn_u8::u#2 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// if(u & 0x80)
// [219] if(0!=sgn_u8::$0) goto sgn_u8::@1 -- vbuc1_neq_vbuaa_then_la1
// [219] if(0!=sgn_u8::$0) goto sgn_u8::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [221] phi from sgn_u8 to sgn_u8::@return [phi:sgn_u8->sgn_u8::@return]

@ -5050,7 +5050,7 @@ main: {
// main::@15
__b15:
// [39] main::$15 = keyboard_key_pressed::return#2
// [40] if(0!=main::$15) goto main::@8 -- vbuc1_neq_vbuaa_then_la1
// [40] if(0!=main::$15) goto main::@8 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b8_from___b15
// [12] phi from main::@15 to main::@1 [phi:main::@15->main::@1]
@ -5074,7 +5074,7 @@ main: {
// main::@16
__b16:
// [44] main::$17 = keyboard_key_pressed::return#3
// [45] if(0!=main::$17) goto main::@8 -- vbuc1_neq_vbuaa_then_la1
// [45] if(0!=main::$17) goto main::@8 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b8_from___b16
jmp vicSelectGfxBank2
@ -5977,7 +5977,7 @@ charsetFindOrAddGlyph: {
jmp __b5
// charsetFindOrAddGlyph::@5
__b5:
// [189] if(0==charsetFindOrAddGlyph::found#2) goto charsetFindOrAddGlyph::@6 -- vbuc1_eq_vbuaa_then_la1
// [189] if(0==charsetFindOrAddGlyph::found#2) goto charsetFindOrAddGlyph::@6 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b6
jmp __breturn_from___b5
@ -6087,7 +6087,7 @@ protoBobShiftRight: {
// [208] protoBobShiftRight::$1 = PROTO_BOB[protoBobShiftRight::j#3] & 1 -- vbuaa=pbuc1_derefidx_vbuxx_band_vbuc2
lda #1
and PROTO_BOB,x
// [209] if(0!=protoBobShiftRight::$1) goto protoBobShiftRight::@3 -- vbuc1_neq_vbuaa_then_la1
// [209] if(0!=protoBobShiftRight::$1) goto protoBobShiftRight::@3 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b3_from___b2
// [211] phi from protoBobShiftRight::@2 to protoBobShiftRight::@4 [phi:protoBobShiftRight::@2->protoBobShiftRight::@4]
@ -7130,7 +7130,7 @@ main: {
// main::@15
// [39] main::$15 = keyboard_key_pressed::return#2
// if(keyboard_key_pressed(KEY_SPACE))
// [40] if(0!=main::$15) goto main::@8 -- vbuc1_neq_vbuaa_then_la1
// [40] if(0!=main::$15) goto main::@8 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b8
// [12] phi from main::@15 to main::@1 [phi:main::@15->main::@1]
@ -7150,7 +7150,7 @@ main: {
// main::@16
// [44] main::$17 = keyboard_key_pressed::return#3
// while(keyboard_key_pressed(KEY_SPACE))
// [45] if(0!=main::$17) goto main::@8 -- vbuc1_neq_vbuaa_then_la1
// [45] if(0!=main::$17) goto main::@8 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b8
// main::vicSelectGfxBank2
@ -8029,7 +8029,7 @@ charsetFindOrAddGlyph: {
// charsetFindOrAddGlyph::@5
__b5:
// if(found)
// [189] if(0==charsetFindOrAddGlyph::found#2) goto charsetFindOrAddGlyph::@6 -- vbuc1_eq_vbuaa_then_la1
// [189] if(0==charsetFindOrAddGlyph::found#2) goto charsetFindOrAddGlyph::@6 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b6
rts
@ -8140,7 +8140,7 @@ protoBobShiftRight: {
lda #1
and PROTO_BOB,x
// (PROTO_BOB[j]&1)?0x80ub:0ub
// [209] if(0!=protoBobShiftRight::$1) goto protoBobShiftRight::@3 -- vbuc1_neq_vbuaa_then_la1
// [209] if(0!=protoBobShiftRight::$1) goto protoBobShiftRight::@3 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b3
// [211] phi from protoBobShiftRight::@2 to protoBobShiftRight::@4 [phi:protoBobShiftRight::@2->protoBobShiftRight::@4]

@ -5554,7 +5554,7 @@ main: {
// main::@15
__b15:
// [44] main::$19 = keyboard_key_pressed::return#2
// [45] if(0!=main::$19) goto main::@6 -- vbuc1_neq_vbuaa_then_la1
// [45] if(0!=main::$19) goto main::@6 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b6_from___b15
// [12] phi from main::@15 to main::@1 [phi:main::@15->main::@1]
@ -5577,7 +5577,7 @@ main: {
// main::@16
__b16:
// [49] main::$21 = keyboard_key_pressed::return#3
// [50] if(0!=main::$21) goto main::@6 -- vbuc1_neq_vbuaa_then_la1
// [50] if(0!=main::$21) goto main::@6 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b6_from___b16
jmp vicSelectGfxBank2
@ -6498,7 +6498,7 @@ bobCharsetFindOrAddGlyph: {
jmp __b5
// bobCharsetFindOrAddGlyph::@5
__b5:
// [201] if(0==bobCharsetFindOrAddGlyph::found#2) goto bobCharsetFindOrAddGlyph::@6 -- vbuc1_eq_vbuaa_then_la1
// [201] if(0==bobCharsetFindOrAddGlyph::found#2) goto bobCharsetFindOrAddGlyph::@6 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b6
jmp __breturn_from___b5
@ -6608,7 +6608,7 @@ shiftProtoBobRight: {
// [220] shiftProtoBobRight::$1 = PROTO_BOB[shiftProtoBobRight::j#3] & 1 -- vbuaa=pbuc1_derefidx_vbuxx_band_vbuc2
lda #1
and PROTO_BOB,x
// [221] if(0!=shiftProtoBobRight::$1) goto shiftProtoBobRight::@3 -- vbuc1_neq_vbuaa_then_la1
// [221] if(0!=shiftProtoBobRight::$1) goto shiftProtoBobRight::@3 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b3_from___b2
// [223] phi from shiftProtoBobRight::@2 to shiftProtoBobRight::@4 [phi:shiftProtoBobRight::@2->shiftProtoBobRight::@4]
@ -7823,7 +7823,7 @@ main: {
// main::@15
// [44] main::$19 = keyboard_key_pressed::return#2
// if(keyboard_key_pressed(KEY_SPACE))
// [45] if(0!=main::$19) goto main::@6 -- vbuc1_neq_vbuaa_then_la1
// [45] if(0!=main::$19) goto main::@6 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b6
// [12] phi from main::@15 to main::@1 [phi:main::@15->main::@1]
@ -7842,7 +7842,7 @@ main: {
// main::@16
// [49] main::$21 = keyboard_key_pressed::return#3
// while(keyboard_key_pressed(KEY_SPACE))
// [50] if(0!=main::$21) goto main::@6 -- vbuc1_neq_vbuaa_then_la1
// [50] if(0!=main::$21) goto main::@6 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b6
// main::vicSelectGfxBank2
@ -8734,7 +8734,7 @@ bobCharsetFindOrAddGlyph: {
// bobCharsetFindOrAddGlyph::@5
__b5:
// if(found)
// [201] if(0==bobCharsetFindOrAddGlyph::found#2) goto bobCharsetFindOrAddGlyph::@6 -- vbuc1_eq_vbuaa_then_la1
// [201] if(0==bobCharsetFindOrAddGlyph::found#2) goto bobCharsetFindOrAddGlyph::@6 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b6
rts
@ -8845,7 +8845,7 @@ shiftProtoBobRight: {
lda #1
and PROTO_BOB,x
// (PROTO_BOB[j]&1)?0x80ub:0ub
// [221] if(0!=shiftProtoBobRight::$1) goto shiftProtoBobRight::@3 -- vbuc1_neq_vbuaa_then_la1
// [221] if(0!=shiftProtoBobRight::$1) goto shiftProtoBobRight::@3 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b3
// [223] phi from shiftProtoBobRight::@2 to shiftProtoBobRight::@4 [phi:shiftProtoBobRight::@2->shiftProtoBobRight::@4]

@ -3849,7 +3849,7 @@ loop: {
// loop::@15
__b15:
// [88] loop::$18 = keyboard_key_pressed::return#3
// [89] if(0!=loop::$18) goto loop::@return -- vbuc1_neq_vbuaa_then_la1
// [89] if(0!=loop::$18) goto loop::@return -- 0_neq_vbuaa_then_la1
cmp #0
bne __breturn
// [42] phi from loop::@15 to loop::@1 [phi:loop::@15->loop::@1]
@ -3880,7 +3880,7 @@ exit: {
// exit::@2
__b2:
// [95] exit::$0 = keyboard_key_pressed::return#2
// [96] if(0!=exit::$0) goto exit::@1 -- vbuc1_neq_vbuaa_then_la1
// [96] if(0!=exit::$0) goto exit::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1_from___b2
jmp __breturn
@ -5641,7 +5641,7 @@ loop: {
// loop::@15
// [88] loop::$18 = keyboard_key_pressed::return#3
// if(keyboard_key_pressed(KEY_SPACE))
// [89] if(0!=loop::$18) goto loop::@return -- vbuc1_neq_vbuaa_then_la1
// [89] if(0!=loop::$18) goto loop::@return -- 0_neq_vbuaa_then_la1
cmp #0
bne __breturn
// [42] phi from loop::@15 to loop::@1 [phi:loop::@15->loop::@1]
@ -5669,7 +5669,7 @@ exit: {
// exit::@2
// [95] exit::$0 = keyboard_key_pressed::return#2
// while(keyboard_key_pressed(KEY_SPACE))
// [96] if(0!=exit::$0) goto exit::@1 -- vbuc1_neq_vbuaa_then_la1
// [96] if(0!=exit::$0) goto exit::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// exit::@return

@ -7652,7 +7652,7 @@ abs_u16: {
lda.z w+1
// [305] abs_u16::$1 = abs_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// [306] if(0!=abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [306] if(0!=abs_u16::$1) goto abs_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [308] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return]
@ -7687,7 +7687,7 @@ sgn_u16: {
lda.z w+1
// [312] sgn_u16::$1 = sgn_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// [313] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [313] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1_from_sgn_u16
// [315] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return]
@ -10594,7 +10594,7 @@ abs_u16: {
// [305] abs_u16::$1 = abs_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// if(>w&0x80)
// [306] if(0!=abs_u16::$1) goto abs_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [306] if(0!=abs_u16::$1) goto abs_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [308] phi from abs_u16 abs_u16::@1 to abs_u16::@return [phi:abs_u16/abs_u16::@1->abs_u16::@return]
@ -10630,7 +10630,7 @@ sgn_u16: {
// [312] sgn_u16::$1 = sgn_u16::$0 & $80 -- vbuaa=vbuaa_band_vbuc1
and #$80
// if(>w&0x80)
// [313] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- vbuc1_neq_vbuaa_then_la1
// [313] if(0!=sgn_u16::$1) goto sgn_u16::@1 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b1
// [315] phi from sgn_u16 to sgn_u16::@return [phi:sgn_u16->sgn_u16::@return]

@ -4379,7 +4379,7 @@ font_2x2: {
// [98] font_2x2::$1 = font_2x2::glyph_bits#2 & $80 -- vbuaa=vbuz1_band_vbuc1
lda #$80
and.z glyph_bits
// [99] if(0!=font_2x2::$1) goto font_2x2::@4 -- vbuc1_neq_vbuaa_then_la1
// [99] if(0!=font_2x2::$1) goto font_2x2::@4 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b4_from___b3
// [101] phi from font_2x2::@3 to font_2x2::@5 [phi:font_2x2::@3->font_2x2::@5]
@ -6164,7 +6164,7 @@ font_2x2: {
lda #$80
and.z glyph_bits
// (glyph_bits&0x80)?1uc:0uc
// [99] if(0!=font_2x2::$1) goto font_2x2::@4 -- vbuc1_neq_vbuaa_then_la1
// [99] if(0!=font_2x2::$1) goto font_2x2::@4 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b4
// [101] phi from font_2x2::@3 to font_2x2::@5 [phi:font_2x2::@3->font_2x2::@5]

@ -608,7 +608,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [9] if(0!=*main::msg#2) goto main::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [9] if(0!=*main::msg#2) goto main::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (msg),y
cmp #0
@ -901,7 +901,7 @@ main: {
// main::@1
__b1:
// while(*msg)
// [9] if(0!=*main::msg#2) goto main::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [9] if(0!=*main::msg#2) goto main::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (msg),y
cmp #0

@ -142,8 +142,8 @@ main: {
jmp __b19
!__b19:
// screen_buffer?MAIN_SCREEN1:MAIN_SCREEN0
lda #0
cmp.z screen_buffer
lda.z screen_buffer
cmp #0
bne __b3
lda #<MAIN_SCREEN0
sta.z __13
@ -171,8 +171,8 @@ main: {
adc.z screen_active+1
sta.z screen_active+1
// screen_buffer?MAIN_SCREEN0:MAIN_SCREEN1
lda #0
cmp.z screen_buffer
lda.z screen_buffer
cmp #0
bne __b5
lda #<MAIN_SCREEN1
sta.z screen_hidden
@ -189,8 +189,8 @@ main: {
// screencpy(screen_hidden, screen_active)
jsr screencpy
// if(y_movement)
lda #0
cmp.z y_movement
lda.z y_movement
cmp #0
beq __b7
// if(y_movement==-1)
lda #-1
@ -230,8 +230,8 @@ main: {
!__b11:
__b7:
// if(x_movement)
lda #0
cmp.z x_movement
lda.z x_movement
cmp #0
beq __b12
// if(x_movement==-1)
lda #-1
@ -311,8 +311,8 @@ main: {
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// if(screen_buffer)
// Display current screen
lda #0
cmp.z screen_buffer
lda.z screen_buffer
cmp #0
bne __b30
// VICII->MEMORY = toD018(MAIN_SCREEN0, MAIN_CHARSET)
lda #toD0183_return

@ -4275,15 +4275,15 @@ main: {
sec
sbc.z x_movement
tax
// [20] if(0==main::movement#3) goto main::@21 -- vbsc1_eq_vbsxx_then_la1
// [20] if(0==main::movement#3) goto main::@21 -- 0_eq_vbsxx_then_la1
cpx #0
beq __b21_from___b2
jmp __b27
// main::@27
__b27:
// [21] if(0!=screen_buffer#12) goto main::@3 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z screen_buffer
// [21] if(0!=screen_buffer#12) goto main::@3 -- 0_neq_vbuz1_then_la1
lda.z screen_buffer
cmp #0
bne __b3_from___b27
// [23] phi from main::@27 to main::@4 [phi:main::@27->main::@4]
__b4_from___b27:
@ -4321,9 +4321,9 @@ main: {
!:
adc.z screen_active+1
sta.z screen_active+1
// [25] if(0!=screen_buffer#12) goto main::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z screen_buffer
// [25] if(0!=screen_buffer#12) goto main::@5 -- 0_neq_vbuz1_then_la1
lda.z screen_buffer
cmp #0
bne __b5_from___b4
// [27] phi from main::@4 to main::@6 [phi:main::@4->main::@6]
__b6_from___b4:
@ -4355,9 +4355,9 @@ main: {
jmp __b33
// main::@33
__b33:
// [31] if(0==main::y_movement#0) goto main::@7 -- vbsc1_eq_vbsz1_then_la1
lda #0
cmp.z y_movement
// [31] if(0==main::y_movement#0) goto main::@7 -- 0_eq_vbsz1_then_la1
lda.z y_movement
cmp #0
beq __b7
jmp __b17
// main::@17
@ -4422,9 +4422,9 @@ main: {
jmp __b7
// main::@7
__b7:
// [42] if(0==main::x_movement#0) goto main::@12 -- vbsc1_eq_vbsz1_then_la1
lda #0
cmp.z x_movement
// [42] if(0==main::x_movement#0) goto main::@12 -- 0_eq_vbsz1_then_la1
lda.z x_movement
cmp #0
beq __b12
jmp __b19
// main::@19
@ -4543,10 +4543,10 @@ main: {
// [64] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2) = main::$46 -- _deref_pbuc1=vbuaa
// X-scroll fine
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// [65] if(0!=screen_buffer#26) goto main::toD0182 -- vbuc1_neq_vbuz1_then_la1
// [65] if(0!=screen_buffer#26) goto main::toD0182 -- 0_neq_vbuz1_then_la1
// Display current screen
lda #0
cmp.z screen_buffer
lda.z screen_buffer
cmp #0
bne toD0182_from___b23
// [66] phi from main::@23 to main::toD0183 [phi:main::@23->main::toD0183]
toD0183_from___b23:
@ -5645,16 +5645,16 @@ main: {
sbc.z x_movement
tax
// if(movement)
// [20] if(0==main::movement#3) goto main::@21 -- vbsc1_eq_vbsxx_then_la1
// [20] if(0==main::movement#3) goto main::@21 -- 0_eq_vbsxx_then_la1
cpx #0
bne !__b19+
jmp __b19
!__b19:
// main::@27
// screen_buffer?MAIN_SCREEN1:MAIN_SCREEN0
// [21] if(0!=screen_buffer#12) goto main::@3 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z screen_buffer
// [21] if(0!=screen_buffer#12) goto main::@3 -- 0_neq_vbuz1_then_la1
lda.z screen_buffer
cmp #0
bne __b3
// [23] phi from main::@27 to main::@4 [phi:main::@27->main::@4]
// [23] phi main::$13 = MAIN_SCREEN0 [phi:main::@27->main::@4#0] -- pbuz1=pbuc1
@ -5690,9 +5690,9 @@ main: {
adc.z screen_active+1
sta.z screen_active+1
// screen_buffer?MAIN_SCREEN0:MAIN_SCREEN1
// [25] if(0!=screen_buffer#12) goto main::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z screen_buffer
// [25] if(0!=screen_buffer#12) goto main::@5 -- 0_neq_vbuz1_then_la1
lda.z screen_buffer
cmp #0
bne __b5
// [27] phi from main::@4 to main::@6 [phi:main::@4->main::@6]
// [27] phi main::screen_hidden#0 = MAIN_SCREEN1 [phi:main::@4->main::@6#0] -- pbuz1=pbuc1
@ -5720,9 +5720,9 @@ main: {
jsr screencpy
// main::@33
// if(y_movement)
// [31] if(0==main::y_movement#0) goto main::@7 -- vbsc1_eq_vbsz1_then_la1
lda #0
cmp.z y_movement
// [31] if(0==main::y_movement#0) goto main::@7 -- 0_eq_vbsz1_then_la1
lda.z y_movement
cmp #0
beq __b7
// main::@17
// if(y_movement==-1)
@ -5784,9 +5784,9 @@ main: {
// main::@7
__b7:
// if(x_movement)
// [42] if(0==main::x_movement#0) goto main::@12 -- vbsc1_eq_vbsz1_then_la1
lda #0
cmp.z x_movement
// [42] if(0==main::x_movement#0) goto main::@12 -- 0_eq_vbsz1_then_la1
lda.z x_movement
cmp #0
beq __b12
// main::@19
// if(x_movement==-1)
@ -5905,10 +5905,10 @@ main: {
// X-scroll fine
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// if(screen_buffer)
// [65] if(0!=screen_buffer#26) goto main::toD0182 -- vbuc1_neq_vbuz1_then_la1
// [65] if(0!=screen_buffer#26) goto main::toD0182 -- 0_neq_vbuz1_then_la1
// Display current screen
lda #0
cmp.z screen_buffer
lda.z screen_buffer
cmp #0
bne __b30
// [66] phi from main::@23 to main::toD0183 [phi:main::@23->main::toD0183]
// main::toD0183

@ -40,13 +40,9 @@ main: {
// loop word
__b7:
// if(i)
lda #0
cmp.z i1
bne !+
lda.z i1+1
bne !+
jmp __b8
!:
lda.z i1
ora.z i1+1
beq __b8
// SCREEN[idx++] = '+'
lda #'+'
sta SCREEN,y

@ -370,8 +370,8 @@ REGISTER UPLIFT SCOPES
Uplift Scope [main] 52.33: zp[1]:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] 45.92: zp[1]:3 [ main::idx#10 main::idx#11 main::idx#4 ] 23.1: zp[1]:2 [ main::i#2 main::i#1 ] 23.1: zp[2]:4 [ main::i1#2 main::i1#1 ]
Uplift Scope []
Uplifting [main] best 1225 combination reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] reg byte y [ main::idx#10 main::idx#11 main::idx#4 ] reg byte x [ main::i#2 main::i#1 ] zp[2]:4 [ main::i1#2 main::i1#1 ]
Uplifting [] best 1225 combination
Uplifting [main] best 1150 combination reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] reg byte y [ main::idx#10 main::idx#11 main::idx#4 ] reg byte x [ main::i#2 main::i#1 ] zp[2]:4 [ main::i1#2 main::i1#1 ]
Uplifting [] best 1150 combination
Allocated (was zp[2]:4) zp[2]:2 [ main::i1#2 main::i1#1 ]
ASSEMBLER BEFORE OPTIMIZATION
@ -414,7 +414,7 @@ main: {
jmp __b3
// main::@3
__b3:
// [4] if(0==main::i#2) goto main::@4 -- vbuc1_eq_vbuxx_then_la1
// [4] if(0==main::i#2) goto main::@4 -- 0_eq_vbuxx_then_la1
cpx #0
beq __b4_from___b3
jmp __b5
@ -462,14 +462,10 @@ main: {
jmp __b7
// main::@7
__b7:
// [13] if(0==main::i1#2) goto main::@8 -- vbuc1_eq_vwuz1_then_la1
lda #0
cmp.z i1
bne !+
lda.z i1+1
bne !+
jmp __b8_from___b7
!:
// [13] if(0==main::i1#2) goto main::@8 -- 0_eq_vwuz1_then_la1
lda.z i1
ora.z i1+1
beq __b8_from___b7
jmp __b9
// main::@9
__b9:
@ -569,7 +565,7 @@ reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
FINAL ASSEMBLER
Score: 872
Score: 797
// File Comments
// Tests using integer conditions in if()
@ -605,7 +601,7 @@ main: {
// main::@3
__b3:
// if(i)
// [4] if(0==main::i#2) goto main::@4 -- vbuc1_eq_vbuxx_then_la1
// [4] if(0==main::i#2) goto main::@4 -- 0_eq_vbuxx_then_la1
cpx #0
beq __b4
// main::@5
@ -647,14 +643,10 @@ main: {
// main::@7
__b7:
// if(i)
// [13] if(0==main::i1#2) goto main::@8 -- vbuc1_eq_vwuz1_then_la1
lda #0
cmp.z i1
bne !+
lda.z i1+1
bne !+
jmp __b8
!:
// [13] if(0==main::i1#2) goto main::@8 -- 0_eq_vwuz1_then_la1
lda.z i1
ora.z i1+1
beq __b8
// main::@9
// SCREEN[idx++] = '+'
// [14] SCREEN[main::idx#12] = '+' -- pbuc1_derefidx_vbuyy=vbuc2

@ -40,11 +40,8 @@ main: {
// loop word
__b7:
// if(!i)
lda.z i1+1
cmp #>0
bne __b8
lda.z i1
cmp #<0
ora.z i1+1
bne __b8
// SCREEN[idx++] = '0'
lda #'0'

@ -372,8 +372,8 @@ REGISTER UPLIFT SCOPES
Uplift Scope [main] 52.33: zp[1]:6 [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] 45.92: zp[1]:3 [ main::idx#10 main::idx#11 main::idx#4 ] 23.1: zp[1]:2 [ main::i#2 main::i#1 ] 23.1: zp[2]:4 [ main::i1#2 main::i1#1 ]
Uplift Scope []
Uplifting [main] best 1215 combination reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] reg byte y [ main::idx#10 main::idx#11 main::idx#4 ] reg byte x [ main::i#2 main::i#1 ] zp[2]:4 [ main::i1#2 main::i1#1 ]
Uplifting [] best 1215 combination
Uplifting [main] best 1150 combination reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ] reg byte y [ main::idx#10 main::idx#11 main::idx#4 ] reg byte x [ main::i#2 main::i#1 ] zp[2]:4 [ main::i1#2 main::i1#1 ]
Uplifting [] best 1150 combination
Allocated (was zp[2]:4) zp[2]:2 [ main::i1#2 main::i1#1 ]
ASSEMBLER BEFORE OPTIMIZATION
@ -416,7 +416,7 @@ main: {
jmp __b3
// main::@3
__b3:
// [4] if(0!=main::i#2) goto main::@4 -- vbuc1_neq_vbuxx_then_la1
// [4] if(0!=main::i#2) goto main::@4 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b4_from___b3
jmp __b5
@ -464,12 +464,9 @@ main: {
jmp __b7
// main::@7
__b7:
// [13] if(0!=main::i1#2) goto main::@8 -- vwuc1_neq_vwuz1_then_la1
lda.z i1+1
cmp #>0
bne __b8_from___b7
// [13] if(0!=main::i1#2) goto main::@8 -- 0_neq_vwuz1_then_la1
lda.z i1
cmp #<0
ora.z i1+1
bne __b8_from___b7
jmp __b9
// main::@9
@ -523,7 +520,6 @@ Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __b4_from___b3 with __b4
Replacing label __b3_from___b4 with __b3
Replacing label __b8_from___b7 with __b8
Replacing label __b8_from___b7 with __b8
Replacing label __b7_from___b8 with __b7
Replacing label __b7_from___b8 with __b7
Removing instruction __b3_from___b4:
@ -571,7 +567,7 @@ reg byte y [ main::idx#12 main::idx#17 main::idx#5 main::idx#6 ]
FINAL ASSEMBLER
Score: 862
Score: 797
// File Comments
// Tests using integer conditions in if()
@ -607,7 +603,7 @@ main: {
// main::@3
__b3:
// if(!i)
// [4] if(0!=main::i#2) goto main::@4 -- vbuc1_neq_vbuxx_then_la1
// [4] if(0!=main::i#2) goto main::@4 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b4
// main::@5
@ -649,12 +645,9 @@ main: {
// main::@7
__b7:
// if(!i)
// [13] if(0!=main::i1#2) goto main::@8 -- vwuc1_neq_vwuz1_then_la1
lda.z i1+1
cmp #>0
bne __b8
// [13] if(0!=main::i1#2) goto main::@8 -- 0_neq_vwuz1_then_la1
lda.z i1
cmp #<0
ora.z i1+1
bne __b8
// main::@9
// SCREEN[idx++] = '0'

@ -25,8 +25,8 @@ main: {
// while( j-- )
ldy.z j
dey
lda #0
cmp.z j
lda.z j
cmp #0
bne __b5
// SCREEN[idx++] = ' '
lda #' '

@ -350,7 +350,7 @@ main: {
// for()
// main::@1
__b1:
// [2] if(0!=main::i#2) goto main::@2 -- vbuc1_neq_vbuaa_then_la1
// [2] if(0!=main::i#2) goto main::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __b3
@ -373,9 +373,9 @@ main: {
// [6] main::j#1 = -- main::j#2 -- vbuyy=_dec_vbuz1
ldy.z j
dey
// [7] if(0!=main::j#2) goto main::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z j
// [7] if(0!=main::j#2) goto main::@5 -- 0_neq_vbuz1_then_la1
lda.z j
cmp #0
bne __b5
jmp __b6
// main::@6
@ -404,7 +404,7 @@ main: {
txa
sec
sbc #1
// [14] if(0!=main::k#2) goto main::@8 -- vbuc1_neq_vbuxx_then_la1
// [14] if(0!=main::k#2) goto main::@8 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b8
jmp __breturn
@ -530,7 +530,7 @@ main: {
// main::@1
__b1:
// for( byte i=2;i;i--)
// [2] if(0!=main::i#2) goto main::@2 -- vbuc1_neq_vbuaa_then_la1
// [2] if(0!=main::i#2) goto main::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// main::@3
@ -552,9 +552,9 @@ main: {
// [6] main::j#1 = -- main::j#2 -- vbuyy=_dec_vbuz1
ldy.z j
dey
// [7] if(0!=main::j#2) goto main::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z j
// [7] if(0!=main::j#2) goto main::@5 -- 0_neq_vbuz1_then_la1
lda.z j
cmp #0
bne __b5
// main::@6
// SCREEN[idx++] = ' '
@ -584,7 +584,7 @@ main: {
txa
sec
sbc #1
// [14] if(0!=main::k#2) goto main::@8 -- vbuc1_neq_vbuxx_then_la1
// [14] if(0!=main::k#2) goto main::@8 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b8
// main::@return

@ -217,7 +217,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [2] if(0!=main::i#2) goto main::@2 -- vbsc1_neq_vbsyy_then_la1
// [2] if(0!=main::i#2) goto main::@2 -- 0_neq_vbsyy_then_la1
cpy #0
bne __b2_from___b1
// [4] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
@ -315,7 +315,7 @@ main: {
// main::@1
__b1:
// i?'+':'0'
// [2] if(0!=main::i#2) goto main::@2 -- vbsc1_neq_vbsyy_then_la1
// [2] if(0!=main::i#2) goto main::@2 -- 0_neq_vbsyy_then_la1
cpy #0
bne __b2
// [4] phi from main::@1 to main::@3 [phi:main::@1->main::@3]

@ -14,8 +14,8 @@ main: {
lda #1
sax.z __4
// if(i&1)
lda #0
cmp.z __4
lda.z __4
cmp #0
beq __b2
// (SCREEN+40*0)[idx] = '+'
lda #'+'
@ -25,28 +25,30 @@ main: {
lda #2
sax.z __5
// if(i&2)
lda #0
cmp.z __5
lda.z __5
cmp #0
beq __b3
// (SCREEN+40*1)[idx] = '+'
lda #'+'
sta SCREEN+$28*1,y
__b3:
// if(i&1 && i&2)
lda #0
cmp.z __4
lda.z __4
cmp #0
beq __b4
cmp.z __5
lda.z __5
cmp #0
beq __b4
// (SCREEN+40*2)[idx] = '+'
lda #'+'
sta SCREEN+$28*2,y
__b4:
// if(i&1 || i&2)
lda #0
cmp.z __4
lda.z __4
cmp #0
bne __b9
cmp.z __5
lda.z __5
cmp #0
beq __b5
__b9:
// (SCREEN+40*3)[idx] = '+'

@ -414,9 +414,9 @@ main: {
// [2] main::$4 = main::i#10 & 1 -- vbuz1=vbuxx_band_vbuc1
lda #1
sax.z __4
// [3] if(0==main::$4) goto main::@2 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __4
// [3] if(0==main::$4) goto main::@2 -- 0_eq_vbuz1_then_la1
lda.z __4
cmp #0
beq __b2
jmp __b6
// main::@6
@ -430,9 +430,9 @@ main: {
// [5] main::$5 = main::i#10 & 2 -- vbuz1=vbuxx_band_vbuc1
lda #2
sax.z __5
// [6] if(0==main::$5) goto main::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __5
// [6] if(0==main::$5) goto main::@3 -- 0_eq_vbuz1_then_la1
lda.z __5
cmp #0
beq __b3
jmp __b7
// main::@7
@ -443,16 +443,16 @@ main: {
jmp __b3
// main::@3
__b3:
// [8] if(0==main::$4) goto main::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __4
// [8] if(0==main::$4) goto main::@4 -- 0_eq_vbuz1_then_la1
lda.z __4
cmp #0
beq __b4
jmp __b10
// main::@10
__b10:
// [9] if(0==main::$5) goto main::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __5
// [9] if(0==main::$5) goto main::@4 -- 0_eq_vbuz1_then_la1
lda.z __5
cmp #0
beq __b4
jmp __b8
// main::@8
@ -463,16 +463,16 @@ main: {
jmp __b4
// main::@4
__b4:
// [11] if(0!=main::$4) goto main::@9 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z __4
// [11] if(0!=main::$4) goto main::@9 -- 0_neq_vbuz1_then_la1
lda.z __4
cmp #0
bne __b9
jmp __b11
// main::@11
__b11:
// [12] if(0==main::$5) goto main::@5 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __5
// [12] if(0==main::$5) goto main::@5 -- 0_eq_vbuz1_then_la1
lda.z __5
cmp #0
beq __b5
jmp __b9
// main::@9
@ -525,9 +525,6 @@ Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #0
Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
FINAL SYMBOL TABLE
const nomodify byte* SCREEN = (byte*) 1024
@ -548,7 +545,7 @@ zp[1]:3 [ main::$5 ]
FINAL ASSEMBLER
Score: 921
Score: 961
// File Comments
// Tests using integer conditions in && and || operator
@ -578,9 +575,9 @@ main: {
lda #1
sax.z __4
// if(i&1)
// [3] if(0==main::$4) goto main::@2 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __4
// [3] if(0==main::$4) goto main::@2 -- 0_eq_vbuz1_then_la1
lda.z __4
cmp #0
beq __b2
// main::@6
// (SCREEN+40*0)[idx] = '+'
@ -594,9 +591,9 @@ main: {
lda #2
sax.z __5
// if(i&2)
// [6] if(0==main::$5) goto main::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __5
// [6] if(0==main::$5) goto main::@3 -- 0_eq_vbuz1_then_la1
lda.z __5
cmp #0
beq __b3
// main::@7
// (SCREEN+40*1)[idx] = '+'
@ -606,13 +603,14 @@ main: {
// main::@3
__b3:
// if(i&1 && i&2)
// [8] if(0==main::$4) goto main::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __4
// [8] if(0==main::$4) goto main::@4 -- 0_eq_vbuz1_then_la1
lda.z __4
cmp #0
beq __b4
// main::@10
// [9] if(0==main::$5) goto main::@4 -- vbuc1_eq_vbuz1_then_la1
cmp.z __5
// [9] if(0==main::$5) goto main::@4 -- 0_eq_vbuz1_then_la1
lda.z __5
cmp #0
beq __b4
// main::@8
// (SCREEN+40*2)[idx] = '+'
@ -622,13 +620,14 @@ main: {
// main::@4
__b4:
// if(i&1 || i&2)
// [11] if(0!=main::$4) goto main::@9 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z __4
// [11] if(0!=main::$4) goto main::@9 -- 0_neq_vbuz1_then_la1
lda.z __4
cmp #0
bne __b9
// main::@11
// [12] if(0==main::$5) goto main::@5 -- vbuc1_eq_vbuz1_then_la1
cmp.z __5
// [12] if(0==main::$5) goto main::@5 -- 0_eq_vbuz1_then_la1
lda.z __5
cmp #0
beq __b5
// main::@9
__b9:

@ -2115,7 +2115,7 @@ print_str: {
jmp __b1
// print_str::@1
__b1:
// [63] if(0!=*print_str::str#10) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [63] if(0!=*print_str::str#10) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -2845,7 +2845,7 @@ print_str: {
// print_str::@1
__b1:
// while(*str)
// [63] if(0!=*print_str::str#10) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [63] if(0!=*print_str::str#10) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -2825,7 +2825,7 @@ atan2_16: {
jmp __b15
// atan2_16::@15
__b15:
// [77] if(0==atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
// [77] if(0==atan2_16::shift#2) goto atan2_16::@17 -- 0_eq_vbuyy_then_la1
cpy #0
beq __b17_from___b15
jmp __b16
@ -3947,7 +3947,7 @@ atan2_16: {
bcs __b14
// atan2_16::@15
// if(shift)
// [77] if(0==atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
// [77] if(0==atan2_16::shift#2) goto atan2_16::@17 -- 0_eq_vbuyy_then_la1
cpy #0
beq __b17
// atan2_16::@16

@ -2173,7 +2173,7 @@ atan2_16: {
jmp __b15
// atan2_16::@15
__b15:
// [67] if(0==atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
// [67] if(0==atan2_16::shift#2) goto atan2_16::@17 -- 0_eq_vbuyy_then_la1
cpy #0
beq __b17_from___b15
jmp __b16
@ -3012,7 +3012,7 @@ atan2_16: {
bcs __b14
// atan2_16::@15
// if(shift)
// [67] if(0==atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
// [67] if(0==atan2_16::shift#2) goto atan2_16::@17 -- 0_eq_vbuyy_then_la1
cpy #0
beq __b17
// atan2_16::@16

@ -2586,7 +2586,7 @@ atan2_16: {
jmp __b15
// atan2_16::@15
__b15:
// [85] if(0==atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
// [85] if(0==atan2_16::shift#2) goto atan2_16::@17 -- 0_eq_vbuyy_then_la1
cpy #0
beq __b17_from___b15
jmp __b16
@ -3579,7 +3579,7 @@ atan2_16: {
bcs __b14
// atan2_16::@15
// if(shift)
// [85] if(0==atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
// [85] if(0==atan2_16::shift#2) goto atan2_16::@17 -- 0_eq_vbuyy_then_la1
cpy #0
beq __b17
// atan2_16::@16

@ -209,8 +209,7 @@ atan2_8: {
sta.z i
__b10:
// if(yi==0)
txa
cmp #0
cpx #0
bne __b11
__b12:
// angle = angle/2

@ -1279,14 +1279,13 @@ Removing always clobbered register reg byte a as potential for zp[1]:22 [ atan2_
Statement [44] if(atan2_8::x#0>0) goto atan2_8::@4 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#0 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#0 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:16 [ atan2_8::yi#3 atan2_8::yi#7 atan2_8::yi#0 atan2_8::yi#11 atan2_8::$2 atan2_8::yi#1 atan2_8::yi#2 ]
Statement [45] atan2_8::$7 = - atan2_8::x#0 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#0 atan2_8::$7 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#0 atan2_8::$7 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [48] if(atan2_8::yi#3!=0) goto atan2_8::@11 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:17 [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ]
Removing always clobbered register reg byte a as potential for zp[1]:18 [ atan2_8::i#2 atan2_8::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:19 [ atan2_8::angle#6 atan2_8::angle#12 atan2_8::angle#13 atan2_8::angle#2 atan2_8::angle#3 ]
Statement [50] atan2_8::angle#1 = atan2_8::angle#6 >> 1 [ atan2_8::x#0 atan2_8::y#0 atan2_8::angle#1 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::angle#1 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [52] atan2_8::angle#4 = $80 - atan2_8::angle#1 [ atan2_8::y#0 atan2_8::angle#4 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::y#0 atan2_8::angle#4 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [55] atan2_8::angle#5 = - atan2_8::angle#11 [ atan2_8::angle#5 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::angle#5 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [58] atan2_8::xd#0 = atan2_8::xi#3 >> atan2_8::i#2 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:17 [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ]
Removing always clobbered register reg byte a as potential for zp[1]:18 [ atan2_8::i#2 atan2_8::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:19 [ atan2_8::angle#6 atan2_8::angle#12 atan2_8::angle#13 atan2_8::angle#2 atan2_8::angle#3 ]
Statement [59] atan2_8::yd#0 = atan2_8::yi#3 >> atan2_8::i#2 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 atan2_8::yd#0 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 atan2_8::yd#0 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:29 [ atan2_8::xd#0 ]
Statement [60] if(atan2_8::yi#3>0) goto atan2_8::@13 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 atan2_8::yd#0 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 atan2_8::xd#0 atan2_8::yd#0 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
@ -1311,7 +1310,6 @@ Statement [41] if(atan2_8::y#0>0) goto atan2_8::@1 [ atan2_8::x#0 atan2_8::y#0 ]
Statement [42] atan2_8::$2 = - atan2_8::y#0 [ atan2_8::x#0 atan2_8::y#0 atan2_8::$2 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::$2 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [44] if(atan2_8::x#0>0) goto atan2_8::@4 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#0 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#0 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [45] atan2_8::$7 = - atan2_8::x#0 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#0 atan2_8::$7 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#0 atan2_8::$7 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [48] if(atan2_8::yi#3!=0) goto atan2_8::@11 [ atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::yi#3 atan2_8::xi#3 atan2_8::i#2 atan2_8::angle#12 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [50] atan2_8::angle#1 = atan2_8::angle#6 >> 1 [ atan2_8::x#0 atan2_8::y#0 atan2_8::angle#1 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::x#0 atan2_8::y#0 atan2_8::angle#1 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [52] atan2_8::angle#4 = $80 - atan2_8::angle#1 [ atan2_8::y#0 atan2_8::angle#4 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::y#0 atan2_8::angle#4 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
Statement [55] atan2_8::angle#5 = - atan2_8::angle#11 [ atan2_8::angle#5 ] ( atan2_8:8 [ main::y#4 main::x#2 main::screen#2 atan2_8::angle#5 ] { { atan2_8::x#0 = main::x#2 } { atan2_8::y#0 = main::y#4 } { atan2_8::return#0 = atan2_8::return#2 } } ) always clobbers reg byte a
@ -1359,47 +1357,47 @@ Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope []
Uplifting [atan2_8] best 278261 combination zp[1]:19 [ atan2_8::angle#6 atan2_8::angle#12 atan2_8::angle#13 atan2_8::angle#2 atan2_8::angle#3 ] reg byte x [ atan2_8::yi#3 atan2_8::yi#7 atan2_8::yi#0 atan2_8::yi#11 atan2_8::$2 atan2_8::yi#1 atan2_8::yi#2 ] zp[1]:17 [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ] zp[1]:18 [ atan2_8::i#2 atan2_8::i#1 ] zp[1]:30 [ atan2_8::yd#0 ] zp[1]:29 [ atan2_8::xd#0 ] zp[1]:20 [ atan2_8::return#0 atan2_8::angle#11 atan2_8::angle#1 atan2_8::angle#4 atan2_8::angle#5 ] zp[1]:23 [ atan2_8::return#2 ] zp[1]:21 [ atan2_8::x#0 ] zp[1]:22 [ atan2_8::y#0 ]
Uplifting [atan2_8] best 276261 combination zp[1]:19 [ atan2_8::angle#6 atan2_8::angle#12 atan2_8::angle#13 atan2_8::angle#2 atan2_8::angle#3 ] reg byte x [ atan2_8::yi#3 atan2_8::yi#7 atan2_8::yi#0 atan2_8::yi#11 atan2_8::$2 atan2_8::yi#1 atan2_8::yi#2 ] zp[1]:17 [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ] zp[1]:18 [ atan2_8::i#2 atan2_8::i#1 ] zp[1]:30 [ atan2_8::yd#0 ] zp[1]:29 [ atan2_8::xd#0 ] zp[1]:20 [ atan2_8::return#0 atan2_8::angle#11 atan2_8::angle#1 atan2_8::angle#4 atan2_8::angle#5 ] zp[1]:23 [ atan2_8::return#2 ] zp[1]:21 [ atan2_8::x#0 ] zp[1]:22 [ atan2_8::y#0 ]
Limited combination testing to 100 combinations of 104976 possible.
Uplifting [init_font_hex] best 259261 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp[1]:15 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp[1]:25 [ init_font_hex::$0 ] zp[1]:28 [ init_font_hex::idx#3 ] zp[1]:13 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp[2]:9 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp[2]:11 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp[2]:6 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp[1]:8 [ init_font_hex::c#6 init_font_hex::c#1 ]
Uplifting [init_font_hex] best 257261 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp[1]:15 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp[1]:25 [ init_font_hex::$0 ] zp[1]:28 [ init_font_hex::idx#3 ] zp[1]:13 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp[2]:9 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp[2]:11 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp[2]:6 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp[1]:8 [ init_font_hex::c#6 init_font_hex::c#1 ]
Limited combination testing to 100 combinations of 6912 possible.
Uplifting [main] best 258661 combination reg byte a [ main::angle#0 ] zp[1]:3 [ main::x#2 main::x#1 ] zp[2]:4 [ main::screen#2 main::screen#4 main::screen#1 ] zp[1]:2 [ main::y#4 main::y#1 ]
Uplifting [MOS6526_CIA] best 258661 combination
Uplifting [MOS6569_VICII] best 258661 combination
Uplifting [MOS6581_SID] best 258661 combination
Uplifting [] best 258661 combination
Uplifting [main] best 256661 combination reg byte a [ main::angle#0 ] zp[1]:3 [ main::x#2 main::x#1 ] zp[2]:4 [ main::screen#2 main::screen#4 main::screen#1 ] zp[1]:2 [ main::y#4 main::y#1 ]
Uplifting [MOS6526_CIA] best 256661 combination
Uplifting [MOS6569_VICII] best 256661 combination
Uplifting [MOS6581_SID] best 256661 combination
Uplifting [] best 256661 combination
Attempting to uplift remaining variables inzp[1]:19 [ atan2_8::angle#6 atan2_8::angle#12 atan2_8::angle#13 atan2_8::angle#2 atan2_8::angle#3 ]
Uplifting [atan2_8] best 258661 combination zp[1]:19 [ atan2_8::angle#6 atan2_8::angle#12 atan2_8::angle#13 atan2_8::angle#2 atan2_8::angle#3 ]
Uplifting [atan2_8] best 256661 combination zp[1]:19 [ atan2_8::angle#6 atan2_8::angle#12 atan2_8::angle#13 atan2_8::angle#2 atan2_8::angle#3 ]
Attempting to uplift remaining variables inzp[1]:17 [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ]
Uplifting [atan2_8] best 258661 combination zp[1]:17 [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ]
Uplifting [atan2_8] best 256661 combination zp[1]:17 [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ]
Attempting to uplift remaining variables inzp[1]:18 [ atan2_8::i#2 atan2_8::i#1 ]
Uplifting [atan2_8] best 258661 combination zp[1]:18 [ atan2_8::i#2 atan2_8::i#1 ]
Uplifting [atan2_8] best 256661 combination zp[1]:18 [ atan2_8::i#2 atan2_8::i#1 ]
Attempting to uplift remaining variables inzp[1]:30 [ atan2_8::yd#0 ]
Uplifting [atan2_8] best 257661 combination reg byte y [ atan2_8::yd#0 ]
Uplifting [atan2_8] best 255661 combination reg byte y [ atan2_8::yd#0 ]
Attempting to uplift remaining variables inzp[1]:29 [ atan2_8::xd#0 ]
Uplifting [atan2_8] best 257661 combination zp[1]:29 [ atan2_8::xd#0 ]
Uplifting [atan2_8] best 255661 combination zp[1]:29 [ atan2_8::xd#0 ]
Attempting to uplift remaining variables inzp[1]:15 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
Uplifting [init_font_hex] best 257661 combination zp[1]:15 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
Uplifting [init_font_hex] best 255661 combination zp[1]:15 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
Attempting to uplift remaining variables inzp[1]:25 [ init_font_hex::$0 ]
Uplifting [init_font_hex] best 257661 combination zp[1]:25 [ init_font_hex::$0 ]
Uplifting [init_font_hex] best 255661 combination zp[1]:25 [ init_font_hex::$0 ]
Attempting to uplift remaining variables inzp[1]:20 [ atan2_8::return#0 atan2_8::angle#11 atan2_8::angle#1 atan2_8::angle#4 atan2_8::angle#5 ]
Uplifting [atan2_8] best 257354 combination reg byte x [ atan2_8::return#0 atan2_8::angle#11 atan2_8::angle#1 atan2_8::angle#4 atan2_8::angle#5 ]
Uplifting [atan2_8] best 255354 combination reg byte x [ atan2_8::return#0 atan2_8::angle#11 atan2_8::angle#1 atan2_8::angle#4 atan2_8::angle#5 ]
Attempting to uplift remaining variables inzp[1]:28 [ init_font_hex::idx#3 ]
Uplifting [init_font_hex] best 256754 combination reg byte y [ init_font_hex::idx#3 ]
Uplifting [init_font_hex] best 254754 combination reg byte y [ init_font_hex::idx#3 ]
Attempting to uplift remaining variables inzp[1]:13 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Uplifting [init_font_hex] best 256754 combination zp[1]:13 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Uplifting [init_font_hex] best 254754 combination zp[1]:13 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Attempting to uplift remaining variables inzp[1]:23 [ atan2_8::return#2 ]
Uplifting [atan2_8] best 256354 combination reg byte a [ atan2_8::return#2 ]
Uplifting [atan2_8] best 254354 combination reg byte a [ atan2_8::return#2 ]
Attempting to uplift remaining variables inzp[1]:3 [ main::x#2 main::x#1 ]
Uplifting [main] best 256354 combination zp[1]:3 [ main::x#2 main::x#1 ]
Uplifting [main] best 254354 combination zp[1]:3 [ main::x#2 main::x#1 ]
Attempting to uplift remaining variables inzp[1]:8 [ init_font_hex::c#6 init_font_hex::c#1 ]
Uplifting [init_font_hex] best 256354 combination zp[1]:8 [ init_font_hex::c#6 init_font_hex::c#1 ]
Uplifting [init_font_hex] best 254354 combination zp[1]:8 [ init_font_hex::c#6 init_font_hex::c#1 ]
Attempting to uplift remaining variables inzp[1]:21 [ atan2_8::x#0 ]
Uplifting [atan2_8] best 256354 combination zp[1]:21 [ atan2_8::x#0 ]
Uplifting [atan2_8] best 254354 combination zp[1]:21 [ atan2_8::x#0 ]
Attempting to uplift remaining variables inzp[1]:22 [ atan2_8::y#0 ]
Uplifting [atan2_8] best 256354 combination zp[1]:22 [ atan2_8::y#0 ]
Uplifting [atan2_8] best 254354 combination zp[1]:22 [ atan2_8::y#0 ]
Attempting to uplift remaining variables inzp[1]:2 [ main::y#4 main::y#1 ]
Uplifting [main] best 256354 combination zp[1]:2 [ main::y#4 main::y#1 ]
Uplifting [main] best 254354 combination zp[1]:2 [ main::y#4 main::y#1 ]
Coalescing zero page register [ zp[1]:2 [ main::y#4 main::y#1 ] ] with [ zp[1]:22 [ atan2_8::y#0 ] ] - score: 1
Coalescing zero page register [ zp[1]:3 [ main::x#2 main::x#1 ] ] with [ zp[1]:21 [ atan2_8::x#0 ] ] - score: 1
Coalescing zero page register [ zp[1]:17 [ atan2_8::xi#3 atan2_8::xi#7 atan2_8::xi#0 atan2_8::xi#8 atan2_8::$7 atan2_8::xi#1 atan2_8::xi#2 ] ] with [ zp[1]:8 [ init_font_hex::c#6 init_font_hex::c#1 ] ]
@ -1752,8 +1750,7 @@ atan2_8: {
// atan2_8::@10
__b10:
// [48] if(atan2_8::yi#3!=0) goto atan2_8::@11 -- vbsxx_neq_0_then_la1
txa
cmp #0
cpx #0
bne __b11
// [49] phi from atan2_8::@10 atan2_8::@14 to atan2_8::@12 [phi:atan2_8::@10/atan2_8::@14->atan2_8::@12]
__b12_from___b10:
@ -2134,7 +2131,7 @@ reg byte y [ atan2_8::yd#0 ]
FINAL ASSEMBLER
Score: 232290
Score: 230290
// File Comments
// Find atan2(x, y) using the CORDIC method
@ -2454,8 +2451,7 @@ atan2_8: {
__b10:
// if(yi==0)
// [48] if(atan2_8::yi#3!=0) goto atan2_8::@11 -- vbsxx_neq_0_then_la1
txa
cmp #0
cpx #0
bne __b11
// [49] phi from atan2_8::@10 atan2_8::@14 to atan2_8::@12 [phi:atan2_8::@10/atan2_8::@14->atan2_8::@12]
// [49] phi atan2_8::angle#6 = atan2_8::angle#12 [phi:atan2_8::@10/atan2_8::@14->atan2_8::@12#0] -- register_copy

@ -517,8 +517,8 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
ldx.z __19
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b13
// len++;
inx
@ -537,12 +537,14 @@ printf_number_buffer: {
sta.z padding
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
lda #0
cmp.z format_justify_left
lda.z format_justify_left
cmp #0
bne __b2
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
bne __b2
cmp.z padding
lda.z padding
cmp #0
bne __b8
jmp __b2
__b8:
@ -554,18 +556,18 @@ printf_number_buffer: {
jsr printf_padding
__b2:
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b3
// cputc(buffer.sign)
lda.z buffer_sign
jsr cputc
__b3:
// if(format.zero_padding && padding)
lda #0
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
beq __b4
cmp.z padding
lda.z padding
cmp #0
bne __b10
jmp __b4
__b10:
@ -577,8 +579,8 @@ printf_number_buffer: {
jsr printf_padding
__b4:
// if(format.upper_case)
lda #0
cmp.z format_upper_case
lda.z format_upper_case
cmp #0
beq __b5
// strupr(buffer.digits)
jsr strupr
@ -590,12 +592,14 @@ printf_number_buffer: {
sta.z cputs.s+1
jsr cputs
// if(format.justify_left && !format.zero_padding && padding)
lda #0
cmp.z format_justify_left
lda.z format_justify_left
cmp #0
beq __breturn
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
bne __breturn
cmp.z padding
lda.z padding
cmp #0
bne __b12
rts
__b12:

@ -7559,7 +7559,7 @@ cputs: {
lda (s),y
// [67] cputs::s#0 = ++ cputs::s#11 -- pbuz1=_inc_pbuz1
inw.z s
// [68] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [68] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -7689,7 +7689,7 @@ queens: {
// queens::@9
__b9:
// [86] queens::$2 = legal::return#0
// [87] if(0==queens::$2) goto queens::@1 -- vbuc1_eq_vbuaa_then_la1
// [87] if(0==queens::$2) goto queens::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1_from___b9
jmp __b6
@ -7902,7 +7902,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [124] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuzz_then_la1
// [124] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuzz_then_la1
cpz #0
bne __b5
jmp __b7
@ -7969,7 +7969,7 @@ printf_number_buffer: {
.label format_zero_padding = $11
.label format_justify_left = $c
.label format_upper_case = $29
// [136] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- vbuc1_eq_vbuzz_then_la1
// [136] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuzz_then_la1
cpz #0
beq __b1_from_printf_number_buffer
// [137] phi from printf_number_buffer to printf_number_buffer::@6 [phi:printf_number_buffer->printf_number_buffer::@6]
@ -7989,9 +7989,9 @@ printf_number_buffer: {
// [141] printf_number_buffer::len#0 = (signed byte)printf_number_buffer::$19 -- vbsxx=_sbyte_vwuz1
// There is a minimum length - work out the padding
ldx.z __19
// [142] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [142] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b13_from___b14
jmp __b7
// printf_number_buffer::@7
@ -8033,23 +8033,23 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [149] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [149] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
bne __b2
jmp __b17
// printf_number_buffer::@17
__b17:
// [150] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [150] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
jmp __b16
// printf_number_buffer::@16
__b16:
// [151] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [151] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b8
jmp __b2
// printf_number_buffer::@8
@ -8068,9 +8068,9 @@ printf_number_buffer: {
jmp __b2
// printf_number_buffer::@2
__b2:
// [154] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [154] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
jmp __b9
// printf_number_buffer::@9
@ -8085,16 +8085,16 @@ printf_number_buffer: {
jmp __b3
// printf_number_buffer::@3
__b3:
// [157] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [157] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4
jmp __b18
// printf_number_buffer::@18
__b18:
// [158] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [158] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b10
jmp __b4
// printf_number_buffer::@10
@ -8113,9 +8113,9 @@ printf_number_buffer: {
jmp __b4
// printf_number_buffer::@4
__b4:
// [161] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_upper_case
// [161] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- 0_eq_vbuz1_then_la1
lda.z format_upper_case
cmp #0
beq __b5_from___b4
// [162] phi from printf_number_buffer::@4 to printf_number_buffer::@11 [phi:printf_number_buffer::@4->printf_number_buffer::@11]
__b11_from___b4:
@ -8144,23 +8144,23 @@ printf_number_buffer: {
jmp __b15
// printf_number_buffer::@15
__b15:
// [166] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [166] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- 0_eq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
beq __breturn
jmp __b20
// printf_number_buffer::@20
__b20:
// [167] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [167] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __breturn
jmp __b19
// printf_number_buffer::@19
__b19:
// [168] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [168] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b12
jmp __breturn
// printf_number_buffer::@12
@ -8571,7 +8571,7 @@ ultoa: {
sta.z digit_value+2
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// [229] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuzz_then_la1
// [229] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuzz_then_la1
cpz #0
bne __b5
jmp __b7
@ -8753,7 +8753,7 @@ strlen: {
jmp __b1
// strlen::@1
__b1:
// [255] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [255] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -8830,7 +8830,7 @@ strupr: {
jmp __b1
// strupr::@1
__b1:
// [268] if(0!=*strupr::src#2) goto strupr::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [268] if(0!=*strupr::src#2) goto strupr::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (src),y
cmp #0
@ -9181,7 +9181,7 @@ uctoa: {
ldy.z digit
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// [316] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [316] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -9829,11 +9829,7 @@ Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction ldy.z row
Removing instruction lda.z digit_value+1
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda.z buffer_sign
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __breturn:
Removing instruction __b2:
@ -10273,7 +10269,7 @@ mem[12] [ printf_buffer ]
FINAL ASSEMBLER
Score: 1297293
Score: 1297300
// File Comments
// N Queens Problem in C Using Backtracking
@ -10670,7 +10666,7 @@ cputs: {
lda (s),y
// [67] cputs::s#0 = ++ cputs::s#11 -- pbuz1=_inc_pbuz1
inw.z s
// [68] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [68] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -10784,7 +10780,7 @@ queens: {
// queens::@9
// [86] queens::$2 = legal::return#0
// if(legal(row, board[row]))
// [87] if(0==queens::$2) goto queens::@1 -- vbuc1_eq_vbuaa_then_la1
// [87] if(0==queens::$2) goto queens::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// queens::@6
@ -10990,7 +10986,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [124] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuzz_then_la1
// [124] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuzz_then_la1
cpz #0
bne __b5
// utoa::@7
@ -11053,7 +11049,7 @@ printf_number_buffer: {
.label format_justify_left = $c
.label format_upper_case = $29
// if(format.min_length)
// [136] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- vbuc1_eq_vbuzz_then_la1
// [136] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuzz_then_la1
cpz #0
beq __b6
// [137] phi from printf_number_buffer to printf_number_buffer::@6 [phi:printf_number_buffer->printf_number_buffer::@6]
@ -11071,9 +11067,9 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
ldx.z __19
// if(buffer.sign)
// [142] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [142] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b13
// printf_number_buffer::@7
// len++;
@ -11106,17 +11102,19 @@ printf_number_buffer: {
// printf_number_buffer::@1
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
// [149] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [149] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
bne __b2
// printf_number_buffer::@17
// [150] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
cmp.z format_zero_padding
// [150] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
// printf_number_buffer::@16
// [151] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [151] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b8
jmp __b2
// printf_number_buffer::@8
@ -11135,14 +11133,13 @@ printf_number_buffer: {
// printf_number_buffer::@2
__b2:
// if(buffer.sign)
// [154] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [154] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
// printf_number_buffer::@9
// cputc(buffer.sign)
// [155] cputc::c#2 = printf_number_buffer::buffer_sign#10 -- vbuaa=vbuz1
lda.z buffer_sign
// [156] call cputc
// [103] phi from printf_number_buffer::@9 to cputc [phi:printf_number_buffer::@9->cputc]
// [103] phi cputc::c#3 = cputc::c#2 [phi:printf_number_buffer::@9->cputc#0] -- register_copy
@ -11150,13 +11147,14 @@ printf_number_buffer: {
// printf_number_buffer::@3
__b3:
// if(format.zero_padding && padding)
// [157] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [157] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4
// printf_number_buffer::@18
// [158] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [158] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b10
jmp __b4
// printf_number_buffer::@10
@ -11175,9 +11173,9 @@ printf_number_buffer: {
// printf_number_buffer::@4
__b4:
// if(format.upper_case)
// [161] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_upper_case
// [161] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- 0_eq_vbuz1_then_la1
lda.z format_upper_case
cmp #0
beq __b5
// [162] phi from printf_number_buffer::@4 to printf_number_buffer::@11 [phi:printf_number_buffer::@4->printf_number_buffer::@11]
// printf_number_buffer::@11
@ -11199,17 +11197,19 @@ printf_number_buffer: {
jsr cputs
// printf_number_buffer::@15
// if(format.justify_left && !format.zero_padding && padding)
// [166] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [166] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- 0_eq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
beq __breturn
// printf_number_buffer::@20
// [167] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- vbuc1_neq_vbuz1_then_la1
cmp.z format_zero_padding
// [167] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __breturn
// printf_number_buffer::@19
// [168] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [168] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b12
rts
// printf_number_buffer::@12
@ -11582,7 +11582,7 @@ ultoa: {
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// if (started || value >= digit_value)
// [229] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuzz_then_la1
// [229] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuzz_then_la1
cpz #0
bne __b5
// ultoa::@7
@ -11760,7 +11760,7 @@ strlen: {
// strlen::@1
__b1:
// while(*str)
// [255] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [255] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -11832,7 +11832,7 @@ strupr: {
// strupr::@1
__b1:
// while(*src)
// [268] if(0!=*strupr::src#2) goto strupr::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [268] if(0!=*strupr::src#2) goto strupr::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (src),y
cmp #0
@ -12161,7 +12161,7 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
// [316] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [316] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// uctoa::@7

@ -5562,7 +5562,7 @@ print_str_at: {
jmp __b1
// print_str_at::@1
__b1:
// [117] if(0!=*print_str_at::str#13) goto print_str_at::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [117] if(0!=*print_str_at::str#13) goto print_str_at::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -8070,7 +8070,7 @@ print_str_at: {
// print_str_at::@1
__b1:
// while(*str)
// [117] if(0!=*print_str_at::str#13) goto print_str_at::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [117] if(0!=*print_str_at::str#13) goto print_str_at::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -2059,7 +2059,7 @@ print_str: {
jmp __b1
// print_str::@1
__b1:
// [64] if(0!=*print_str::str#7) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [64] if(0!=*print_str::str#7) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -2945,7 +2945,7 @@ print_str: {
// print_str::@1
__b1:
// while(*str)
// [64] if(0!=*print_str::str#7) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [64] if(0!=*print_str::str#7) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -71,13 +71,14 @@ main: {
// Wait for the timer to run out
__b3:
// while(RIOT->INTIM)
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b4
// TIA->VBLANK = 0
// Screen - display logic
// Update the registers in TIA (the video chip) in order to generate what the player sees.
// For now we're just going to output 192 colored scanlines lines so we have something to see.
lda #0
sta TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_VBLANK
// c = SINTABLE[idx++]
// D1=1, turns off Vertical Blank signal (image output on)
@ -108,8 +109,8 @@ main: {
// Wait for the timer to run out
__b9:
// while(RIOT->INTIM)
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b10
jmp __b2
__b10:

@ -552,9 +552,9 @@ main: {
// Wait for the timer to run out
// main::@3
__b3:
// [11] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@4 -- vbuc1_neq__deref_pbuc2_then_la1
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
// [11] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@4 -- 0_neq__deref_pbuc1_then_la1
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b4
jmp __b5
// main::@5
@ -605,9 +605,9 @@ main: {
// Wait for the timer to run out
// main::@9
__b9:
// [21] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@10 -- vbuc1_neq__deref_pbuc2_then_la1
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
// [21] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@10 -- 0_neq__deref_pbuc1_then_la1
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b10
// [4] phi from main::@9 to main::@1 [phi:main::@9->main::@1]
__b1_from___b9:
@ -682,9 +682,7 @@ Removing instruction __b8:
Removing instruction __b1_from___b9:
Removing instruction __b6_from___b7:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction lda #0
Replacing instruction ldy #0 with TAY
Succesful ASM optimization Pass5UnnecesaryLoadElimination
FINAL SYMBOL TABLE
const byte OFFSET_STRUCT_ATARI_TIA_WRITE_COLUBK = 9
@ -719,7 +717,7 @@ reg byte x [ main::c#2 main::c#0 main::c#1 ]
FINAL ASSEMBLER
Score: 8259
Score: 8279
// File Comments
// Minimal Atari 2600 VCS Program
@ -813,9 +811,9 @@ main: {
// main::@3
__b3:
// while(RIOT->INTIM)
// [11] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@4 -- vbuc1_neq__deref_pbuc2_then_la1
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
// [11] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@4 -- 0_neq__deref_pbuc1_then_la1
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b4
// main::@5
// TIA->VBLANK = 0
@ -823,6 +821,7 @@ main: {
// Screen - display logic
// Update the registers in TIA (the video chip) in order to generate what the player sees.
// For now we're just going to output 192 colored scanlines lines so we have something to see.
lda #0
sta TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_VBLANK
// c = SINTABLE[idx++]
// [13] main::c#0 = SINTABLE[idx#1] -- vbuxx=pbuc1_derefidx_vbuz1
@ -866,9 +865,9 @@ main: {
// main::@9
__b9:
// while(RIOT->INTIM)
// [21] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@10 -- vbuc1_neq__deref_pbuc2_then_la1
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
// [21] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@10 -- 0_neq__deref_pbuc1_then_la1
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b10
// [4] phi from main::@9 to main::@1 [phi:main::@9->main::@1]
// [4] phi idx#1 = idx#0 [phi:main::@9->main::@1#0] -- register_copy

@ -128,13 +128,14 @@ main: {
// Wait for the timer to run out
__b3:
// while(RIOT->INTIM)
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b4
// TIA->VBLANK = 0
// Screen - display logic
// Update the registers in TIA (the video chip) in order to generate what the player sees.
// For now we're just going to output 192 colored scanlines lines so we have something to see.
lda #0
sta TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_VBLANK
// TIA->COLUBK = 0x0
// D1=1, turns off Vertical Blank signal (image output on)
@ -164,8 +165,8 @@ main: {
// Wait for the timer to run out
__b13:
// while(RIOT->INTIM)
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b14
jmp __b2
__b14:

@ -971,9 +971,9 @@ main: {
// Wait for the timer to run out
// main::@3
__b3:
// [23] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@4 -- vbuc1_neq__deref_pbuc2_then_la1
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
// [23] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@4 -- 0_neq__deref_pbuc1_then_la1
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b4
jmp __b5
// main::@5
@ -1023,9 +1023,9 @@ main: {
// Wait for the timer to run out
// main::@13
__b13:
// [32] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@14 -- vbuc1_neq__deref_pbuc2_then_la1
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
// [32] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@14 -- 0_neq__deref_pbuc1_then_la1
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b14
// [9] phi from main::@13 to main::@1 [phi:main::@13->main::@1]
__b1_from___b13:
@ -1046,7 +1046,7 @@ main: {
sta TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_WSYNC
// [35] *((byte*)TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_COLUBK) = main::i#2 -- _deref_pbuc1=vbuxx
stx TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_COLUBK
// [36] if(0!=main::p0_idx#4) goto main::@9 -- vbuc1_neq_vbuyy_then_la1
// [36] if(0!=main::p0_idx#4) goto main::@9 -- 0_neq_vbuyy_then_la1
cpy #0
bne __b9
jmp __b11
@ -1165,9 +1165,7 @@ Skipping double jump to __b10 in jmp __b15
Succesful ASM optimization Pass5DoubleJumpElimination
Relabelling long label __b10_from___b9 to __b1
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction lda #0
Replacing instruction ldy #0 with TAY
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __b15:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing unreachable instruction jmp __b10
@ -1223,7 +1221,7 @@ reg byte a [ main::gfx#0 ]
FINAL ASSEMBLER
Score: 10872
Score: 10892
// File Comments
// Minimal Atari 2600 VCS Program using Sprites
@ -1390,9 +1388,9 @@ main: {
// main::@3
__b3:
// while(RIOT->INTIM)
// [23] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@4 -- vbuc1_neq__deref_pbuc2_then_la1
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
// [23] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@4 -- 0_neq__deref_pbuc1_then_la1
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b4
// main::@5
// TIA->VBLANK = 0
@ -1400,6 +1398,7 @@ main: {
// Screen - display logic
// Update the registers in TIA (the video chip) in order to generate what the player sees.
// For now we're just going to output 192 colored scanlines lines so we have something to see.
lda #0
sta TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_VBLANK
// TIA->COLUBK = 0x0
// [25] *((byte*)TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_COLUBK) = 0 -- _deref_pbuc1=vbuc2
@ -1441,9 +1440,9 @@ main: {
// main::@13
__b13:
// while(RIOT->INTIM)
// [32] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@14 -- vbuc1_neq__deref_pbuc2_then_la1
lda #0
cmp RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
// [32] if(0!=*((byte*)RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM)) goto main::@14 -- 0_neq__deref_pbuc1_then_la1
lda RIOT+OFFSET_STRUCT_MOS6532_RIOT_INTIM
cmp #0
bne __b14
// [9] phi from main::@13 to main::@1 [phi:main::@13->main::@1]
// [9] phi idx2#1 = idx2#0 [phi:main::@13->main::@1#0] -- register_copy
@ -1466,7 +1465,7 @@ main: {
// [35] *((byte*)TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_COLUBK) = main::i#2 -- _deref_pbuc1=vbuxx
stx TIA+OFFSET_STRUCT_ATARI_TIA_WRITE_COLUBK
// if(p0_idx)
// [36] if(0!=main::p0_idx#4) goto main::@9 -- vbuc1_neq_vbuyy_then_la1
// [36] if(0!=main::p0_idx#4) goto main::@9 -- 0_neq_vbuyy_then_la1
cpy #0
bne __b9
// main::@11

@ -5403,7 +5403,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [83] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [83] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -5458,7 +5458,7 @@ waitkey: {
// waitkey::@2
__b2:
// [95] waitkey::$1 = kbhit::return#3
// [96] if(0==waitkey::$1) goto waitkey::@1 -- vbuc1_eq_vbuaa_then_la1
// [96] if(0==waitkey::$1) goto waitkey::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1_from___b2
jmp clrkb1
@ -5907,7 +5907,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [171] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [171] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -5975,7 +5975,7 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [183] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [183] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2_from___b1
jmp __b3
@ -7394,7 +7394,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [83] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [83] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -7442,7 +7442,7 @@ waitkey: {
// waitkey::@2
// [95] waitkey::$1 = kbhit::return#3
// while(!kbhit())
// [96] if(0==waitkey::$1) goto waitkey::@1 -- vbuc1_eq_vbuaa_then_la1
// [96] if(0==waitkey::$1) goto waitkey::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
// waitkey::clrkb1
@ -7880,7 +7880,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [171] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [171] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -7942,7 +7942,7 @@ printf_number_buffer: {
.label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
// printf_number_buffer::@1
// if(buffer.sign)
// [183] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- vbuc1_eq_vbuaa_then_la1
// [183] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// printf_number_buffer::@3

@ -2424,7 +2424,7 @@ print_str_at: {
jmp __b1
// print_str_at::@1
__b1:
// [69] if(0!=*print_str_at::str#5) goto print_str_at::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [69] if(0!=*print_str_at::str#5) goto print_str_at::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -3519,7 +3519,7 @@ print_str_at: {
// print_str_at::@1
__b1:
// while(*str)
// [69] if(0!=*print_str_at::str#5) goto print_str_at::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [69] if(0!=*print_str_at::str#5) goto print_str_at::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -715,11 +715,11 @@ cscroll: {
cmp.z conio_cursor_y
bne __breturn
// if(conio_scroll_enable)
lda #0
cmp.z conio_scroll_enable
lda.z conio_scroll_enable
cmp #0
bne __b3
// gotoxy(0,0)
tax
ldx #0
txa
jsr gotoxy
__breturn:

@ -3448,7 +3448,7 @@ main: {
// main::@4
__b4:
// [27] main::$3 = kbhit::return#2
// [28] if(0==main::$3) goto main::@1 -- vbuc1_eq_vbuaa_then_la1
// [28] if(0==main::$3) goto main::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1_from___b4
// [29] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
@ -4265,7 +4265,7 @@ strlen: {
jmp __b1
// strlen::@1
__b1:
// [166] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [166] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -4441,7 +4441,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [198] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [198] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -4469,9 +4469,9 @@ cscroll: {
jmp __b1
// cscroll::@1
__b1:
// [203] if(0!=conio_scroll_enable) goto cscroll::@3 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z conio_scroll_enable
// [203] if(0!=conio_scroll_enable) goto cscroll::@3 -- 0_neq_vbuz1_then_la1
lda.z conio_scroll_enable
cmp #0
bne __b3_from___b1
// [204] phi from cscroll::@1 to cscroll::@2 [phi:cscroll::@1->cscroll::@2]
__b2_from___b1:
@ -4962,7 +4962,6 @@ Removing instruction jmp __b1
Removing instruction jmp __b1
Removing instruction jmp __b2
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction ldx #0 with TAX
FINAL SYMBOL TABLE
const nomodify byte CH_HLINE = $40
@ -5374,7 +5373,7 @@ main: {
// main::@4
// [27] main::$3 = kbhit::return#2
// while(!kbhit())
// [28] if(0==main::$3) goto main::@1 -- vbuc1_eq_vbuaa_then_la1
// [28] if(0==main::$3) goto main::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
// [29] phi from main::@4 to main::@2 [phi:main::@4->main::@2]
@ -6127,7 +6126,7 @@ strlen: {
// strlen::@1
__b1:
// while(*str)
// [166] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [166] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -6297,7 +6296,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [198] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [198] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -6324,9 +6323,9 @@ cscroll: {
bne __breturn
// cscroll::@1
// if(conio_scroll_enable)
// [203] if(0!=conio_scroll_enable) goto cscroll::@3 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z conio_scroll_enable
// [203] if(0!=conio_scroll_enable) goto cscroll::@3 -- 0_neq_vbuz1_then_la1
lda.z conio_scroll_enable
cmp #0
bne __b3
// [204] phi from cscroll::@1 to cscroll::@2 [phi:cscroll::@1->cscroll::@2]
// cscroll::@2
@ -6334,7 +6333,7 @@ cscroll: {
// [205] call gotoxy
// [32] phi from cscroll::@2 to gotoxy [phi:cscroll::@2->gotoxy]
// [32] phi gotoxy::x#10 = 0 [phi:cscroll::@2->gotoxy#0] -- vbuxx=vbuc1
tax
ldx #0
// [32] phi gotoxy::y#7 = 0 [phi:cscroll::@2->gotoxy#1] -- vbuaa=vbuc1
txa
jsr gotoxy

@ -101,8 +101,8 @@ queen: {
jsr legal
// legal(r,column)
// if(legal(r,column))
lda #0
cmp.z __1
lda.z __1
cmp #0
beq __b3
// board[r]=column
//no conflicts so place queen
@ -595,8 +595,8 @@ cputs: {
bne !+
inc.z s+1
!:
lda #0
cmp.z c
lda.z c
cmp #0
bne __b2
// }
rts
@ -998,8 +998,8 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
lda #0
cmp.z started
lda.z started
cmp #0
bne __b5
lda.z digit_value+1
cmp.z value+1
@ -1040,8 +1040,8 @@ printf_number_buffer: {
.label format_justify_left = $19
.label format_upper_case = $24
// if(format.min_length)
lda #0
cmp.z format_min_length
lda.z format_min_length
cmp #0
beq __b6
// strlen(buffer.digits)
jsr strlen
@ -1051,8 +1051,8 @@ printf_number_buffer: {
lda.z __19
sta.z len
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b13
// len++;
inc.z len
@ -1070,12 +1070,14 @@ printf_number_buffer: {
sta.z padding
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
lda #0
cmp.z format_justify_left
lda.z format_justify_left
cmp #0
bne __b2
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
bne __b2
cmp.z padding
lda.z padding
cmp #0
bne __b8
jmp __b2
__b8:
@ -1087,19 +1089,19 @@ printf_number_buffer: {
jsr printf_padding
__b2:
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b3
// cputc(buffer.sign)
lda.z buffer_sign
sta.z cputc.c
jsr cputc
__b3:
// if(format.zero_padding && padding)
lda #0
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
beq __b4
cmp.z padding
lda.z padding
cmp #0
bne __b10
jmp __b4
__b10:
@ -1111,8 +1113,8 @@ printf_number_buffer: {
jsr printf_padding
__b4:
// if(format.upper_case)
lda #0
cmp.z format_upper_case
lda.z format_upper_case
cmp #0
beq __b5
// strupr(buffer.digits)
jsr strupr
@ -1124,12 +1126,14 @@ printf_number_buffer: {
sta.z cputs.s+1
jsr cputs
// if(format.justify_left && !format.zero_padding && padding)
lda #0
cmp.z format_justify_left
lda.z format_justify_left
cmp #0
beq __breturn
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
bne __breturn
cmp.z padding
lda.z padding
cmp #0
bne __b12
rts
__b12:
@ -1203,8 +1207,8 @@ ultoa: {
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// if (started || value >= digit_value)
lda #0
cmp.z started
lda.z started
cmp #0
bne __b5
lda.z value+3
cmp.z digit_value+3
@ -1286,8 +1290,8 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
lda #0
cmp.z started
lda.z started
cmp #0
bne __b5
lda.z value
cmp.z digit_value

@ -8152,9 +8152,9 @@ queen: {
// queen::@7
__b7:
// [19] queen::$1 = legal::return#0
// [20] if(0==queen::$1) goto queen::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __1
// [20] if(0==queen::$1) goto queen::@3 -- 0_eq_vbuz1_then_la1
lda.z __1
cmp #0
beq __b3
jmp __b5
// queen::@5
@ -8977,9 +8977,9 @@ cputs: {
bne !+
inc.z s+1
!:
// [159] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z c
// [159] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuz1_then_la1
lda.z c
cmp #0
bne __b2
jmp __breturn
// cputs::@return
@ -9527,9 +9527,9 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [251] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [251] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
jmp __b7
// utoa::@7
@ -9601,9 +9601,9 @@ printf_number_buffer: {
.label format_zero_padding = $1c
.label format_justify_left = $19
.label format_upper_case = $24
// [263] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_min_length
// [263] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuz1_then_la1
lda.z format_min_length
cmp #0
beq __b1_from_printf_number_buffer
// [264] phi from printf_number_buffer to printf_number_buffer::@6 [phi:printf_number_buffer->printf_number_buffer::@6]
__b6_from_printf_number_buffer:
@ -9623,9 +9623,9 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
lda.z __19
sta.z len
// [269] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [269] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b13_from___b14
jmp __b7
// printf_number_buffer::@7
@ -9666,23 +9666,23 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [276] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [276] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
bne __b2
jmp __b17
// printf_number_buffer::@17
__b17:
// [277] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [277] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
jmp __b16
// printf_number_buffer::@16
__b16:
// [278] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [278] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b8
jmp __b2
// printf_number_buffer::@8
@ -9701,9 +9701,9 @@ printf_number_buffer: {
jmp __b2
// printf_number_buffer::@2
__b2:
// [281] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [281] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
jmp __b9
// printf_number_buffer::@9
@ -9719,16 +9719,16 @@ printf_number_buffer: {
jmp __b3
// printf_number_buffer::@3
__b3:
// [284] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [284] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4
jmp __b18
// printf_number_buffer::@18
__b18:
// [285] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [285] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b10
jmp __b4
// printf_number_buffer::@10
@ -9747,9 +9747,9 @@ printf_number_buffer: {
jmp __b4
// printf_number_buffer::@4
__b4:
// [288] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_upper_case
// [288] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- 0_eq_vbuz1_then_la1
lda.z format_upper_case
cmp #0
beq __b5_from___b4
// [289] phi from printf_number_buffer::@4 to printf_number_buffer::@11 [phi:printf_number_buffer::@4->printf_number_buffer::@11]
__b11_from___b4:
@ -9778,23 +9778,23 @@ printf_number_buffer: {
jmp __b15
// printf_number_buffer::@15
__b15:
// [293] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [293] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- 0_eq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
beq __breturn
jmp __b20
// printf_number_buffer::@20
__b20:
// [294] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [294] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __breturn
jmp __b19
// printf_number_buffer::@19
__b19:
// [295] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [295] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b12
jmp __breturn
// printf_number_buffer::@12
@ -9894,9 +9894,9 @@ ultoa: {
sta.z digit_value+2
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// [309] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [309] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
jmp __b7
// ultoa::@7
@ -10025,9 +10025,9 @@ uctoa: {
ldy.z digit
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// [328] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [328] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
jmp __b7
// uctoa::@7
@ -10200,7 +10200,7 @@ strlen: {
jmp __b1
// strlen::@1
__b1:
// [354] if(0!=*strlen::str#3) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [354] if(0!=*strlen::str#3) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -10286,7 +10286,7 @@ strupr: {
jmp __b1
// strupr::@1
__b1:
// [367] if(0!=*strupr::src#2) goto strupr::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [367] if(0!=*strupr::src#2) goto strupr::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (src),y
cmp #0
@ -11180,11 +11180,7 @@ Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing instruction lda r with TYA
Removing instruction ldy.z i
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda.z buffer_sign
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __breturn:
Removing instruction __breturn:
@ -11817,9 +11813,9 @@ queen: {
// queen::@7
// [19] queen::$1 = legal::return#0
// if(legal(r,column))
// [20] if(0==queen::$1) goto queen::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z __1
// [20] if(0==queen::$1) goto queen::@3 -- 0_eq_vbuz1_then_la1
lda.z __1
cmp #0
beq __b3
// queen::@5
// board[r]=column
@ -12578,9 +12574,9 @@ cputs: {
bne !+
inc.z s+1
!:
// [159] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z c
// [159] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuz1_then_la1
lda.z c
cmp #0
bne __b2
// cputs::@return
// }
@ -13133,9 +13129,9 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [251] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [251] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
// utoa::@7
// [252] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@5 -- vwuz1_ge_vwuz2_then_la1
@ -13204,9 +13200,9 @@ printf_number_buffer: {
.label format_justify_left = $19
.label format_upper_case = $24
// if(format.min_length)
// [263] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_min_length
// [263] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuz1_then_la1
lda.z format_min_length
cmp #0
beq __b6
// [264] phi from printf_number_buffer to printf_number_buffer::@6 [phi:printf_number_buffer->printf_number_buffer::@6]
// printf_number_buffer::@6
@ -13224,9 +13220,9 @@ printf_number_buffer: {
lda.z __19
sta.z len
// if(buffer.sign)
// [269] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [269] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b13
// printf_number_buffer::@7
// len++;
@ -13258,17 +13254,19 @@ printf_number_buffer: {
// printf_number_buffer::@1
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
// [276] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [276] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
bne __b2
// printf_number_buffer::@17
// [277] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
cmp.z format_zero_padding
// [277] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
// printf_number_buffer::@16
// [278] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [278] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b8
jmp __b2
// printf_number_buffer::@8
@ -13287,14 +13285,13 @@ printf_number_buffer: {
// printf_number_buffer::@2
__b2:
// if(buffer.sign)
// [281] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [281] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
// printf_number_buffer::@9
// cputc(buffer.sign)
// [282] cputc::c#2 = printf_number_buffer::buffer_sign#10 -- vbuz1=vbuz2
lda.z buffer_sign
sta.z cputc.c
// [283] call cputc
// [230] phi from printf_number_buffer::@9 to cputc [phi:printf_number_buffer::@9->cputc]
@ -13303,13 +13300,14 @@ printf_number_buffer: {
// printf_number_buffer::@3
__b3:
// if(format.zero_padding && padding)
// [284] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [284] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4
// printf_number_buffer::@18
// [285] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [285] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b10
jmp __b4
// printf_number_buffer::@10
@ -13328,9 +13326,9 @@ printf_number_buffer: {
// printf_number_buffer::@4
__b4:
// if(format.upper_case)
// [288] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_upper_case
// [288] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- 0_eq_vbuz1_then_la1
lda.z format_upper_case
cmp #0
beq __b5
// [289] phi from printf_number_buffer::@4 to printf_number_buffer::@11 [phi:printf_number_buffer::@4->printf_number_buffer::@11]
// printf_number_buffer::@11
@ -13352,17 +13350,19 @@ printf_number_buffer: {
jsr cputs
// printf_number_buffer::@15
// if(format.justify_left && !format.zero_padding && padding)
// [293] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [293] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- 0_eq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
beq __breturn
// printf_number_buffer::@20
// [294] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- vbuc1_neq_vbuz1_then_la1
cmp.z format_zero_padding
// [294] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __breturn
// printf_number_buffer::@19
// [295] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [295] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b12
rts
// printf_number_buffer::@12
@ -13462,9 +13462,9 @@ ultoa: {
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// if (started || value >= digit_value)
// [309] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [309] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
// ultoa::@7
// [310] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@5 -- vduz1_ge_vduz2_then_la1
@ -13589,9 +13589,9 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
// [328] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [328] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
// uctoa::@7
// [329] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@5 -- vbuz1_ge_vbuz2_then_la1
@ -13760,7 +13760,7 @@ strlen: {
// strlen::@1
__b1:
// while(*str)
// [354] if(0!=*strlen::str#3) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [354] if(0!=*strlen::str#3) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -13841,7 +13841,7 @@ strupr: {
// strupr::@1
__b1:
// while(*src)
// [367] if(0!=*strupr::src#2) goto strupr::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [367] if(0!=*strupr::src#2) goto strupr::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (src),y
cmp #0

@ -553,8 +553,8 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
ldy.z __19
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b13
// len++;
iny
@ -573,12 +573,14 @@ printf_number_buffer: {
sta.z padding
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
lda #0
cmp.z format_justify_left
lda.z format_justify_left
cmp #0
bne __b2
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
bne __b2
cmp.z padding
lda.z padding
cmp #0
bne __b8
jmp __b2
__b8:
@ -590,18 +592,18 @@ printf_number_buffer: {
jsr printf_padding
__b2:
// if(buffer.sign)
lda #0
cmp.z buffer_sign
lda.z buffer_sign
cmp #0
beq __b3
// cputc(buffer.sign)
lda.z buffer_sign
jsr cputc
__b3:
// if(format.zero_padding && padding)
lda #0
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
beq __b4
cmp.z padding
lda.z padding
cmp #0
bne __b10
jmp __b4
__b10:
@ -613,8 +615,8 @@ printf_number_buffer: {
jsr printf_padding
__b4:
// if(format.upper_case)
lda #0
cmp.z format_upper_case
lda.z format_upper_case
cmp #0
beq __b5
// strupr(buffer.digits)
jsr strupr
@ -626,12 +628,14 @@ printf_number_buffer: {
sta.z cputs.s+1
jsr cputs
// if(format.justify_left && !format.zero_padding && padding)
lda #0
cmp.z format_justify_left
lda.z format_justify_left
cmp #0
beq __breturn
cmp.z format_zero_padding
lda.z format_zero_padding
cmp #0
bne __breturn
cmp.z padding
lda.z padding
cmp #0
bne __b12
rts
__b12:
@ -1275,8 +1279,8 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
lda #0
cmp.z started
lda.z started
cmp #0
bne __b5
cpx.z digit_value
bcs __b5

@ -7452,7 +7452,7 @@ main: {
// main::@9
__b9:
// [35] main::$5 = kbhit::return#2
// [36] if(0==main::$5) goto main::@1 -- vbuc1_eq_vbuaa_then_la1
// [36] if(0==main::$5) goto main::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1_from___b9
jmp __breturn
@ -7686,7 +7686,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [73] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [73] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -7816,7 +7816,7 @@ queens: {
// queens::@9
__b9:
// [91] queens::$2 = legal::return#0
// [92] if(0==queens::$2) goto queens::@1 -- vbuc1_eq_vbuaa_then_la1
// [92] if(0==queens::$2) goto queens::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1_from___b9
jmp __b6
@ -8054,7 +8054,7 @@ utoa: {
sta.z digit_value
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// [132] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [132] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -8124,7 +8124,7 @@ printf_number_buffer: {
.label format_zero_padding = $d
.label format_justify_left = $b
.label format_upper_case = $11
// [144] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- vbuc1_eq_vbuxx_then_la1
// [144] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuxx_then_la1
cpx #0
beq __b1_from_printf_number_buffer
// [145] phi from printf_number_buffer to printf_number_buffer::@6 [phi:printf_number_buffer->printf_number_buffer::@6]
@ -8144,9 +8144,9 @@ printf_number_buffer: {
// [149] printf_number_buffer::len#0 = (signed byte)printf_number_buffer::$19 -- vbsyy=_sbyte_vwuz1
// There is a minimum length - work out the padding
ldy.z __19
// [150] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [150] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b13_from___b14
jmp __b7
// printf_number_buffer::@7
@ -8188,23 +8188,23 @@ printf_number_buffer: {
jmp __b1
// printf_number_buffer::@1
__b1:
// [157] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [157] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
bne __b2
jmp __b17
// printf_number_buffer::@17
__b17:
// [158] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [158] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
jmp __b16
// printf_number_buffer::@16
__b16:
// [159] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [159] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b8
jmp __b2
// printf_number_buffer::@8
@ -8223,9 +8223,9 @@ printf_number_buffer: {
jmp __b2
// printf_number_buffer::@2
__b2:
// [162] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [162] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
jmp __b9
// printf_number_buffer::@9
@ -8240,16 +8240,16 @@ printf_number_buffer: {
jmp __b3
// printf_number_buffer::@3
__b3:
// [165] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [165] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4
jmp __b18
// printf_number_buffer::@18
__b18:
// [166] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [166] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b10
jmp __b4
// printf_number_buffer::@10
@ -8268,9 +8268,9 @@ printf_number_buffer: {
jmp __b4
// printf_number_buffer::@4
__b4:
// [169] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_upper_case
// [169] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- 0_eq_vbuz1_then_la1
lda.z format_upper_case
cmp #0
beq __b5_from___b4
// [170] phi from printf_number_buffer::@4 to printf_number_buffer::@11 [phi:printf_number_buffer::@4->printf_number_buffer::@11]
__b11_from___b4:
@ -8299,23 +8299,23 @@ printf_number_buffer: {
jmp __b15
// printf_number_buffer::@15
__b15:
// [174] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [174] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- 0_eq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
beq __breturn
jmp __b20
// printf_number_buffer::@20
__b20:
// [175] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [175] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __breturn
jmp __b19
// printf_number_buffer::@19
__b19:
// [176] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- vbsc1_neq_vbsz1_then_la1
lda #0
cmp.z padding
// [176] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b12
jmp __breturn
// printf_number_buffer::@12
@ -8733,7 +8733,7 @@ ultoa: {
sta.z digit_value+2
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// [237] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [237] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
jmp __b7
@ -8916,7 +8916,7 @@ strlen: {
jmp __b1
// strlen::@1
__b1:
// [263] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [263] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -9002,7 +9002,7 @@ strupr: {
jmp __b1
// strupr::@1
__b1:
// [276] if(0!=*strupr::src#2) goto strupr::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [276] if(0!=*strupr::src#2) goto strupr::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (src),y
cmp #0
@ -9355,9 +9355,9 @@ uctoa: {
ldy.z digit
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// [324] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [324] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
jmp __b7
// uctoa::@7
@ -10024,11 +10024,7 @@ Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction ldy.z row
Removing instruction lda.z digit_value+1
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda #0
Removing instruction lda.z buffer_sign
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __breturn:
Removing instruction __b2:
@ -10474,7 +10470,7 @@ mem[12] [ printf_buffer ]
FINAL ASSEMBLER
Score: 1603841
Score: 1603848
// File Comments
// N Queens Problem in C Using Backtracking
@ -10658,7 +10654,7 @@ main: {
// main::@9
// [35] main::$5 = kbhit::return#2
// while(!kbhit())
// [36] if(0==main::$5) goto main::@1 -- vbuc1_eq_vbuaa_then_la1
// [36] if(0==main::$5) goto main::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
// main::@return
@ -10889,7 +10885,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [73] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [73] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return
@ -11003,7 +10999,7 @@ queens: {
// queens::@9
// [91] queens::$2 = legal::return#0
// if(legal(row, board[row]))
// [92] if(0==queens::$2) goto queens::@1 -- vbuc1_eq_vbuaa_then_la1
// [92] if(0==queens::$2) goto queens::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// queens::@6
@ -11236,7 +11232,7 @@ utoa: {
lda RADIX_DECIMAL_VALUES+1,y
sta.z digit_value+1
// if (started || value >= digit_value)
// [132] if(0!=utoa::started#2) goto utoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [132] if(0!=utoa::started#2) goto utoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// utoa::@7
@ -11302,7 +11298,7 @@ printf_number_buffer: {
.label format_justify_left = $b
.label format_upper_case = $11
// if(format.min_length)
// [144] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- vbuc1_eq_vbuxx_then_la1
// [144] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuxx_then_la1
cpx #0
beq __b6
// [145] phi from printf_number_buffer to printf_number_buffer::@6 [phi:printf_number_buffer->printf_number_buffer::@6]
@ -11320,9 +11316,9 @@ printf_number_buffer: {
// There is a minimum length - work out the padding
ldy.z __19
// if(buffer.sign)
// [150] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [150] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@13 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b13
// printf_number_buffer::@7
// len++;
@ -11355,17 +11351,19 @@ printf_number_buffer: {
// printf_number_buffer::@1
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
// [157] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [157] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
bne __b2
// printf_number_buffer::@17
// [158] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- vbuc1_neq_vbuz1_then_la1
cmp.z format_zero_padding
// [158] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __b2
// printf_number_buffer::@16
// [159] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [159] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b8
jmp __b2
// printf_number_buffer::@8
@ -11384,14 +11382,13 @@ printf_number_buffer: {
// printf_number_buffer::@2
__b2:
// if(buffer.sign)
// [162] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z buffer_sign
// [162] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbuz1_then_la1
lda.z buffer_sign
cmp #0
beq __b3
// printf_number_buffer::@9
// cputc(buffer.sign)
// [163] cputc::c#2 = printf_number_buffer::buffer_sign#10 -- vbuaa=vbuz1
lda.z buffer_sign
// [164] call cputc
// [111] phi from printf_number_buffer::@9 to cputc [phi:printf_number_buffer::@9->cputc]
// [111] phi cputc::c#3 = cputc::c#2 [phi:printf_number_buffer::@9->cputc#0] -- register_copy
@ -11399,13 +11396,14 @@ printf_number_buffer: {
// printf_number_buffer::@3
__b3:
// if(format.zero_padding && padding)
// [165] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_zero_padding
// [165] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
beq __b4
// printf_number_buffer::@18
// [166] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [166] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b10
jmp __b4
// printf_number_buffer::@10
@ -11424,9 +11422,9 @@ printf_number_buffer: {
// printf_number_buffer::@4
__b4:
// if(format.upper_case)
// [169] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_upper_case
// [169] if(0==printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5 -- 0_eq_vbuz1_then_la1
lda.z format_upper_case
cmp #0
beq __b5
// [170] phi from printf_number_buffer::@4 to printf_number_buffer::@11 [phi:printf_number_buffer::@4->printf_number_buffer::@11]
// printf_number_buffer::@11
@ -11448,17 +11446,19 @@ printf_number_buffer: {
jsr cputs
// printf_number_buffer::@15
// if(format.justify_left && !format.zero_padding && padding)
// [174] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp.z format_justify_left
// [174] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return -- 0_eq_vbuz1_then_la1
lda.z format_justify_left
cmp #0
beq __breturn
// printf_number_buffer::@20
// [175] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- vbuc1_neq_vbuz1_then_la1
cmp.z format_zero_padding
// [175] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return -- 0_neq_vbuz1_then_la1
lda.z format_zero_padding
cmp #0
bne __breturn
// printf_number_buffer::@19
// [176] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- vbsc1_neq_vbsz1_then_la1
cmp.z padding
// [176] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12 -- 0_neq_vbsz1_then_la1
lda.z padding
cmp #0
bne __b12
rts
// printf_number_buffer::@12
@ -11839,7 +11839,7 @@ ultoa: {
lda RADIX_DECIMAL_VALUES_LONG+3,y
sta.z digit_value+3
// if (started || value >= digit_value)
// [237] if(0!=ultoa::started#2) goto ultoa::@5 -- vbuc1_neq_vbuxx_then_la1
// [237] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuxx_then_la1
cpx #0
bne __b5
// ultoa::@7
@ -12018,7 +12018,7 @@ strlen: {
// strlen::@1
__b1:
// while(*str)
// [263] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [263] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -12099,7 +12099,7 @@ strupr: {
// strupr::@1
__b1:
// while(*src)
// [276] if(0!=*strupr::src#2) goto strupr::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [276] if(0!=*strupr::src#2) goto strupr::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (src),y
cmp #0
@ -12430,9 +12430,9 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
// [324] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [324] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
// uctoa::@7
// [325] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@5 -- vbuxx_ge_vbuz1_then_la1

@ -2544,7 +2544,7 @@ font_2x2: {
// [29] font_2x2::$1 = font_2x2::glyph_bits#2 & $80 -- vbuaa=vbuz1_band_vbuc1
lda #$80
and.z glyph_bits
// [30] if(0!=font_2x2::$1) goto font_2x2::@4 -- vbuc1_neq_vbuaa_then_la1
// [30] if(0!=font_2x2::$1) goto font_2x2::@4 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b4_from___b3
// [32] phi from font_2x2::@3 to font_2x2::@5 [phi:font_2x2::@3->font_2x2::@5]
@ -3028,7 +3028,7 @@ font_find: {
jmp __b4
// font_find::@4
__b4:
// [116] if(0==font_find::found#2) goto font_find::@5 -- vbuc1_eq_vbuaa_then_la1
// [116] if(0==font_find::found#2) goto font_find::@5 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b5
// [109] phi from font_find::@4 to font_find::@return [phi:font_find::@4->font_find::@return]
@ -3585,7 +3585,7 @@ font_2x2: {
lda #$80
and.z glyph_bits
// (glyph_bits&0x80)?1uc:0uc
// [30] if(0!=font_2x2::$1) goto font_2x2::@4 -- vbuc1_neq_vbuaa_then_la1
// [30] if(0!=font_2x2::$1) goto font_2x2::@4 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b4
// [32] phi from font_2x2::@3 to font_2x2::@5 [phi:font_2x2::@3->font_2x2::@5]
@ -4072,7 +4072,7 @@ font_find: {
// font_find::@4
__b4:
// if(found)
// [116] if(0==font_find::found#2) goto font_find::@5 -- vbuc1_eq_vbuaa_then_la1
// [116] if(0==font_find::found#2) goto font_find::@5 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b5
// [109] phi from font_find::@4 to font_find::@return [phi:font_find::@4->font_find::@return]

@ -1588,7 +1588,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [37] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [37] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -2309,7 +2309,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [37] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [37] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return

@ -977,7 +977,7 @@ strlen: {
jmp __b1
// strlen::@1
__b1:
// [45] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [45] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -1393,7 +1393,7 @@ strlen: {
// strlen::@1
__b1:
// while(*str)
// [45] if(0!=*strlen::str#2) goto strlen::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [45] if(0!=*strlen::str#2) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -157,7 +157,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [2] if(0!=MSG[main::i#2]) goto main::@2 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
// [2] if(0!=MSG[main::i#2]) goto main::@2 -- 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda MSG,x
cmp #0
bne __b2
@ -237,7 +237,7 @@ main: {
// main::@1
__b1:
// for(char i=0;MSG[i];i++)
// [2] if(0!=MSG[main::i#2]) goto main::@2 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
// [2] if(0!=MSG[main::i#2]) goto main::@2 -- 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda MSG,x
cmp #0
bne __b2

@ -1677,7 +1677,7 @@ cputs: {
lda (s),y
// [41] cputs::s#0 = ++ cputs::s#2 -- pbuz1=_inc_pbuz1
inw.z s
// [42] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [42] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -2433,7 +2433,7 @@ cputs: {
lda (s),y
// [41] cputs::s#0 = ++ cputs::s#2 -- pbuz1=_inc_pbuz1
inw.z s
// [42] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [42] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return

@ -574,8 +574,8 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
lda #0
cmp.z started
lda.z started
cmp #0
bne __b5
cpx.z digit_value
bcs __b5

@ -4340,7 +4340,7 @@ vblank: {
// [13] vblank::$1 = vblank::joy#0 & JOY_DOWN -- vbuaa=vbuxx_band_vbuc1
txa
and #JOY_DOWN
// [14] if(0==vblank::$1) goto vblank::@1 -- vbuc1_eq_vbuaa_then_la1
// [14] if(0==vblank::$1) goto vblank::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
jmp __b5
@ -4364,7 +4364,7 @@ vblank: {
// [18] vblank::$3 = vblank::joy#0 & JOY_UP -- vbuaa=vbuxx_band_vbuc1
txa
and #JOY_UP
// [19] if(0==vblank::$3) goto vblank::@2 -- vbuc1_eq_vbuaa_then_la1
// [19] if(0==vblank::$3) goto vblank::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
jmp __b7
@ -4388,7 +4388,7 @@ vblank: {
// [23] vblank::$5 = vblank::joy#0 & JOY_LEFT -- vbuaa=vbuxx_band_vbuc1
txa
and #JOY_LEFT
// [24] if(0==vblank::$5) goto vblank::@3 -- vbuc1_eq_vbuaa_then_la1
// [24] if(0==vblank::$5) goto vblank::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3
jmp __b9
@ -4402,7 +4402,7 @@ vblank: {
// [26] vblank::$7 = vblank::joy#0 & JOY_RIGHT -- vbuaa=vbuxx_band_vbuc1
txa
and #JOY_RIGHT
// [27] if(0==vblank::$7) goto vblank::@4 -- vbuc1_eq_vbuaa_then_la1
// [27] if(0==vblank::$7) goto vblank::@4 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b4
jmp __b10
@ -4482,7 +4482,7 @@ main: {
// [40] main::initNES1_waitForVBlank1_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [41] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [41] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1___b1
// [42] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -4522,7 +4522,7 @@ main: {
sta MEMORY+$700,x
// [51] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [52] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [52] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1_from_initNES1___b1
// [53] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -4536,7 +4536,7 @@ main: {
// [54] main::initNES1_waitForVBlank2_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [55] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [55] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2___b1
jmp initNES1___b7
@ -5103,9 +5103,9 @@ uctoa: {
ldy.z digit
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// [140] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [140] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
jmp __b7
// uctoa::@7
@ -5373,7 +5373,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [189] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [189] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -6492,7 +6492,7 @@ vblank: {
txa
and #JOY_DOWN
// if(joy&JOY_DOWN)
// [14] if(0==vblank::$1) goto vblank::@1 -- vbuc1_eq_vbuaa_then_la1
// [14] if(0==vblank::$1) goto vblank::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
// vblank::@5
@ -6515,7 +6515,7 @@ vblank: {
txa
and #JOY_UP
// if(joy&JOY_UP)
// [19] if(0==vblank::$3) goto vblank::@2 -- vbuc1_eq_vbuaa_then_la1
// [19] if(0==vblank::$3) goto vblank::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// vblank::@7
@ -6538,7 +6538,7 @@ vblank: {
txa
and #JOY_LEFT
// if(joy&JOY_LEFT)
// [24] if(0==vblank::$5) goto vblank::@3 -- vbuc1_eq_vbuaa_then_la1
// [24] if(0==vblank::$5) goto vblank::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3
// vblank::@9
@ -6552,7 +6552,7 @@ vblank: {
txa
and #JOY_RIGHT
// if(joy&JOY_RIGHT)
// [27] if(0==vblank::$7) goto vblank::@4 -- vbuc1_eq_vbuaa_then_la1
// [27] if(0==vblank::$7) goto vblank::@4 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b4
// vblank::@10
@ -6625,7 +6625,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [41] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [41] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1
// [42] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -6663,7 +6663,7 @@ main: {
// while (++i)
// [51] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [52] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [52] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1
// [53] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -6675,7 +6675,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [55] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [55] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2
// main::initNES1_@7
@ -7195,9 +7195,9 @@ uctoa: {
lda RADIX_HEXADECIMAL_VALUES_CHAR,y
sta.z digit_value
// if (started || value >= digit_value)
// [140] if(0!=uctoa::started#2) goto uctoa::@5 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z started
// [140] if(0!=uctoa::started#2) goto uctoa::@5 -- 0_neq_vbuz1_then_la1
lda.z started
cmp #0
bne __b5
// uctoa::@7
// [141] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@5 -- vbuxx_ge_vbuz1_then_la1
@ -7444,7 +7444,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [189] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [189] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return

@ -2714,7 +2714,7 @@ vblank: {
// [4] vblank::$1 = vblank::joy#0 & JOY_DOWN -- vbuaa=vbuxx_band_vbuc1
txa
and #JOY_DOWN
// [5] if(0==vblank::$1) goto vblank::@1 -- vbuc1_eq_vbuaa_then_la1
// [5] if(0==vblank::$1) goto vblank::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
jmp __b4
@ -2734,7 +2734,7 @@ vblank: {
// [10] vblank::$3 = vblank::joy#0 & JOY_UP -- vbuaa=vbuxx_band_vbuc1
txa
and #JOY_UP
// [11] if(0==vblank::$3) goto vblank::@2 -- vbuc1_eq_vbuaa_then_la1
// [11] if(0==vblank::$3) goto vblank::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
jmp __b5
@ -2754,7 +2754,7 @@ vblank: {
// [16] vblank::$5 = vblank::joy#0 & JOY_LEFT -- vbuaa=vbuxx_band_vbuc1
txa
and #JOY_LEFT
// [17] if(0==vblank::$5) goto vblank::@3 -- vbuc1_eq_vbuaa_then_la1
// [17] if(0==vblank::$5) goto vblank::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3
jmp __b6
@ -2774,7 +2774,7 @@ vblank: {
// [22] vblank::$7 = vblank::joy#0 & JOY_RIGHT -- vbuaa=vbuxx_band_vbuc1
txa
and #JOY_RIGHT
// [23] if(0==vblank::$7) goto vblank::ppuSpriteBufferDmaTransfer1 -- vbuc1_eq_vbuaa_then_la1
// [23] if(0==vblank::$7) goto vblank::ppuSpriteBufferDmaTransfer1 -- 0_eq_vbuaa_then_la1
cmp #0
beq ppuSpriteBufferDmaTransfer1
jmp __b7
@ -2862,7 +2862,7 @@ main: {
// [41] main::initNES1_waitForVBlank1_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [42] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [42] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1___b1
// [43] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -2902,7 +2902,7 @@ main: {
sta MEMORY+$700,x
// [52] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [53] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [53] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1_from_initNES1___b1
// [54] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -2916,7 +2916,7 @@ main: {
// [55] main::initNES1_waitForVBlank2_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [56] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [56] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2___b1
jmp initNES1___b7
@ -3865,7 +3865,7 @@ vblank: {
txa
and #JOY_DOWN
// if(joy&JOY_DOWN)
// [5] if(0==vblank::$1) goto vblank::@1 -- vbuc1_eq_vbuaa_then_la1
// [5] if(0==vblank::$1) goto vblank::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
// vblank::@4
@ -3888,7 +3888,7 @@ vblank: {
txa
and #JOY_UP
// if(joy&JOY_UP)
// [11] if(0==vblank::$3) goto vblank::@2 -- vbuc1_eq_vbuaa_then_la1
// [11] if(0==vblank::$3) goto vblank::@2 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b2
// vblank::@5
@ -3911,7 +3911,7 @@ vblank: {
txa
and #JOY_LEFT
// if(joy&JOY_LEFT)
// [17] if(0==vblank::$5) goto vblank::@3 -- vbuc1_eq_vbuaa_then_la1
// [17] if(0==vblank::$5) goto vblank::@3 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b3
// vblank::@6
@ -3934,7 +3934,7 @@ vblank: {
txa
and #JOY_RIGHT
// if(joy&JOY_RIGHT)
// [23] if(0==vblank::$7) goto vblank::ppuSpriteBufferDmaTransfer1 -- vbuc1_eq_vbuaa_then_la1
// [23] if(0==vblank::$7) goto vblank::ppuSpriteBufferDmaTransfer1 -- 0_eq_vbuaa_then_la1
cmp #0
beq ppuSpriteBufferDmaTransfer1
// vblank::@7
@ -4018,7 +4018,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [42] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [42] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1
// [43] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -4056,7 +4056,7 @@ main: {
// while (++i)
// [52] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [53] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [53] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1
// [54] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -4068,7 +4068,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [56] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [56] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2
// main::initNES1_@7

@ -2249,7 +2249,7 @@ vblank: {
// vblank::@15
__b15:
// [14] vblank::joy#0 = readJoy1::return#2
// [15] if(0==vblank::joy#0) goto vblank::@1 -- vbuc1_eq_vbuaa_then_la1
// [15] if(0==vblank::joy#0) goto vblank::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
jmp __breturn
@ -2467,7 +2467,7 @@ main: {
// [53] main::initNES1_waitForVBlank1_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [54] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [54] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1___b1
// [55] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -2507,7 +2507,7 @@ main: {
sta MEMORY+$700,x
// [64] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [65] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [65] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1_from_initNES1___b1
// [66] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -2521,7 +2521,7 @@ main: {
// [67] main::initNES1_waitForVBlank2_$0 = *((byte*)PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS) & $80 -- vbuaa=_deref_pbuc1_band_vbuc2
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// [68] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [68] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2___b1
jmp initNES1___b7
@ -3319,7 +3319,7 @@ vblank: {
// joy = readJoy1()
// [14] vblank::joy#0 = readJoy1::return#2
// if(joy)
// [15] if(0==vblank::joy#0) goto vblank::@1 -- vbuc1_eq_vbuaa_then_la1
// [15] if(0==vblank::joy#0) goto vblank::@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq __b1
// vblank::@return
@ -3527,7 +3527,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [54] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- vbuc1_eq_vbuaa_then_la1
// [54] if(0==main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank1
// [55] phi from main::initNES1_waitForVBlank1_@1 to main::initNES1_@1 [phi:main::initNES1_waitForVBlank1_@1->main::initNES1_@1]
@ -3565,7 +3565,7 @@ main: {
// while (++i)
// [64] main::initNES1_i#1 = ++ main::initNES1_i#2 -- vbuxx=_inc_vbuxx
inx
// [65] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- vbuc1_neq_vbuxx_then_la1
// [65] if(0!=main::initNES1_i#1) goto main::initNES1_@1 -- 0_neq_vbuxx_then_la1
cpx #0
bne initNES1___b1
// [66] phi from main::initNES1_@1 to main::initNES1_waitForVBlank2 [phi:main::initNES1_@1->main::initNES1_waitForVBlank2]
@ -3577,7 +3577,7 @@ main: {
lda #$80
and PPU+OFFSET_STRUCT_RICOH_2C02_PPUSTATUS
// while(!(PPU->PPUSTATUS&0x80))
// [68] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- vbuc1_eq_vbuaa_then_la1
// [68] if(0==main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1 -- 0_eq_vbuaa_then_la1
cmp #0
beq initNES1_waitForVBlank2
// main::initNES1_@7

@ -1349,7 +1349,7 @@ main: {
// [24] main::$12 = main::rnd#0 & $80 -- vbuaa=vbuyy_band_vbuc1
tya
and #$80
// [25] if(0!=main::$12) goto main::@3 -- vbuc1_neq_vbuaa_then_la1
// [25] if(0!=main::$12) goto main::@3 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b3
jmp __b7
@ -1358,7 +1358,7 @@ main: {
// [26] main::$13 = main::rnd#0 & $40 -- vbuaa=vbuyy_band_vbuc1
tya
and #$40
// [27] if(0!=main::$13) goto main::@4 -- vbuc1_neq_vbuaa_then_la1
// [27] if(0!=main::$13) goto main::@4 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b4
jmp __b8
@ -1429,7 +1429,7 @@ main: {
// [36] main::$18 = main::rnd#0 & $40 -- vbuaa=vbuyy_band_vbuc1
tya
and #$40
// [37] if(0!=main::$18) goto main::@5 -- vbuc1_neq_vbuaa_then_la1
// [37] if(0!=main::$18) goto main::@5 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b5
jmp __b9
@ -1963,7 +1963,7 @@ main: {
tya
and #$80
// if(rnd & 0x80)
// [25] if(0!=main::$12) goto main::@3 -- vbuc1_neq_vbuaa_then_la1
// [25] if(0!=main::$12) goto main::@3 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b3
// main::@7
@ -1972,7 +1972,7 @@ main: {
tya
and #$40
// if(rnd & 0x40)
// [27] if(0!=main::$13) goto main::@4 -- vbuc1_neq_vbuaa_then_la1
// [27] if(0!=main::$13) goto main::@4 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b4
// main::@8
@ -2031,7 +2031,7 @@ main: {
tya
and #$40
// if(rnd& 0x40)
// [37] if(0!=main::$18) goto main::@5 -- vbuc1_neq_vbuaa_then_la1
// [37] if(0!=main::$18) goto main::@5 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b5
// main::@9

@ -3212,7 +3212,7 @@ print_str: {
jmp __b1
// print_str::@1
__b1:
// [52] if(0!=*print_str::str#3) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [52] if(0!=*print_str::str#3) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
@ -4636,7 +4636,7 @@ print_str: {
// print_str::@1
__b1:
// while(*str)
// [52] if(0!=*print_str::str#3) goto print_str::@2 -- vbuc1_neq__deref_pbuz1_then_la1
// [52] if(0!=*print_str::str#3) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0

@ -482,7 +482,7 @@ print: {
inc.z idx
// [20] print::i#1 = ++ print::i#2 -- vbuyy=_inc_vbuyy
iny
// [21] if(0!=print::msg#3[print::i#1]) goto print::@1 -- vbuc1_neq_pbuz1_derefidx_vbuyy_then_la1
// [21] if(0!=print::msg#3[print::i#1]) goto print::@1 -- 0_neq_pbuz1_derefidx_vbuyy_then_la1
lda (msg),y
cmp #0
bne __b1_from___b1
@ -710,7 +710,7 @@ print: {
// [20] print::i#1 = ++ print::i#2 -- vbuyy=_inc_vbuyy
iny
// while(msg[i])
// [21] if(0!=print::msg#3[print::i#1]) goto print::@1 -- vbuc1_neq_pbuz1_derefidx_vbuyy_then_la1
// [21] if(0!=print::msg#3[print::i#1]) goto print::@1 -- 0_neq_pbuz1_derefidx_vbuyy_then_la1
lda (msg),y
cmp #0
bne __b1

@ -1654,7 +1654,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [31] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [31] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
@ -2453,7 +2453,7 @@ cputs: {
bne !+
inc.z s+1
!:
// [31] if(0!=cputs::c#1) goto cputs::@2 -- vbuc1_neq_vbuaa_then_la1
// [31] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1
cmp #0
bne __b2
// cputs::@return

@ -319,7 +319,7 @@ hello: {
inc.z idx
// [9] hello::i#1 = ++ hello::i#2 -- vbuxx=_inc_vbuxx
inx
// [10] if(0!=msg[hello::i#1]) goto hello::@1 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
// [10] if(0!=msg[hello::i#1]) goto hello::@1 -- 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda msg,x
cmp #0
bne __b1_from___b1
@ -474,7 +474,7 @@ hello: {
// [9] hello::i#1 = ++ hello::i#2 -- vbuxx=_inc_vbuxx
inx
// while(msg[i])
// [10] if(0!=msg[hello::i#1]) goto hello::@1 -- vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
// [10] if(0!=msg[hello::i#1]) goto hello::@1 -- 0_neq_pbuc1_derefidx_vbuxx_then_la1
lda msg,x
cmp #0
bne __b1

Some files were not shown because too many files have changed in this diff Show More