本文整理汇总了Python中assembler.eloc函数的典型用法代码示例。如果您正苦于以下问题:Python eloc函数的具体用法?Python eloc怎么用?Python eloc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eloc函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,asm,stmt,debug=False):
self.asm=asm
self.stmt=stmt
self.debug=debug
# These attributes are established during parsing operations
self.label_fld=None # See parse_label() method
self.oper_fld=None # See parse_operation() method
self.operands=[] # See parse_operands() method
self.comments=[] # See find_comment() method
self.comment_pos=None # Starting position of the comment
# Symbolic replacements:
self.rlbl=''
self.roper=None
self.ropnd=[]
# Handle loud comment model statements here
self.loud=None
logline=stmt.logline
if __debug__:
if debug:
print("%s logline: %s" \
% (assembler.eloc(self,"__init__",module=this_module),logline))
if logline.comment and not logline.quiet:
self.loud=logline.plines[0].text
if __debug__:
if debug:
print("%s [%s] loud: %s" \
% (assembler.eloc(self,"__init__",module=this_module),\
stmt.lineno,self.loud))
开发者ID:mstram,项目名称:SATK,代码行数:33,代码来源:model.py
示例2: str_cont
def str_cont(self,value):
assert isinstance(value,StringToken),\
"%s 'value' argument must be a StringToken object: %s"\
% (assembler.eloc(self,"str_cont",module=this_module),value)
assert isinstance(self._string,StringToken),\
"%s '_string' attribute must be a StringToken object: %s" \
% (assembler.eloc(self,"str_cont",module=this_module),self.string)
self._string.extend(value)
开发者ID:mstramb,项目名称:SATK,代码行数:9,代码来源:asmtokens.py
示例3: str_begin
def str_begin(self,value):
assert isinstance(value,StringToken),\
"%s 'value' argument must be a StringToken object: %s"\
% (assembler.eloc(self,"str_begin",module=this_module),value)
assert self._string is None,\
"%s '_string' attribute is not None when starting a compound string: %s" \
% (assembler.eloc(self,"str_begin",module=this_module),\
self._string)
self._string=value
开发者ID:mstramb,项目名称:SATK,代码行数:10,代码来源:asmtokens.py
示例4: parse_sep
def parse_sep(self,stmt,debug=False):
parser=self.__fetch_parser(stmt.get_Operand_Parser())
if __debug__:
if debug:
print("%s parser: %s" \
% (assembler.eloc(self,"parse_sep",module=this_module),parser))
result=parser.parse_operands(stmt,debug=debug)
if __debug__:
if debug:
print("%s result: %s" \
% (assembler.eloc(self,"parse_sep",module=this_module),result))
return result
开发者ID:mstram,项目名称:SATK,代码行数:14,代码来源:parsers.py
示例5: fetch
def fetch(self,lit_str,debug=False):
assert isinstance(lit_str,str),\
"%s 'lit_str' argument not a string: %s" \
% (assembler.eloc(self,"fetch",module=this_module),lit_str)
assert len(lit_str)>1 and lit_str[0]=="=",\
"%s 'lit_str' argument is not a valid literal: '%s'" \
% (assembler.eloc(self,"fetch",module=this_module),lit_str)
lit=self.literals[lit_str]
if __debug__:
if debug:
print("%s RETURNING LITERAL OBJECT: %r" \
% (assembler.eloc(self,"fetch",module=this_module),lit))
return lit
开发者ID:mstram,项目名称:SATK,代码行数:14,代码来源:literal.py
示例6: build
def build(self,stmt,trace=False):
#cls_str="insnbldr.py - %s.build() -" % self.__class__.__name__
if __debug__:
if Builder.type_check:
assert isinstance(stmt,assembler.Stmt),\
"%s 'stmt' argument requires instance of assembler.Stmt: %s" \
% (assembler.eloc(self,"build",module=this_module),stmt)
fmt=stmt.format # msldb.Format instance
insn=stmt.insn # assembler.MSLentry instance
line=stmt.lineno # Source object of statement's input location
if trace:
insn.dump() # Dump the MSL DB information
# Marshall what we need to create the instruction
i=Instruction(stmt.operands,insn,fmt,line)
if trace:
i.dump()
# NOW!!! build the instruction
barray=i.generate(self)
if trace:
print("%s: " % insn.mnemonic)
s=""
for x in barray:
s="%s %s" % (s,hex(x))
print(" %s" % s)
# Update the statenent's binary object
bin=stmt.content # Get Binary object from the Stmt
bin.update(barray,at=0,full=True,finalize=True,trace=trace)
开发者ID:mstramb,项目名称:SATK,代码行数:31,代码来源:insnbldr.py
示例7: define
def define(self,oper):
assert isinstance(oper,asmbase.ASMOper),\
"%s 'oper' argument must be an asmbase.ASMOper object: %s" \
% (assembler.eloc(self,"define",module=this_module),oper)
assert oper.info._defined is not None,\
"%s macro definition line is None: %s" \
% (assembler.eloc(self,"define",module=this_module),macro)
name=oper.info.name
try:
entry=self.macros[name]
# Macro is being redefined
entry.redefine(oper)
except KeyError:
# First macro definition with this name
self.macros[name]=MTE(oper)
开发者ID:mstram,项目名称:SATK,代码行数:16,代码来源:asmoper.py
示例8: literal_new
def literal_new(self,lit,line,debug=False):
lit.reference(line)
if lit.unique:
self.unique.append(lit)
if __debug__:
if debug:
print("%s [%s] LITERAL POOL %s ADDING UNIQUE: %r" \
% (assembler.eloc(self,"literal_new",module=this_module),\
line,self.pool_id,lit))
else:
self.literals[lit.name]=lit
if __debug__:
if debug:
print("%s [%s] LITERAL POOL %s ADDING: %r" \
% (assembler.eloc(self,"literal_new",module=this_module),\
line,self.pool_id,lit))
开发者ID:mstram,项目名称:SATK,代码行数:16,代码来源:literal.py
示例9: build
def build(self,asm,parsers,stmt,n,length,trace=False):
if length != 2:
raise assembler.AssemblerError(line=stmt.lineno,\
msg="operand %s S-type explicit length invalid: %s" % (n+1,length))
value=parsers.evaluate_expr(asm,stmt,self.expr,debug=False,trace=trace)
if isinstance(value,int):
raise assembler.AssemblerError(line=stmt.lineno,\
msg="operand %s S-type value not an address: %s" % (n+1,value))
try:
base,disp=asm.bases.find(value,12,asm,trace=trace)
except KeyError:
# Could not resolve base register and displacement
raise assembler.AssemblerError(line=stmt.lineno,\
msg="operand %s S-type constant could not resolve implied base "
"register for location: %s" % (n+1,value)) from None
value=(base<<12)+(0xFFF & disp)
b=value.to_bytes(2,byteorder="big",signed=False)
if __debug__:
if trace:
print("%s return bytes: %s '%s'" \
% (assembler.eloc(self,"build",module=this_module),len(b),b))
return b
开发者ID:mstramb,项目名称:SATK,代码行数:28,代码来源:asmdcds.py
示例10: ltoken_update
def ltoken_update(self,stmt,ltok,asmstr=None):
assert isinstance(asmstr,asmbase.ASMString),\
"%s 'asmstr' argument must be an instance of asmbase.ASMString: %s" \
% (assembler.eloc(self,"ltoken_update",module=this_module),asmstr)
loc=asmstr.ndx2loc(ltok.linepos)
ltok.update_loc(stmt.lineno,loc)
开发者ID:mstram,项目名称:SATK,代码行数:7,代码来源:parsers.py
示例11: extend
def extend(self,ltok):
assert isinstance(ltok,StringToken),\
"%s 'ltok' argument must be another StringToken object: %s" \
% (assembler.eloc(self,"extend",module=this_module),ltok)
self.string="%s%s" % (self.string,ltok.string)
#print('following extend: self.string="%s"' % self.string)
self.end=ltok.end
开发者ID:mstramb,项目名称:SATK,代码行数:8,代码来源:asmtokens.py
示例12: parse_model
def parse_model(self,stmt,field,debug=False):
if __debug__:
if debug:
print("%s debug: %s" \
% (assembler.eloc(self,"parse_model",module=this_module),debug))
parser=self.__fetch_parser("mopnd")
return parser.parse_model(stmt,field,debug=debug)
开发者ID:mstram,项目名称:SATK,代码行数:8,代码来源:parsers.py
示例13: __init__
def __init__(self,addrexpr):
assert isinstance(addrexpr,pratt2.PExpr),\
"%s 'addrexpr' argument must be a pratt2.PExpr: %s" \
% (assembler.eloc(self,"__init__",module=this_module),addrexpr)
length,align=self.__class__.attr
super().__init__(addrexpr,length=length,alignment=align,signed=False)
self.ivalue=SCON(addrexpr)
开发者ID:mstramb,项目名称:SATK,代码行数:8,代码来源:asmdcds.py
示例14: parse_operation
def parse_operation(self,asm,stmt,debug=False):
if __debug__:
if debug:
print("%s called" % assembler.eloc(self,"parse_operation",\
module=this_module))
result=self.__parse(asm,stmt,stmt.oper_fld,debug=debug)
self.oper_fld=self.prepare_result(stmt,result,"oper",debug=debug)
开发者ID:mstram,项目名称:SATK,代码行数:8,代码来源:model.py
注:本文中的assembler.eloc函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论