'Calculate distance between two addresses
Usage:
MYNAME address (calculate from current $SP to address)
MYNAME address1 address2'

def distance(self, *arg):

    (start, end) = normalize_argv(arg, 2)
    if ((to_int(start) is None) or ((to_int(end) is None) and (not self._is_running()))):
        self._missing_argument()
    sp = None
    if (end is None):
        sp = peda.getreg('sp')
        end = start
        start = sp
    dist = (end - start)
    text = ('From    0x%x%s    to    0x%x:    ' % (start, ('    (SP)' if (start == sp) else ''), end))
    text += ('%d    bytes,    %d    dwords%s' % (dist, (dist // 4), (('    (+%d    bytes)' % (dist % 4)) if ((dist % 4) != 0) else '')))
    msg(text)
    return
