Commits

matusz  committed 15bf4cc

CALL opcode and syntax corrected

  • Participants
  • Parent commits 2f9c449

Comments (0)

Files changed (2)

 _linker_list = ['plink86', 'blinker']
 
 def FormatList():
-  '''export format list'''
   return _format_list
 
 def LinkerList():
-  '''export linker list'''
   return _linker_list
 
 class StackCorrupted(Exception):
-  '''exception for the situation, when expression stack gets broken'''
   def __init__(self, value):
     Exception.__init__(self, value)
     self.value = value
           else:
             break
             
-      if mnemonic in ("FC_SUBPROC","FC_DOPROC"): # subproc call syntax
+      if mnemonic in ("FC_SUBPROC","FC_DOPROC","FC_CALL"): # subproc call syntax
         called_func = self.expstack.pop()
         parcnt = string.atoi(self.expstack.pop())
         if parcnt>0:
         #print "DEBUG parcnt",parcnt
         #print "DEBUG pars",pars
         parstr = ", ".join(pars)
-        if mnemonic == "FC_DOPROC":
+        if mnemonic in ("FC_DOPROC","FC_CALL"):
           if parcnt == 0:
             parstr = ""
           else:
       has_result = opc_data["OP_RESULT"]
       if has_result not in (0, 1):
         declip_line += "  declip dictionary error"
+        raise Error("declip dictionary error")
         sys.exit(1)
       if has_result == 0: 
         declip_line += "%s" % res.rstrip()

File pcodedata.py

    10 : {  'OP_MNEMON' : 'FN_AT'           ,  'OP_STRING' : 'AT(%s, %s)'         ,  'OP_CLASS' : 'function' ,  'OP_RESULT' : 1  ,  'OP_STACKPR' :   2,  'OP_WORDPR' :   0,  'OP_DECVAL' :  10 },
    12 : {  'OP_MNEMON' : 'FN_BOF'          ,  'OP_STRING' : 'BOF()'              ,  'OP_CLASS' : 'function' ,  'OP_RESULT' : 1  ,  'OP_STACKPR' :   0,  'OP_WORDPR' :   0,  'OP_DECVAL' :  12 },
    13 : {  'OP_MNEMON' : 'DV_BOX'          ,  'OP_STRING' : '@ %s,%s,%s,%s box %s', 'OP_CLASS' : 'deviceio' ,  'OP_RESULT' : 0  ,  'OP_STACKPR' :   5,  'OP_WORDPR' :   0,  'OP_DECVAL' :  13 },
-   15 : {  'OP_MNEMON' : 'CM_CALL'         ,  'OP_STRING' : 'CALL'               ,  'OP_CLASS' : 'command'  ,  'OP_RESULT' : ''   ,  'OP_STACKPR' :   2,  'OP_WORDPR' :   0,  'OP_DECVAL' :  15 },
+   15 : {  'OP_MNEMON' : 'FC_CALL'         ,  'OP_STRING' : 'CALL %s %s'         ,  'OP_CLASS' : 'flowctrl' ,  'OP_RESULT' : 0   ,  'OP_STACKPR' :   2,  'OP_WORDPR' :   0,  'OP_DECVAL' :  15 },
    16 : {  'OP_MNEMON' : 'FN_CDOW'         ,  'OP_STRING' : 'CDOW(%s)'           ,  'OP_CLASS' : 'function' ,  'OP_RESULT' : 1  ,  'OP_STACKPR' :   1,  'OP_WORDPR' :   0,  'OP_DECVAL' :  16 },
    17 : {  'OP_MNEMON' : 'FC_PAR_LIST'     ,  'OP_STRING' : 'PARAMS(%s):'        ,  'OP_CLASS' : 'flowctrl' ,  'OP_RESULT' : 0  ,  'OP_STACKPR' :   0,  'OP_WORDPR' :   1,  'OP_DECVAL' :  17 },
    18 : {  'OP_MNEMON' : 'FN_CHR'          ,  'OP_STRING' : 'CHR(%s)'            ,  'OP_CLASS' : 'function' ,  'OP_RESULT' : 1  ,  'OP_STACKPR' :   1,  'OP_WORDPR' :   0,  'OP_DECVAL' :  18 },