def __mkopcodes__(self):
        """Convert the parse list into machine code for output."""
        proglen = len(self.pl)
        self.dowarn('info: Read {} instructions from input'.format(
                proglen))

        # pad free space with empty SKP instructions
        icnt = proglen
        while icnt < PROGLEN:
            self.pl.append({'cmd':['SKP',0x00,0x00],
                            'addr':icnt,
                            'target':None})
            icnt += 1
        
        # if required, skip over unused instructions
        if self.doskip:
            icnt = proglen
            while icnt < PROGLEN:
                skplen = PROGLEN - icnt - 1
                if skplen > 63:
                    skplen = 63
                # replace skp at icnt
                self.pl[icnt]={'cmd':['SKP',0x00,skplen],
                               'addr':icnt,
                               'target':None}
                icnt += skplen + 1

        # convert program to machine code and prepare for output
        cnt = 0
        for i in self.pl:
            oft = cnt * 4
            nop = tob32(op_gen(i['cmd']))
            self.program[oft] = nop[0]
            self.program[oft+1] = nop[1]
            self.program[oft+2] = nop[2]
            self.program[oft+3] = nop[3]
            cnt += 1
def __mkopcodes__ ( self ) : proglen = len ( self . pl ) self . dowarn ( 'info: Read {} instructions from input' . format ( proglen ) ) icnt = proglen while icnt < PROGLEN : self . pl . append ( { 'cmd' : [ 'SKP' , 0x00 , 0x00 ] , 'addr' : icnt , 'target' : None } ) icnt += 1 if self . doskip : icnt = proglen while icnt < PROGLEN : skplen = PROGLEN - icnt - 1 if skplen > 63 : skplen = 63 self . pl [ icnt ] = { 'cmd' : [ 'SKP' , 0x00 , skplen ] , 'addr' : icnt , 'target' : None } icnt += skplen + 1 cnt = 0 for i in self . pl : oft = cnt * 4 nop = tob32 ( op_gen ( i [ 'cmd' ] ) ) self . program [ oft ] = nop [ 0 ] self . program [ oft + 1 ] = nop [ 1 ] self . program [ oft + 2 ] = nop [ 2 ] self . program [ oft + 3 ] = nop [ 3 ] cnt += 1
Convert the parse list into machine code for output.