Skip to content

Commit

Permalink
Merge pull request #167 from ivop/dinfo
Browse files Browse the repository at this point in the history
dinfo: replace several labels by structured programming macros.
  • Loading branch information
davidgiven authored Sep 5, 2024
2 parents 6ce629e + 4761a57 commit 4372574
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions apps/dinfo.asm
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,24 @@ success:
ldx #7
.zrepeat
lsr A
bcs used
inc val1
.zif eq
inc val1+1
.zif cc
inc val1
.zif eq
inc val1+1
.zendif
.zendif
used:
inc count
.zif eq
inc count+1
.zendif
pha
lda count+1
cmp dsm+1
bne notyet
lda count
cmp dsm
beq stop \ stop condition
notyet:
.zif eq
lda count
cmp dsm
beq stop \ stop condition
.zendif
pla
dex
.zuntil mi
Expand All @@ -222,11 +222,10 @@ stop:
dex
dex
stx count \ save bsh-3 for later
beq no_shift

jsr shift_val1_left_by_x
.zif ne
jsr shift_val1_left_by_x
.zendif

no_shift:
lda val1
ldx val1+1
ldy #0
Expand All @@ -245,11 +244,10 @@ no_shift:
lda dsm+1
sta val1+1
ldx count
beq no_shift2

jsr shift_val1_left_by_x
.zif ne
jsr shift_val1_left_by_x
.zendif

no_shift2:
lda val1
ldx val1+1
ldy #0
Expand Down

0 comments on commit 4372574

Please sign in to comment.