; used for the SRC command for the RAM register ramPair = 0 ; variable for the direction of the LED scrolling (index register address) direction = 2 ; current LED scrolling value led = 3 ; temporary register for sub/add etc. tmp = 4 ; select CM-RAM0, Bank0 ldm 0 dcl ; send register control: RAM chip 0, register 1 fim ramPair, 0 src ramPair ; initialize LED and scroll direction clb xch direction ldm 1 xch led ; write content of LED register to RAM output register next ld led wmp ; test direction ld direction jcn $4, left ; jump if accumulator is zero ; scroll right ldm 1 xch tmp ld led clc sub tmp jcn $c, do_rar ; jump if accumulator is not zero ; change direction ldm 0 xch direction jun next do_rar ld led clc rar xch led jun next ; scroll left left ldm 8 xch tmp ld led clc sub tmp jcn $c, do_ral ; jump if accumulator is not zero ; change direction ldm 1 xch direction jun next do_ral ld led clc ral xch led jun next