N equ 20 org $1000 total rmb 1 org $1500 ; starting address of the program ldaa #0 staa total ; initialize total to 0 ldx #array ; use index register X as the array pointer ldab #N ; use accumulator B as the loop count loop brclr 0,x,$03,yes bra chkend yes inc total ; add 1 to the total chkend inx ; move the array pointer dbne b,loop forever bra forever array db 2,3,4,8,12,13,19,24,33,32,20,18,53,52,80,82,90,94,100,102 end