@0 ## SHIFT AND ADD # NOTE: ALL INPUTS # ARE LESS THAN 16 @1 MOV UP ACC 8: SUB 7 MOV ACC DOWN JGZ 4 ADD 8 4: SUB 4 MOV ACC DOWN JGZ 2 ADD 4 2: SUB 2 MOV ACC DOWN JGZ 1 ADD 2 1: SUB 1 MOV ACC DOWN @2 MOV UP ACC 1: MOV ACC DOWN ADD ACC 2: MOV ACC DOWN ADD ACC 4: MOV ACC DOWN ADD ACC 8: MOV ACC DOWN @3 @4 MOV UP RIGHT @5 LOAD:MOV -1 RIGHT MOV UP RIGHT MOV UP RIGHT MOV UP RIGHT MOV UP RIGHT LOOP:MOV RIGHT ACC JLZ LOAD SAV MOV LEFT ACC JGZ 1 0: MOV 0 DOWN JMP LOOP 1: SWP MOV ACC DOWN JMP LOOP @6 @7 MOV UP ACC ADD UP ADD UP ADD UP MOV ACC DOWN @8