changeset 1726:f9128665a47e

Implement operator types DO_SET_MEM_HI and DO_SET_MEM_LO. Not used yet.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 07 Jun 2018 14:48:26 +0300
parents 40a5ba0b3838
children 8eb5ff34864a
files tools/lib64gfx.c tools/lib64gfx.h
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64gfx.c	Thu Jun 07 14:47:37 2018 +0300
+++ b/tools/lib64gfx.c	Thu Jun 07 14:48:26 2018 +0300
@@ -645,6 +645,8 @@
     {
         case DO_COPY:
         case DO_SET_MEM:
+        case DO_SET_MEM_HI:
+        case DO_SET_MEM_LO:
         case DO_SET_OP:
             switch (op->subject)
             {
@@ -802,6 +804,8 @@
         {
             case DO_COPY:
             case DO_SET_MEM:
+            case DO_SET_MEM_HI:
+            case DO_SET_MEM_LO:
             case DO_SET_OP:
                 switch (op->subject)
                 {
@@ -857,6 +861,13 @@
                                 value = op->offs;
                                 break;
 
+                            case DO_SET_MEM_HI:
+                                value = (*src >> 4) & 0x0f;
+                                break;
+
+                            case DO_SET_MEM_LO:
+                                value = *src & 0x0f;
+                                break;
                         }
                         switch (op->subject)
                         {
@@ -1059,6 +1070,14 @@
                                 *dst = value;
                                 break;
 
+                            case DO_SET_MEM_HI:
+                                *dst |= (value & 0x0f) << 4;
+                                break;
+
+                            case DO_SET_MEM_LO:
+                                *dst |= value & 0x0f;
+                                break;
+
                             case DO_SET_OP:
                                 // Do nothing in this case
                                 break;
--- a/tools/lib64gfx.h	Thu Jun 07 14:47:37 2018 +0300
+++ b/tools/lib64gfx.h	Thu Jun 07 14:48:26 2018 +0300
@@ -86,6 +86,9 @@
     DO_SET_MEM,            // Set subject value or fill subject memory area to byte value from offset
     DO_SET_OP,             // Like above but value from op->offs field instead
 
+    DO_SET_MEM_HI,         // Copy one byte value like DO_SET_MEM, but high nibble only
+    DO_SET_MEM_LO,         // Like above, but low nibble
+
     DO_DEC_FUNC,           // Execute specified decoding function (only for decoding operations)
     DO_ENC_FUNC,           // Same, but for encoding