Make python script py3 compatible

This commit is contained in:
Thomas Lovén 2017-12-06 21:29:12 +01:00
parent 83e204e52e
commit 61bc1221bf

View File

@ -1,32 +1,33 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
num_isr = 256
pushes_error = [8, 10, 11, 12, 13, 14, 17]
print '''
print('''
.intel_syntax noprefix
.extern isr_common
'''
''')
print '// Interrupt Service Routines'
print('// Interrupt Service Routines')
for i in range(num_isr):
print '''isr{0}:
print('''isr{0}:
cli
{1}
push {0}
jmp isr_common
'''.format(i,
'push 0' if i not in pushes_error else 'nop')
jmp isr_common '''.format(i,
'push 0' if i not in pushes_error else 'nop'))
print ''
print '''
print('')
print('''
// Vector table
.section .data
.global isr_table
isr_table:'''
isr_table:''')
for i in range(num_isr):
print ' .quad isr{}'.format(i)
print(' .quad isr{}'.format(i))