pcm-assember: Add support for raw values
authorPaul Kocialkowski <contact@paulk.fr>
Fri, 24 Feb 2017 18:57:14 +0000 (19:57 +0100)
committerPaul Kocialkowski <contact@paulk.fr>
Fri, 24 Feb 2017 18:57:14 +0000 (19:57 +0100)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
pcm-assembler/pcm-assembler.c

index 3caf8b8..cf97389 100644 (file)
@@ -335,6 +335,7 @@ complete:
 int arguments_parse(int stage, char *arguments[], unsigned int count, unsigned int address)
 {
        unsigned int location;
+       unsigned int value;
        char *mnemonic;
        int rc;
 
@@ -377,6 +378,17 @@ int arguments_parse(int stage, char *arguments[], unsigned int count, unsigned i
                        return -1;
 
                return 0;
+       } else if (strcmp(mnemonic, ".raw") == 0) {
+               if (count < 2)
+                       return -1;
+
+               value = strtol(arguments[1], NULL, 16);
+
+               rc = pcm_ops_asm_write(value, mnemonic);
+               if (rc < 0)
+                       return -1;
+
+               return 1;
        } else if (mnemonic[0] == ';') {
                /* That's a comment. */
                return 0;