, Create 0 00000 00000 00001 1 for incrementing B
set 512 1
, Create 0 00000 00001 00000 32 for incrementing G
set 511 32
, Create 0 00001 00000 00000 1024 for incrementing R
set 510 1024
set 1000 1
,
ain 298
ldib 2
div
sta 288
,
ain 299
ldib 2
div
sta 289
,    Calculate Red
ain 288
bin 510
mult
sta 300
,    Calculate Green
ain 289
bin 511
mult
sta 301
,    Calculate Blue
ain 288
bin 289
add
sta 400
ldia 63
bin 400
sub
ldib 3
div
sta 302
,    output
ain 300
bin 301
add
bin 302
add
out
,    incrementer
ain 298
ldib 1
add
sta 298
ldia 62
bin 298
sub
jmpc 0
ldi 0
sta 298
ain 299
ldib 1
add
sta 299
ldia 63
bin 299
sub
jmpc 0
ldia 0
sta 299
jmp 0
