#NEWLINE# def next_instruction( self ) : #NEWLINE# #INDENT# offset = self . offset #NEWLINE# w = self . next_word ( ) #NEWLINE# ( operands , opcode ) = divmod ( w , 16 ) #NEWLINE# ( b , a ) = divmod ( operands , 64 ) #NEWLINE# if ( opcode == 0 ) : #NEWLINE# #INDENT# if ( a == 1 ) : #NEWLINE# #INDENT# first = 'JSR' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# first = ( '%s %s,' % ( INSTRUCTIONS [ opcode ] , self . format_operand ( a ) ) ) #NEWLINE# #UNINDENT# asm = ( '%s %s' % ( first , self . format_operand ( b ) ) ) #NEWLINE# binary = ' ' . join ( ( ( '%04x' % word ) for word in self . program [ offset : self . offset ] ) ) #NEWLINE# return ( '%-40s ; %04x: %s' % ( asm , offset , binary ) )