示例#1
0
 def _parse_asm_directive(self, directive):
     if parse_asm_block_directive(directive, self.stack):
         self.include = True
         for p, i in self.stack:
             if p == 'isub':
                 do_op = self.asm_mode > 0
             elif p == 'ssub':
                 do_op = self.asm_mode > 1
             elif p == 'ofix':
                 do_op = self.fix_mode > 0
             elif p == 'bfix':
                 do_op = self.fix_mode > 1
             else:
                 do_op = False
             if do_op:
                 self.include = i == '+'
             else:
                 self.include = i == '-'
             if not self.include:
                 return
     if not self.include:
         return
     if directive.startswith('isub=') and self.asm_mode > 0:
         self.subs[3] = directive[5:].rstrip()
     elif directive.startswith('ssub=') and self.asm_mode > 1:
         self.subs[2] = directive[5:].rstrip()
     elif directive.startswith('ofix=') and self.fix_mode > 0:
         self.subs[1] = directive[5:].rstrip()
     elif directive.startswith('bfix=') and self.fix_mode > 1:
         self.subs[0] = directive[5:].rstrip()
示例#2
0
 def _parse_asm_directive(self, directive):
     if parse_asm_block_directive(directive, self.stack):
         self.disassemble = True
         for _p, i in self.stack:
             if i != '-':
                 self.disassemble = False
                 break
示例#3
0
 def _parse_asm_directive(self, directive):
     if parse_asm_block_directive(directive, self.stack):
         self.include = True
         for p, i in self.stack:
             if p == 'isub':
                 do_op = self.asm_mode > 0
             elif p == 'ssub':
                 do_op = self.asm_mode > 1
             elif p == 'ofix':
                 do_op = self.fix_mode > 0
             elif p == 'bfix':
                 do_op = self.fix_mode > 1
             else:
                 do_op = False
             if do_op:
                 self.include = i == '+'
             else:
                 self.include = i == '-'
             if not self.include:
                 return
     if not self.include:
         return
     if directive.startswith('isub=') and self.asm_mode > 0:
         self.subs[3] = directive[5:].rstrip()
     elif directive.startswith('ssub=') and self.asm_mode > 1:
         self.subs[2] = directive[5:].rstrip()
     elif directive.startswith('ofix=') and self.fix_mode > 0:
         self.subs[1] = directive[5:].rstrip()
     elif directive.startswith('bfix=') and self.fix_mode > 1:
         self.subs[0] = directive[5:].rstrip()
示例#4
0
 def _parse_asm_directive(self, directive):
     if parse_asm_block_directive(directive, self.stack):
         self.disassemble = True
         for _p, i in self.stack:
             if i != '-':
                 self.disassemble = False
                 break
示例#5
0
 def _parse_asm_directive(self, directive):
     if parse_asm_block_directive(directive, self.stack):
         self.verbatim = False
         for _p, i in self.stack:
             if i != '-':
                 self.verbatim = True
                 break
示例#6
0
 def _parse_asm_directive(self, directive):
     if parse_asm_block_directive(directive, self.stack):
         self.verbatim = False
         for _p, i in self.stack:
             if i != '-':
                 self.verbatim = True
                 break
示例#7
0
 def _parse_asm_directive(self, directive):
     if parse_asm_block_directive(directive, self.stack):
         self.disassemble = True
         for _p, i in self.stack:
             if i != '-':
                 self.disassemble = False
                 break
     elif directive.startswith(('defb=', 'defs=', 'defw=')):
         parse_asm_data_directive(self.snapshot, directive)
示例#8
0
 def _parse_asm_directive(self, directive):
     if parse_asm_block_directive(directive, self.stack):
         self.disassemble = True
         for _p, i in self.stack:
             if i != '-':
                 self.disassemble = False
                 break
     elif directive.startswith(('defb=', 'defs=', 'defw=')):
         parse_asm_data_directive(self.snapshot, directive)
示例#9
0
    def _parse_asm_directive(self, directive, ignores, line_no):
        if parse_asm_block_directive(directive, self.stack):
            self.mode.include = True
            for _p, i in self.stack:
                if i != '-':
                    self.mode.include = False
                    break
            return

        if self.mode.include:
            if directive == AD_IGNOREUA:
                ignores.append(line_no)
            else:
                self.mode.add_asm_directive(directive)
示例#10
0
    def _parse_asm_directive(self, directive, ignores, line_no):
        if parse_asm_block_directive(directive, self.stack):
            self.mode.include = True
            for _p, i in self.stack:
                if i != '-':
                    self.mode.include = False
                    break
            return

        if self.mode.include:
            if directive == AD_IGNOREUA:
                ignores.append(line_no)
            else:
                self.mode.add_asm_directive(directive)
示例#11
0
    def _parse_asm_directive(self, directive, ignores, line_no):
        if parse_asm_block_directive(directive, self.stack):
            self.mode.include = True
            for _p, i in self.stack:
                if i != '-':
                    self.mode.include = False
                    break
            return

        if self.mode.include:
            tag, sep, value = directive.rstrip().partition('=')
            if sep and tag in ('rsub', 'ssub', 'isub', 'rfix', 'bfix', 'ofix', 'assemble', 'label', 'rem'):
                self.mode.add_instruction_asm_directive(tag, value)
            elif not sep and tag in ('nolabel', 'nowarn', 'keep'):
                self.mode.add_instruction_asm_directive(tag)
            elif not sep and tag == AD_IGNOREUA:
                ignores.append(line_no)
            elif sep and (tag in (AD_ORG, AD_WRITER, AD_REPLACE) or tag.startswith(AD_SET)):
                self.mode.add_entry_asm_directive(tag, value)
            elif not sep and tag in (AD_START, AD_END):
                self.mode.add_entry_asm_directive(tag)