def to_asm(self):
        s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ "
        start = 0
        bytes = [(s.index(c) + start) for c in self.upper()]
        bytes.append(0x25)  # TODO: EndString
        hexes = ["$%02X" % v for v in bytes]
        asm = ''
        length = (len(hexes) / 16)
        if len(hexes) % 16:
            length += 1
        for i in range(length):
            asm += '  .db ' + ','.join(hexes[i * 16:i * 16 + 16]) + '\n'
        if len(asm) > 0:
            return asm
        return False
dataset/ETHPy150Open gutomaia/pyNES/pynes/nes_types.py/NesString.to_asm/original