uroboros-diversification/src/postprocess/compile_process.py
def adjusttbb(pos):
    """
    Routine to fix tbb value overflow
    :param pos: error line number
    """
    i = 0
    pos.sort()
    with open('final.s') as f:
        lines = f.readlines()
    while i < len(pos):
        c = pos[i] - 1
        while 'tbb' not in lines[c]: c -= 1
        lines[c] = lines[c].replace('tbb', 'tbh', 1).replace(']', ',lsl #1]', 1)
        while '.byte (' not in lines[c]: c += 1
        while '.byte (' in lines[c]:
            lines[c] = lines[c].replace('.byte', '.short', 1)
            if i < len(pos) and c == pos[i]: i += 1
            c += 1
    with open('final.s', 'w') as f:
        f.writelines(lines)

    Routine to fix tbb value overflow
    :param pos: error line number
    
Routine to fix tbb value overflow
Routine to fix tbb value overflow
def adjusttbb(pos):
    i = 0
    pos.sort()
    with open('final.s') as f:
        lines = f.readlines()
    while i < len(pos):
        c = pos[i] - 1
        while 'tbb' not in lines[c]: c -= 1
        lines[c] = lines[c].replace('tbb', 'tbh', 1).replace(']', ',lsl #1]', 1)
        while '.byte (' not in lines[c]: c += 1
        while '.byte (' in lines[c]:
            lines[c] = lines[c].replace('.byte', '.short', 1)
            if i < len(pos) and c == pos[i]: i += 1
            c += 1
    with open('final.s', 'w') as f:
        f.writelines(lines)
def adjusttbb ( pos ) : i = 0 pos . sort ( ) with open ( 'final.s' ) as f : lines = f . readlines ( ) while i < len ( pos ) : c = pos [ i ] - 1 while 'tbb' not in lines [ c ] : c -= 1 lines [ c ] = lines [ c ] . replace ( 'tbb' , 'tbh' , 1 ) . replace ( ']' , ',lsl #1]' , 1 ) while '.byte (' not in lines [ c ] : c += 1 while '.byte (' in lines [ c ] : lines [ c ] = lines [ c ] . replace ( '.byte' , '.short' , 1 ) if i < len ( pos ) and c == pos [ i ] : i += 1 c += 1 with open ( 'final.s' , 'w' ) as f : f . writelines ( lines )
Routine to fix tbb value overflow
Routine to fix tbb value overflow
"""
    Routine to fix tbb value overflow
    :param pos: error line number
    """
pos
error line number
error line number