#NEWLINE# def writeBlockMemoryUnaligned8( self , addr , data ) : #NEWLINE# #INDENT# '\n        write a block of unaligned bytes in memory.\n        ' #NEWLINE# size = len ( data ) #NEWLINE# idx = 0 #NEWLINE# if ( ( size > 0 ) and ( addr & 1 ) ) : #NEWLINE# #INDENT# self . writeMemory ( addr , data [ idx ] , 8 ) #NEWLINE# size -= 1 #NEWLINE# addr += 1 #NEWLINE# idx += 1 #NEWLINE# #UNINDENT# if ( ( size > 1 ) and ( addr & 2 ) ) : #NEWLINE# #INDENT# self . writeMemory ( addr , ( data [ idx ] | ( data [ ( idx + 1 ) ] << 8 ) ) , 16 ) #NEWLINE# size -= 2 #NEWLINE# addr += 2 #NEWLINE# idx += 2 #NEWLINE# #UNINDENT# if ( size >= 4 ) : #NEWLINE# #INDENT# data32 = conversion . byteListToU32leList ( data [ idx : ( idx + ( size & ( ~ 3 ) ) ) ] ) #NEWLINE# self . writeBlockMemoryAligned32 ( addr , data32 ) #NEWLINE# addr += ( size & ( ~ 3 ) ) #NEWLINE# idx += ( size & ( ~ 3 ) ) #NEWLINE# size -= ( size & ( ~ 3 ) ) #NEWLINE# #UNINDENT# if ( size > 1 ) : #NEWLINE# #INDENT# self . writeMemory ( addr , ( data [ idx ] | ( data [ ( idx + 1 ) ] << 8 ) ) , 16 ) #NEWLINE# size -= 2 #NEWLINE# addr += 2 #NEWLINE# idx += 2 #NEWLINE# #UNINDENT# if ( size > 0 ) : #NEWLINE# #INDENT# self . writeMemory ( addr , data [ idx ] , 8 ) #NEWLINE# size -= 1 #NEWLINE# addr += 1 #NEWLINE# idx += 1 #NEWLINE# #UNINDENT# return