]> git.sur5r.net Git - cc65/blobdiff - src/cc65/opcodes.c
Optimizations, cleanup in codegen
[cc65] / src / cc65 / opcodes.c
index bdd2dd66478268bd049e3af9f82c369b29be64a3..f702078710748b36f12272ed9acb6bdd2f42142a 100644 (file)
@@ -60,105 +60,112 @@ const OPCDesc OPCTable[OPCODE_COUNT] = {
     /* Opcodes for the virtual stack machine */
     {   OPC_CALL,                              /* opcode */
                "call",                                 /* mnemonic */
-               0,                                      /* size */
+               1,                                      /* size */
                REG_NONE,                               /* use */
                REG_NONE,                               /* chg */
                OF_CPU_VM | OF_CALL                     /* flags */
     },
     {   OPC_ENTER,                                     /* opcode */
                "enter",                                /* mnemonic */
-               0,                                      /* size */
+               1,                                      /* size */
                REG_Y,                                  /* use */
                REG_AXY,                                /* chg */
                OF_CPU_VM                               /* flags */
     },
     {   OPC_JMP,                               /* opcode */
                "jump",                                 /* mnemonic */
-               0,                                      /* size */
+               1,                                      /* size */
                REG_NONE,                               /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM | OF_UBRA                     /* flags */
     },
     {   OPC_LDA,                               /* opcode */
-               "loada",                                /* mnemonic */
-               0,                                      /* size */
+               "lda",                                  /* mnemonic */
+               1,                                      /* size */
                REG_NONE,                               /* use */
                REG_A,                                  /* chg */
                OF_CPU_VM | OF_LOAD                     /* flags */
     },
     {   OPC_LDAX,                                      /* opcode */
-               "loadax",                               /* mnemonic */
-               0,                                      /* size */
+               "ldax",                                 /* mnemonic */
+               1,                                      /* size */
                REG_NONE,                               /* use */
                REG_AX,                                 /* chg */
                OF_CPU_VM | OF_LOAD                     /* flags */
     },
     {   OPC_LDEAX,                                     /* opcode */
-               "loadeax",                              /* mnemonic */
-               0,                                      /* size */
+               "ldeax",                                /* mnemonic */
+               1,                                      /* size */
                REG_NONE,                               /* use */
                REG_EAX,                                /* chg */
        OF_CPU_VM | OF_LOAD                     /* flags */
     },
     {   OPC_LEA,                               /* opcode */
                "lea",                                  /* mnemonic */
-               0,                                      /* size */
+               1,                                      /* size */
                REG_NONE,                               /* use */
                REG_AX,                                 /* chg */
        OF_CPU_VM                               /* flags */
     },
     {   OPC_LEAVE,                                     /* opcode */
                "leave",                                /* mnemonic */
-               0,                                      /* size */
+               1,                                      /* size */
                REG_NONE,                               /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM                               /* flags */
     },
     {   OPC_PHA,                               /* opcode */
-               "pusha",                                /* mnemonic */
-               0,                                      /* size */
+               "pha",                                  /* mnemonic */
+               1,                                      /* size */
                REG_A,                                  /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM                               /* flags */
     },
     {   OPC_PHAX,                                      /* opcode */
-               "pushax",                               /* mnemonic */
-               0,                                      /* size */
+               "phax",                                 /* mnemonic */
+               1,                                      /* size */
                REG_AX,                                 /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM                               /* flags */
     },
     {   OPC_PHEAX,                                     /* opcode */
-               "pusheax",                              /* mnemonic */
-               0,                                      /* size */
+               "pheax",                                /* mnemonic */
+               1,                                      /* size */
                REG_EAX,                                /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM                               /* flags */
     },
+    {   OPC_RET,                               /* opcode */
+               "ret",                                  /* mnemonic */
+               1,                                      /* size */
+               REG_NONE,                               /* use */
+               REG_NONE,                               /* chg */
+       OF_CPU_VM | OF_RET                      /* flags */
+    },
     {   OPC_SPACE,                                     /* opcode */
                "space",                                /* mnemonic */
-               0,                                      /* size */
+               1,                                      /* size */
                REG_NONE,                               /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM                               /* flags */
     },
     {   OPC_STA,                               /* opcode */
-               "storea",                               /* mnemonic */
-               0,                                      /* size */
+               "sta",                                  /* mnemonic */
+               1,                                      /* size */
                REG_A,                                  /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM                               /* flags */
     },
     {   OPC_STAX,                              /* opcode */
-               "storeax",                              /* mnemonic */
-               0,                                      /* size */
+               "stax",                                 /* mnemonic */
+               1,                                      /* size */
                REG_AX,                                 /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM                               /* flags */
     },
     {   OPC_STEAX,                                     /* opcode */
-               "storeeax",                             /* mnemonic */
-               0,                                      /* size */
+               "steax",                                /* mnemonic */
+               1,                                      /* size */
                REG_EAX,                                /* use */
                REG_NONE,                               /* chg */
        OF_CPU_VM                               /* flags */
@@ -604,21 +611,21 @@ const OPCDesc OPCTable[OPCODE_COUNT] = {
                0,                                      /* size */
                REG_A,                                  /* use */
                REG_NONE,                               /* chg */
-       OF_NONE                                 /* flags */
+       OF_STORE                                /* flags */
     },
     {   OP65_STX,                                      /* opcode */
                "stx",                                  /* mnemonic */
                0,                                      /* size */
                REG_X,                                  /* use */
                REG_NONE,                               /* chg */
-       OF_NONE                                 /* flags */
+       OF_STORE                                /* flags */
     },
     {   OP65_STY,                                      /* opcode */
                "sty",                                  /* mnemonic */
                0,                                      /* size */
                REG_Y,                                  /* use */
                REG_NONE,                               /* chg */
-       OF_NONE                                 /* flags */
+       OF_STORE                                /* flags */
     },
     {   OP65_TAX,                                      /* opcode */
                "tax",                                  /* mnemonic */
@@ -672,7 +679,7 @@ const OPCDesc OPCTable[OPCODE_COUNT] = {
     {   OP65_TYA,                                      /* opcode */
                "tya",                                  /* mnemonic */
                1,                                      /* size */
-               REG_A,                                  /* use */
+               REG_Y,                                  /* use */
                REG_A,                                  /* chg */
        OF_XFR                                  /* flags */
     },