Implemented the has_source value with mode setting.

This is an example of using the has_source values mentioned in #3 and implemented in hal-sim by @virtuald/html_interface#3.