Flow chart and assembly program to divide a table by 2, and store the result to a second table.





prog:   equ     $0800
data:   equ     $0900

len:    equ     5

CODE:   section .text
        org     prog
        ldab    #len
        ldx     #table1
loop:   ldaa    0,x
        asra
        staa    len,x
        inx
        decb
        bhi     loop
        swi

DATA:   section .data
        org     data

; Initialize data table and create names for the start and end
; of the table
table1: dc.b    $07,$e2,$a5,$91,$23
table2: ds.b    len