dim temp_word as word at &hd0
dim low_byte as byte at &hd0 overlay
dim high_byte as byte at &hd1 overlay
dim bit_0 as bit
dim bit_1 as bit
etc. bis
dim bit_10 as bit

do
incr temp_word
if temp_word >1023 then temp_word=0

bit_0 = low_byte.0
bit_1 = low_byte.1
etc. bis
bit_10 = high_byte.1
loop