0011 0000 0000 0000 ; program starts at x3000 0010 001 100000000 ; load bit pattern to left shift 0010 010 100000001 ; load number of time to left shift 0000 010 000000110 ; branch if zero 0001 001 001 000 001 ; left shift by one 0001 010 010 1 11111 ; decrement count 0000 111 000000010 ; branch to top of loop 0011 001 100000010 ; store shifted result 1111 0000 00100101 ; stop the simulator ; -------------------------------------- ; | load bit pattern to left shift | ; | load number of times to left shift | ; -------------------------------------- ; | ; ------------->| ; | V ; | / \ ; | / \ ; | / test \ yes ; | < for >-------- ; | \ zero / | ; | \ / | ; | \ / | ; | |no | ; | | | ; | V | ; | --------------------- | ; | | left shift by one | | ; | | decrement count | | ; | --------------------- | ; | | | ; --------------- | ; | ; --------------- ; | ; V ; ------------------------ ; | store shifted result | ; | stop the simulator | ; ------------------------ ; | ; V