A virtual machine has a first upper level script, a second upper level
script, and common block of script. The first and second scripts and the
common block of script are interpreted by an interpreter of the virtual
machine. The common block of script may, for example, be a script that
encodes data bits in accordance with a remote control device
communication protocol. The first script may include information for
outputting first data bits (for example, key data). The second script may
include information for outputting second data bits (for example, key
data). The first script calls the common script, thereby outputting the
first data in accordance with the protocol. The second script also calls
the common script, thereby outputting the second data in accordance with
the same protocol. Use of the common script in the outputting of the
first and second data reduces memory requirements and therefore system
cost.