def process(self, s, opc):
    s = s.replace('@R', '{0:X}'.format((opc & 15)))
    s = s.replace('@P', '{0:X}'.format((opc & 7)))
    s = s.replace('@E', '{0:X}'.format(((opc & 3) + 1)))
    s = s.replace('@BRANCH', '$R[$P] = ($R[$P] & 0xFF00) | $T8')
    s = s.replace('@LBRANCH', '$R[$P] = $T16')
    s = s.replace('@FETCH16', '$T16=$FETCH();$T16=($T16 << 8)|$FETCH()')
    s = s.replace('@LSKIP', '$R[$P] = ($R[$P]+2) & 0xFFFF')
    if (s[:4] == '@ADD'):
        params = [(('(' + x) + ')') for x in s.strip()[5:(- 1)].split(',')]
        s = (('$T16 = ' + '+'.join(params)) + ';$D = $T16 & 0xFF;$DF = ($T16 >> 8) & 1')
    return s
def process(self, s, opc):
    s = s.replace('@R', '{0:X}'.format((opc & 15)))
    s = s.replace('@P', '{0:X}'.format((opc & 7)))
    s = s.replace('@E', '{0:X}'.format(((opc & 3) + 1)))
    s = s.replace('@BRANCH', '$R[$P] = ($R[$P] & 0xFF00) | $T8')
    s = s.replace('@LBRANCH', '$R[$P] = $T16')
    s = s.replace('@FETCH16', '$T16=$FETCH();$T16=($T16 << 8)|$FETCH()')
    s = s.replace('@LSKIP', '$R[$P] = ($R[$P]+2) & 0xFFFF')
    if (s[:4] == '@ADD'):
        params = [(('(' + x) + ')') for x in s.strip()[5:(- 1)].split(',')]
        s = (('$T16 = ' + '+'.join(params)) + ';$D = $T16 & 0xFF;$DF = ($T16 >> 8) & 1')
    return s