tiny change from :

Code: Select all

```
.recurse
; Start recursion.
lda midx: pha
lda midy: pha
; Calculate centre point.
clc
lda boxx1
adc boxx2 ; produces 9-bit result in C:A
ror A ; 9-bit right shift
sta midx
cmp boxx1
beq box_too_small
clc
lda boxy1
adc boxy2 ; produces 9-bit result in C:A
ror A ; 9-bit right shift
sta midy
cmp boxy1
beq box_too_small midy
```

Code: Select all

```
.recurse
; Start recursion.
; Calculate centre point.
clc
lda boxx1
adc boxx2 ; produces 9-bit result in C:A
ror A ; 9-bit right shift
cmp boxx1
beq box_too_small_x
ldx midx:phx
sta midx
clc
lda boxy1
adc boxy2 ; produces 9-bit result in C:A
ror A ; 9-bit right shift
cmp boxy1
beq box_too_small_y
ldy midy: phy
sta midy
;.....
.box_too_small
pla: sta midy
.box_too_small_y
pla: sta midx
.box_too_small_x
rts
```