DEPTH 256
// SW4..3 chooses 0, 9, 99 or 65534 on reset. SW2..0 sets the delay.
        mvt r4,#0x30
        ld  r2,[r4]
        and r2,#24
        beq seed0
        sub r2,#8
        beq seed9
        sub r2,#8
        beq seed99
        mv  r0,#-2
        b   show
seed99: mv  r0,#99
        b   show
seed9:  mv  r0,#9
        b   show
seed0:  mv  r0,#0
// Keep the binary counter in r0. Extract five decimal places from the copy.
show:   mv  r1,r0
        and r1,#255
        mvt r5,#0x20
        add r5,#4
        mv  r6,#powers
        mv  r2,#5
place:  ld  r4,[r6]
        mv  r3,#0
trial:  sub r1,r4
        bcc restore
        add r3,#1
        b   trial
restore: add r1,r4
        mv  r4,#glyphs
        add r4,r3
        ld  r3,[r4]
        st  r3,[r5]
        sub r5,#1
        add r6,#1
        sub r2,#1
        bne place
// Delay for one through eight outer passes before incrementing.
        mvt r4,#0x30
        ld  r2,[r4]
        and r2,#7
        add r2,#1
outer:  mvt r1,#2
inner:  sub r1,#1
        bne inner
        sub r2,#1
        bne outer
        add r0,#1
        b   show
powers: .word 10000
        .word 1000
        .word 100
        .word 10
        .word 1
glyphs: .word 63
        .word 6
        .word 91
        .word 79
        .word 102
        .word 109
        .word 125
        .word 7
        .word 127
        .word 111
