def get_signed_hex_offset_as_str(signed_offset, width):
    if (signed_offset < 0):
        s = '-'
        offset = abs(signed_offset)
    else:
        s = '+'
        offset = signed_offset
    if (width == 2):
        s += ('%2.2x' % (offset & 255))
    elif (width == 4):
        s += ('%4.4x' % (offset & 65535))
    elif (width == 8):
        s += ('%8.8x' % (offset & 4294967295))
    else:
        raise ValueError('only sizes of 2 4 or 8 are supported')
    return s
def get_signed_hex_offset_as_str(signed_offset, width):
    if (signed_offset < 0):
        s = '-'
        offset = abs(signed_offset)
    else:
        s = '+'
        offset = signed_offset
    if (width == 2):
        s += ('%2.2x' % (offset & 255))
    elif (width == 4):
        s += ('%4.4x' % (offset & 65535))
    elif (width == 8):
        s += ('%8.8x' % (offset & 4294967295))
    else:
        raise ValueError('only sizes of 2 4 or 8 are supported')
    return s